Anchor to section titled 'undefined'

shopPayPaymentRequestSessionSubmit
mutation

Submits a Shop Pay payment request session.


Anchor to idempotencyKey
idempotencyKey
required

The idempotency key is used to guarantee an idempotent result.

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

The final payment request object.

A token representing a payment session request.


Was this section helpful?

The checkout on which the payment was applied.

Error codes for failed Shop Pay payment request session mutations.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation shopPayPaymentRequestSessionSubmit($idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!, $token: String!) {
  shopPayPaymentRequestSessionSubmit(idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest, token: $token) {
    paymentRequestReceipt {
      # ShopPayPaymentRequestReceipt fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "idempotencyKey": "<your-idempotencyKey>",
  "orderName": "<your-orderName>",
  "paymentRequest": {
    "deliveryMethods": [
      {
        "amount": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "code": "<your-code>",
        "deliveryExpectationLabel": "<your-deliveryExpectationLabel>",
        "detail": "<your-detail>",
        "label": "<your-label>",
        "maxDeliveryDate": "",
        "minDeliveryDate": ""
      }
    ],
    "discountCodes": [
      "<your-discountCodes>"
    ],
    "discounts": [
      {
        "amount": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "label": "<your-label>"
      }
    ],
    "lineItems": [
      {
        "amount": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "finalItemPrice": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "finalLinePrice": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "image": {
          "alt": "<your-alt>",
          "url": "<your-url>"
        },
        "itemDiscounts": [
          {
            "amount": {
              "amount": {
                "amount": "29.99",
                "currencyCode": "AED"
              },
              "currencyCode": "AED"
            },
            "label": "<your-label>"
          }
        ],
        "label": "<your-label>",
        "lineDiscounts": [
          {
            "amount": {
              "amount": {
                "amount": "29.99",
                "currencyCode": "AED"
              },
              "currencyCode": "AED"
            },
            "label": "<your-label>"
          }
        ],
        "originalItemPrice": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "originalLinePrice": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "quantity": 1,
        "requiresShipping": true,
        "sku": "<your-sku>"
      }
    ],
    "locale": "<your-locale>",
    "paymentMethod": "<your-paymentMethod>",
    "presentmentCurrency": "AED",
    "selectedDeliveryMethodType": "PICKUP",
    "shippingLines": [
      {
        "amount": {
          "amount": "29.99",
          "currencyCode": "AED"
        },
        "code": "<your-code>",
        "label": "<your-label>"
      }
    ],
    "subtotal": {
      "amount": "29.99",
      "currencyCode": "AED"
    },
    "total": {
      "amount": "29.99",
      "currencyCode": "AED"
    },
    "totalShippingPrice": {
      "discounts": [
        {
          "amount": {
            "amount": {
              "amount": "29.99",
              "currencyCode": "AED"
            },
            "currencyCode": "AED"
          },
          "label": "<your-label>"
        }
      ],
      "finalTotal": {
        "amount": "29.99",
        "currencyCode": "AED"
      },
      "originalTotal": {
        "amount": "29.99",
        "currencyCode": "AED"
      }
    },
    "totalTax": {
      "amount": "29.99",
      "currencyCode": "AED"
    }
  },
  "token": "<your-token>"
}
input ShopPayPaymentRequestInput {
  deliveryMethods: [ShopPayPaymentRequestDeliveryMethodInput!]
  discountCodes: [String!]
  discounts: [ShopPayPaymentRequestDiscountInput!]
  lineItems: [ShopPayPaymentRequestLineItemInput!]
  locale: String!
  paymentMethod: String
  presentmentCurrency: CurrencyCode!
  selectedDeliveryMethodType: ShopPayPaymentRequestDeliveryMethodType
  shippingAddress: ShopPayPaymentRequestContactFieldInput
  shippingLines: [ShopPayPaymentRequestShippingLineInput!]
  subtotal: MoneyInput!
  total: MoneyInput!
  totalShippingPrice: ShopPayPaymentRequestTotalShippingPriceInput
  totalTax: MoneyInput
}

input ShopPayPaymentRequestDeliveryMethodInput {
  amount: MoneyInput
  code: String
  deliveryExpectationLabel: String
  detail: String
  label: String
  maxDeliveryDate: ISO8601DateTime
  minDeliveryDate: ISO8601DateTime
}

input ShopPayPaymentRequestDiscountInput {
  amount: MoneyInput
  label: String
}

input ShopPayPaymentRequestLineItemInput {
  amount: MoneyInput
  finalItemPrice: MoneyInput
  finalLinePrice: MoneyInput
  image: ShopPayPaymentRequestImageInput
  itemDiscounts: [ShopPayPaymentRequestDiscountInput!]
  label: String
  lineDiscounts: [ShopPayPaymentRequestDiscountInput!]
  originalItemPrice: MoneyInput
  originalLinePrice: MoneyInput
  quantity: Int!
  requiresShipping: Boolean
  sku: String
}

input ShopPayPaymentRequestContactFieldInput {
  address1: String
  address2: String
  city: String
  companyName: String
  countryCode: String
  email: String
  firstName: String
  lastName: String
  phone: String
  postalCode: String
  provinceCode: String
}

input ShopPayPaymentRequestShippingLineInput {
  amount: MoneyInput
  code: String
  label: String
}

input MoneyInput {
  amount: Decimal!
  currencyCode: CurrencyCode!
}

input ShopPayPaymentRequestTotalShippingPriceInput {
  discounts: [ShopPayPaymentRequestDiscountInput!]
  finalTotal: MoneyInput
  originalTotal: MoneyInput
}