Anchor to section titled 'undefined'

shopPayPaymentRequestSessionCreate
mutation

Create a new Shop Pay payment request session.


A payment request object.

Anchor to sourceIdentifier
sourceIdentifier
required

A unique identifier for the payment request session.


Was this section helpful?

The new Shop Pay payment request session object.

Error codes for failed Shop Pay payment request session mutations.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation shopPayPaymentRequestSessionCreate($paymentRequest: ShopPayPaymentRequestInput!, $sourceIdentifier: String!) {
  shopPayPaymentRequestSessionCreate(paymentRequest: $paymentRequest, sourceIdentifier: $sourceIdentifier) {
    shopPayPaymentRequestSession {
      # ShopPayPaymentRequestSession fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "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": [
      {
        "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"
    }
  },
  "sourceIdentifier": "<your-sourceIdentifier>"
}
input ShopPayPaymentRequestInput {
  deliveryMethods: [ShopPayPaymentRequestDeliveryMethodInput!]
  discountCodes: [String!]
  discounts: [ShopPayPaymentRequestDiscountInput!]
  lineItems: [ShopPayPaymentRequestLineItemInput!]
  locale: String!
  paymentMethod: String
  presentmentCurrency: CurrencyCode!
  selectedDeliveryMethodType: ShopPayPaymentRequestDeliveryMethodType
  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 {
  finalItemPrice: MoneyInput
  finalLinePrice: MoneyInput
  image: ShopPayPaymentRequestImageInput
  itemDiscounts: [ShopPayPaymentRequestDiscountInput!]
  label: String
  lineDiscounts: [ShopPayPaymentRequestDiscountInput!]
  originalItemPrice: MoneyInput
  originalLinePrice: MoneyInput
  quantity: Int!
  requiresShipping: Boolean
  sku: String
}

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

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

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