younifyd
Menu

shopPayPaymentRequestSessionSubmit

Finalizes a Shop Pay payment request session. Call this mutation after creating a session with shopPayPaymentRequestSessionCreate.

Use it in a workflow

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the shopPayPaymentRequestSessionSubmit action (under Shop).
  3. Fill in the fields below, then reference the result from later steps as {{shoppaypaymentrequestsessionsubmit.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 ShopPayPaymentRequestSessionSubmit($token: String!, $paymentRequest: ShopPayPaymentRequestInput!, $idempotencyKey: String!, $orderName: String) {
  shopPayPaymentRequestSessionSubmit(
    token: $token
    paymentRequest: $paymentRequest
    idempotencyKey: $idempotencyKey
    orderName: $orderName
  ) {
    paymentRequestReceipt {
      paymentRequest {
        deliveryMethods
        discountCodes
        discounts
        lineItems
        locale
        presentmentCurrency
        selectedDeliveryMethodType
        shippingAddress
        shippingLines
        subtotal
        total
        totalShippingPrice
        totalTax
      }
      processingStatusType
      token
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

tokenstringrequired

A token representing a payment session request.

paymentRequestobjectrequired

The final payment request object.

discountCodesarray<string>
lineItemsarray<object>11 fields
shippingLinesarray<object>3 fields
totalobjectrequired2 fields
subtotalobjectrequired2 fields
discountsarray<object>2 fields
totalShippingPriceobject3 fields
totalTaxobject2 fields
deliveryMethodsarray<object>7 fields
selectedDeliveryMethodTypestring

One ofSHIPPINGPICKUP

localestringrequired
presentmentCurrencystringrequired

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRKCZK

paymentMethodstring
idempotencyKeystringrequired

The idempotency key is used to guarantee an idempotent result.

orderNamestring

The order name to be used for the order created from the payment request.

json
{
  "token": "string",
  "paymentRequest": {
    "total": {
      "amount": "string",
      "currencyCode": "USD"
    },
    "subtotal": {
      "amount": "string",
      "currencyCode": "USD"
    },
    "locale": "string",
    "presentmentCurrency": "USD",
    "discountCodes": [
      "string"
    ],
    "lineItems": [
      {
        "quantity": "string",
        "label": "string",
        "sku": "string",
        "requiresShipping": "string",
        "image": "string",
        "originalLinePrice": "string",
        "finalLinePrice": "string",
        "lineDiscounts": "string",
        "originalItemPrice": "string",
        "finalItemPrice": "string",
        "itemDiscounts": "string"
      }
    ],
    "shippingLines": [
      {
        "code": "string",
        "label": "string",
        "amount": "string"
      }
    ],
    "discounts": [
      {
        "label": "string",
        "amount": "string"
      }
    ],
    "totalShippingPrice": {
      "discounts": [
        "string"
      ],
      "originalTotal": {
        "amount": "string",
        "currencyCode": "string"
      },
      "finalTotal": {
        "amount": "string",
        "currencyCode": "string"
      }
    },
    "totalTax": {
      "amount": "string",
      "currencyCode": "USD"
    },
    "deliveryMethods": [
      {
        "code": "string",
        "label": "string",
        "detail": "string",
        "amount": "string",
        "minDeliveryDate": "string",
        "maxDeliveryDate": "string",
        "deliveryExpectationLabel": "string"
      }
    ],
    "selectedDeliveryMethodType": "SHIPPING"
  },
  "idempotencyKey": "string",
  "orderName": "string"
}

Response

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

paymentRequestReceiptobject
paymentRequestobject13 fields
processingStatusTypestring
tokenstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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