Idempotency key for store credit update APIs

Looks like there is an oversight by shopify for not supporting Idempotency key for store credit update transactions which will result in double adding or double debiting, will it be added to the API in the future? storeCreditAccountCredit - GraphQL Admin

Hi @Andrew_Jaanuu

Is the storeCreditAccount API called through a webhook? Can verify the webhook_id to avoid duplicate calls

Hi @Andrew_Jaanuu

Can you describe your use case more for having this available?

@Liam-Shopify @kyle_liu the basic use case of graphql to add or remove store credit, since store credit is like some payment method, there should be idempotency key on the request to prevent credit being added or removed twice because of duplicate requests:

mutation storeCreditAccountCredit($id: ID!, $creditInput: StoreCreditAccountCreditInput!) {
  storeCreditAccountCredit(id: $id, creditInput: $creditInput) {
    storeCreditAccountTransaction {
      amount {
        amount
        currencyCode
      }
      account {
        id
        balance {
          amount
          currencyCode
        }
      }
    }
    userErrors {
      message
      field
    }
  }
}

I would second this, we recently had a flow creating store credit via a graphQL call. There was a case where the flow executed twice for the same triggering event (confirmed as a bugged execution by Shopify support). This resulted in a duplication of store credit for a customer account.

An idempotency key would have prevented this for us