Graph QL pre-payment
These mutations are used with the Storefront API to affect the Shop Pay payment request session.
Details about the ShopPayPaymentRequestSessionCreate mutation can be found on the dedicated Storefront API ShopPayPaymentRequestSessionCreate page.
API version
This example uses Storefront API version2026-10 or later, where only sourceIdentifier is required. In earlier versions, paymentRequest is a required ShopPayPaymentRequestInput! argument, so you must still pass it when you create a session.Mutation
Input
Response
| Argument | Type | Description |
|---|---|---|
| sourceIdentifier | String! | A unique identifier for the source of the order. |
| paymentRequest | ShopPayPaymentRequestInput | The payment request details. Optional and deprecated in Storefront API version 2026-10 and later. Required (ShopPayPaymentRequestInput!) in earlier versions. |
| businessEntityId | String | The full global ID of the business entity to process the payment through, such as gid://shopify/BusinessEntity/123, from the GraphQL Admin API businessEntities query. Omit it to use the store's primary business entity. Available in Storefront API version 2027-01 and later. Refer to Process payments through multiple business entities. |
Source Identifier
The sourceIdentifier must be unique across all orders to ensure accurate tracking and referencing. For instance, it could be a unique ID associated with an order or checkout on your platform.| Field | Type | Description |
|---|---|---|
| token | String | The unique token for the payment request session. |
| sourceIdentifier | String | A unique identifier for the source of the order. |
| checkoutUrl | String | The URL for the checkout associated with the payment request session. |
| paymentRequest | ShopPayPaymentRequest | The payment request associated with the session. Deprecated in Storefront API version 2026-10 and later. |
| businessEntityId | String | The ID of the business entity selected for the session. Returns null if no entity was selected or if the selected entity can't be found. If no entity was selected, then the store's primary business entity processes the payment. Available in Storefront API version 2027-01 and later. |
Anchor to UserErrorsUser Errors
| Field | Type | Description |
|---|---|---|
| field | String | The field that caused the error. |
| code | UserErrorsShopPayPaymentRequestSessionUserErrorsCode | The error code. |
| message | String | The error message. |
Anchor to Example: ShopPayPaymentRequestSessionBusinessEntityUpdateExample: Shop Pay Payment Request Session Business Entity Update
Details about the ShopPayPaymentRequestSessionBusinessEntityUpdate mutation can be found on the dedicated Storefront API ShopPayPaymentRequestSessionBusinessEntityUpdate page. This mutation is available in Storefront API version 2027-01 and later. For when to call it, refer to Process payments through multiple business entities.
Mutation
Input
Response
Anchor to ShopPayPaymentRequestSessionBusinessEntityUpdate ArgumentsShop Pay Payment Request Session Business Entity Update Arguments
| Argument | Type | Description |
|---|---|---|
| token | String! | The unique token for the payment request session. |
| businessEntityId | String! | The full global ID of the business entity to process the payment through, such as gid://shopify/BusinessEntity/123, from the GraphQL Admin API businessEntities query. To use the store's primary business entity, pass its ID. |
You can change the business entity until you submit the payment, or after the latest payment attempt has failed. The mutation returns the updated ShopPayPaymentRequestSession.
Anchor to UserErrorsUser Errors
| Field | Type | Description |
|---|---|---|
| field | String | The field that caused the error. |
| code | UserErrorsShopPayPaymentRequestSessionUserErrorsCode | The error code. |
| message | String | The error message. |
Details about the ShopPayPaymentRequestSessionSubmit mutation can be found on the dedicated Storefront API ShopPayPaymentRequestSessionSubmit page.
Mutation
Input
Response
Anchor to ArgumentsArguments
| Field | Type | Description |
|---|---|---|
| token | String! | The unique token for the payment request session. |
| paymentRequest | ShopPayPaymentRequestInput! | The payment request details. |
| idempotencyKey | String! | A unique string (typically a UUID or similar identifier) that must be attached to the submit request to ensure that payment transactions occur only once. For more information, see idempotent requests. |
| orderName | String | The name to be assigned to the order that is created from the payment request. |
| Field | Type | Description |
|---|---|---|
| token | String | The unique token for the payment request receipt. This will be different than session token. |
| processingStatusType | String | The processing status of the payment request. |
| paymentRequest | ShopPayPaymentRequest | The details of the payment request. |
| shopUser | ShopPayPaymentRequestShopUser | The Shop user that authorized the payment request. Available in Storefront API version 2026-10 and later. Refer to Identify Shop users. |
| businessEntityId | ID | The ID of the business entity recorded when the payment request was submitted. Returns null if no entity was recorded or if the recorded entity can't be found. If no entity was recorded, then the payment went through the store's primary business entity. Available in Storefront API version 2027-01 and later. Refer to Process payments through multiple business entities. |
Anchor to UserErrorsUser Errors
| Field | Type | Description |
|---|---|---|
| field | String | The field that caused the error. |
| code | UserErrorsShopPayPaymentRequestSessionUserErrorsCode | The error code. |
| message | String | The error message. |