pos-retry-order-payment
Method: POST
Path: /pos/orders/{order_number}/retry-payment
Tags: Order payments
Summary
Retry payment
Description
Retries payment with an eligible payment method while an amount remains payable. A pending or failed gateway payment can be retried without a waiting period, subject to the order's payment state and retry limit. An order not on the customer's credit line that its loyalty points, credit balance or discounts pay in full has nothing to retry: the request fails with the payment-retry-not-allowed error code, or payment-already-successful once the order is paid. The payment method must be one the store offers on the token's sales channel (GET /payments/payment-methods lists them); any other is refused with a 400.
Pos SDK Usage
SDK Method: pos.retryOrderPayment()
Example:
const { data, error } = await pos.retryOrderPayment(
{ order_number: "ORD-2024-001" },
{ payment_method: "upi" }
);
if (error) {
console.error("Payment retry failed:", error.message);
} else {
console.log("New payment initiated:", data.payment_info);
}TypeScript Definition
"pos-retry-order-payment": {
parameters: {
query?: never;
header?: never;
path: {
/** @description order number */
order_number: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
payment_method?: components["schemas"]["RetryPaymentMethodPayload"];
/** @description Deprecated. Prefer payment_method; do not send both forms. */
payment_gateway_params?: components["schemas"]["LegacyRetryPaymentParams"];
} | unknown | unknown;
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
/** @description Gateway initiation details for the new payment attempt. `null` when the retry starts no gateway payment: a manual payment method (such as cash on delivery) or a bank transfer. */
payment_info: components["schemas"]["JusPayHyperCheckoutResponse"] | components["schemas"]["JusPayExpressCheckoutResponse"] | components["schemas"]["PayuPaymentInfo"] | null;
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["RetryPaymentMethodPayload"] | RetryPaymentMethodPayload |
components["schemas"]["LegacyRetryPaymentParams"] | LegacyRetryPaymentParams |
components["schemas"]["JusPayHyperCheckoutResponse"] | JusPayHyperCheckoutResponse |
components["schemas"]["JusPayExpressCheckoutResponse"] | JusPayExpressCheckoutResponse |
components["schemas"]["PayuPaymentInfo"] | PayuPaymentInfo |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["NotFound"] | NotFound |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Parameters
- order_number (path): order number
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.
403
Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.
404
Requested resource not found
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
{
"operationId": "pos-retry-order-payment",
"summary": "Retry payment",
"description": "Retries payment with an eligible payment method while an amount remains payable. A pending or failed gateway payment can be retried without a waiting period, subject to the order's payment state and retry limit. An order not on the customer's credit line that its loyalty points, credit balance or discounts pay in full has nothing to retry: the request fails with the `payment-retry-not-allowed` error code, or `payment-already-successful` once the order is paid. The payment method must be one the store offers on the token's sales channel (`GET /payments/payment-methods` lists them); any other is refused with a 400.",
"parameters": [
{
"name": "order_number",
"in": "path",
"description": "order number",
"required": true,
"schema": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"pattern": "^[A-Za-z0-9_-]{1,128}$"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"description": "Provide exactly one of payment_method or the deprecated payment_gateway_params.",
"type": "object",
"properties": {
"payment_method": {
"$ref": "#/components/schemas/RetryPaymentMethodPayload"
},
"payment_gateway_params": {
"description": "Deprecated. Prefer payment_method; do not send both forms.",
"$ref": "#/components/schemas/LegacyRetryPaymentParams"
}
},
"anyOf": [
{
"required": [
"payment_method"
],
"not": {
"required": [
"payment_gateway_params"
]
}
},
{
"required": [
"payment_gateway_params"
],
"not": {
"required": [
"payment_method"
]
}
}
]
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"payment_info": {
"description": "Gateway initiation details for the new payment attempt. `null` when the retry starts no gateway payment: a manual payment method (such as cash on delivery) or a bank transfer.",
"anyOf": [
{
"$ref": "#/components/schemas/JusPayHyperCheckoutResponse"
},
{
"$ref": "#/components/schemas/JusPayExpressCheckoutResponse"
},
{
"$ref": "#/components/schemas/PayuPaymentInfo"
},
{
"type": "null"
}
]
}
},
"required": [
"payment_info"
],
"type": "object"
}
},
"required": [
"message",
"success",
"content"
]
}
}
},
"links": {
"PollRetryPaymentStatus": {
"operationId": "pos-get-payment-status",
"parameters": {
"order_number": "$request.path.order_number"
},
"description": "Poll the payment status after retrying payment."
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-retry-order-payment"
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Order payments"
],
"x-speakeasy-group": "pos",
"x-speakeasy-name-override": "retryOrderPayment"
}Auto-generated from OpenAPI spec and TypeScript definitions