younifyd
Menu

storeCreditAccountCredit

Adds funds to a StoreCreditAccount by creating a StoreCreditAccountCreditTransaction. The mutation accepts either a store credit account ID, a Customer ID, or a CompanyLocation ID.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the storeCreditAccountCredit action (under Store).
  3. Fill in the fields below, then reference the result from later steps as {{storecreditaccountcredit.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 StoreCreditAccountCredit($id: ID!, $creditInput: StoreCreditAccountCreditInput!) {
  storeCreditAccountCredit(id: $id, creditInput: $creditInput) {
    storeCreditAccountTransaction {
      account {
        balance
        id
        owner
      }
      amount {
        amount
        currencyCode
      }
      balanceAfterTransaction {
        amount
        currencyCode
      }
      createdAt
      event
      expiresAt
      id
      origin
      remainingAmount {
        amount
        currencyCode
      }
    }
    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.

creditInputobjectrequired

The input fields for a store credit account credit transaction.

creditAmountobjectrequired2 fields
expiresAtstring
notifyboolean
json
{
  "id": "string",
  "creditInput": {
    "creditAmount": {
      "amount": "string",
      "currencyCode": "USD"
    },
    "expiresAt": "string",
    "notify": false
  }
}

Response

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

storeCreditAccountTransactionobject
accountobject3 fields
amountobject2 fields
balanceAfterTransactionobject2 fields
createdAtstring
eventstring

One ofADJUSTMENTORDER_PAYMENTORDER_REFUNDPAYMENT_FAILUREPAYMENT_RETURNEDORDER_CANCELLATIONTAX_FINALIZATIONRECURRING_PAYMENT

expiresAtstring
idstring
originobject38 fields

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

remainingAmountobject2 fields
userErrorsarray<object>
codeobject
fieldobject
messageobject

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

storeCreditAccountCredit — Shopify — Documentation