younifyd
Menu

shopPayPaymentRequestSessionCreate

Creates a Shop Pay payment request session for processing payments. The session includes a checkout URL where customers complete their purchase and a token for subsequent operations like submitting the payment.

Use it in a workflow

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

Variables

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

sourceIdentifierstringrequired

A unique identifier for the payment request session.

paymentRequestobjectrequired

A 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
json
{
  "sourceIdentifier": "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"
  }
}

Response

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

shopPayPaymentRequestSessionobject
checkoutUrlstring
paymentRequestobject13 fields
sourceIdentifierstring
tokenstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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