Requires write_gift_card_transactions access scope. Also: User needs create_and_edit_gift_cards permission.

Debit a gift card.


The input fields to debit a gift card.

Anchor to id
id
required

The ID of the gift card to be debited.


Was this section helpful?

The gift card debit transaction that was created.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation giftCardDebit($debitInput: GiftCardDebitInput!, $id: ID!) {
  giftCardDebit(debitInput: $debitInput, id: $id) {
    giftCardDebitTransaction {
      # GiftCardDebitTransaction fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "debitInput": {
    "debitAmount": {
      "amount": "29.99",
      "currencyCode": "AED"
    },
    "note": "<your-note>",
    "processedAt": "2019-09-07T15:50:00Z"
  },
  "id": "gid://shopify/<objectName>/10079785100"
}
input GiftCardDebitInput {
  debitAmount: MoneyInput!
  note: String
  processedAt: DateTime
}

input MoneyInput {
  amount: Decimal!
  currencyCode: CurrencyCode!
}