Retry a submission with the same idempotency key
Description
Retry a submission, for example after a network timeout, with the same `token` and `idempotencyKey` as the first call to `shopPayPaymentRequestSessionSubmit`. The payment request session already has a receipt for that key, so the mutation returns that receipt instead of processing the payment again. Its `processingStatusType` is `processing` while the payment is still being processed.
Query
mutation RetryShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) {
shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) {
paymentRequestReceipt {
token
processingStatusType
}
userErrors {
field
message
code
}
}
}
Variables
{
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
-d '{
"query": "mutation RetryShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) { shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) { paymentRequestReceipt { token processingStatusType } userErrors { field message code } } }",
"variables": {
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
}
}'
React Router
import { unauthenticated } from "../shopify.server";
export const loader = async () => {
const { storefront } = await unauthenticated.storefront(
'your-development-store.myshopify.com'
);
const response = await storefront.graphql(
`#graphql
mutation RetryShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) {
shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) {
paymentRequestReceipt {
token
processingStatusType
}
userErrors {
field
message
code
}
}
}`,
{
variables: {
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
},
},
);
const json = await response.json();
return json.data;
}
Node.js
const client = new shopify.clients.Storefront({
domain: 'your-development-store.myshopify.com',
storefrontAccessToken,
});
const data = await client.query({
data: {
"query": `mutation RetryShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) {
shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) {
paymentRequestReceipt {
token
processingStatusType
}
userErrors {
field
message
code
}
}
}`,
"variables": {
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
},
},
});
Response
{
"shopPayPaymentRequestSessionSubmit": {
"paymentRequestReceipt": {
"token": "9c1e7b3a5d2f4c6e8b0a1d3f5e7c9b2a",
"processingStatusType": "processing"
},
"userErrors": []
}
}
Submit a payment request session
Description
Submit the final payment request for a session that `shopPayPaymentRequestSessionCreate` started. Pass that session's token as `token` and the buyer's encrypted Shop Pay payment method as `paymentRequest.paymentMethod`. The `idempotencyKey` guarantees that the payment is processed only once. The receipt's `processingStatusType` reports the processing state: `ready` means the submission was accepted and the payment is queued for processing.
Query
mutation ShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) {
shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) {
paymentRequestReceipt {
token
processingStatusType
paymentRequest {
total {
amount
currencyCode
}
}
}
userErrors {
field
message
code
}
}
}
Variables
{
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
-d '{
"query": "mutation ShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) { shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) { paymentRequestReceipt { token processingStatusType paymentRequest { total { amount currencyCode } } } userErrors { field message code } } }",
"variables": {
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
}
}'
React Router
import { unauthenticated } from "../shopify.server";
export const loader = async () => {
const { storefront } = await unauthenticated.storefront(
'your-development-store.myshopify.com'
);
const response = await storefront.graphql(
`#graphql
mutation ShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) {
shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) {
paymentRequestReceipt {
token
processingStatusType
paymentRequest {
total {
amount
currencyCode
}
}
}
userErrors {
field
message
code
}
}
}`,
{
variables: {
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
},
},
);
const json = await response.json();
return json.data;
}
Node.js
const client = new shopify.clients.Storefront({
domain: 'your-development-store.myshopify.com',
storefrontAccessToken,
});
const data = await client.query({
data: {
"query": `mutation ShopPayPaymentRequestSessionSubmit($token: String!, $idempotencyKey: String!, $paymentRequest: ShopPayPaymentRequestInput!) {
shopPayPaymentRequestSessionSubmit(token: $token, idempotencyKey: $idempotencyKey, paymentRequest: $paymentRequest) {
paymentRequestReceipt {
token
processingStatusType
paymentRequest {
total {
amount
currencyCode
}
}
}
userErrors {
field
message
code
}
}
}`,
"variables": {
"token": "3f8a2c7e9b1d4e6f8a0c2e4b6d8f1a3c",
"idempotencyKey": "order-1001-submit",
"paymentRequest": {
"lineItems": [
{
"label": "Ceramic mug",
"quantity": 1,
"originalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalItemPrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"originalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"finalLinePrice": {
"amount": "25.00",
"currencyCode": "USD"
},
"requiresShipping": false
}
],
"subtotal": {
"amount": "25.00",
"currencyCode": "USD"
},
"total": {
"amount": "25.00",
"currencyCode": "USD"
},
"locale": "en",
"presentmentCurrency": "USD",
"paymentMethod": "ENCRYPTED_SHOP_PAY_PAYMENT_METHOD"
}
},
},
});
Response
{
"shopPayPaymentRequestSessionSubmit": {
"paymentRequestReceipt": {
"token": "9c1e7b3a5d2f4c6e8b0a1d3f5e7c9b2a",
"processingStatusType": "ready",
"paymentRequest": {
"total": {
"amount": "25.0",
"currencyCode": "USD"
}
}
},
"userErrors": []
}
}