younifyd
Menu

giftCardDebit

Removes funds from a gift card, decreasing its available balance. Use this for manual balance adjustments — for example, correcting an accidental over-credit or applying a fee.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the giftCardDebit action (under Gift).
  3. Fill in the fields below, then reference the result from later steps as {{giftcarddebit.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation GiftCardDebit($id: ID!, $debitInput: GiftCardDebitInput!) {
  giftCardDebit(id: $id, debitInput: $debitInput) {
    giftCardDebitTransaction {
      amount {
        amount
        currencyCode
      }
      giftCard {
        balance
        createdAt
        crossCurrencyRedemptionStrategy
        customer
        deactivatedAt
        enabled
        expiresOn
        id
        initialValue
        isRedeemable
        lastCharacters
        lineItem
        maskedCode
        note
        order
        recipientAttributes
        templateSuffix
        updatedAt
      }
      id
      note
      processedAt
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstringrequired

The ID of the gift card to be debited.

debitInputobjectrequired

The input fields to debit a gift card.

debitAmountobjectrequired2 fields
notestring
processedAtstring
json
{
  "id": "string",
  "debitInput": {
    "debitAmount": {
      "amount": "string",
      "currencyCode": "USD"
    },
    "note": "string",
    "processedAt": "string"
  }
}

Response

Read the result with {{giftcarddebit.response.data.data.giftCardDebit}}. If the API returns errors, the step fails and they are at {{giftcarddebit.response.data.errors}}.

giftCardDebitTransactionobject
amountobject2 fields
giftCardobject18 fields
idstring
notestring
processedAtstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

giftCardDebit — Shopify — Documentation