younifyd
Menu

storeCreditAccountDebit

Creates a debit transaction that decreases the store credit account balance by the given amount.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the storeCreditAccountDebit action (under Store).
  3. Fill in the fields below, then reference the result from later steps as {{storecreditaccountdebit.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 StoreCreditAccountDebit($id: ID!, $debitInput: StoreCreditAccountDebitInput!) {
  storeCreditAccountDebit(id: $id, debitInput: $debitInput) {
    storeCreditAccountTransaction {
      account {
        balance
        id
        owner
      }
      amount {
        amount
        currencyCode
      }
      balanceAfterTransaction {
        amount
        currencyCode
      }
      createdAt
      event
      id
      origin
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

idstringrequired

The ID of the store credit account or the ID of the account owner.

debitInputobjectrequired

The input fields for a store credit account debit transaction.

debitAmountobjectrequired2 fields
json
{
  "id": "string",
  "debitInput": {
    "debitAmount": {
      "amount": "string",
      "currencyCode": "USD"
    }
  }
}

Response

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

storeCreditAccountTransactionobject
accountobject3 fields
amountobject2 fields
balanceAfterTransactionobject2 fields
createdAtstring
eventstring

One ofADJUSTMENTORDER_PAYMENTORDER_REFUNDPAYMENT_FAILUREPAYMENT_RETURNEDORDER_CANCELLATIONTAX_FINALIZATIONRECURRING_PAYMENT

idstring
originobject38 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

userErrorsarray<object>
codeobject
fieldobject
messageobject

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

storeCreditAccountDebit — Shopify — Documentation