pos-retry-order-payment
Method: POST
Path: /pos/orders/{order_number}/retry-payment
Tags: Order payments
Summary
Retry payment
Description
To generate new payment request if first payment request is failed or expired. Retry payment request can be made after 15 mins of last request or immediately after last payment request is marked as failed. 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"]["PaymentMethodPayload"];
};
};
};
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"];
404: components["responses"]["NotFound"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["PaymentMethodPayload"] | PaymentMethodPayload |
components["schemas"]["JusPayHyperCheckoutResponse"] | JusPayHyperCheckoutResponse |
components["schemas"]["JusPayExpressCheckoutResponse"] | JusPayExpressCheckoutResponse |
components["schemas"]["PayuPaymentInfo"] | PayuPaymentInfo |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Parameters
- order_number (path): order number
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Not authorized for given operation on the Resource
404
Requested resource not found
OpenAPI Definition
{
"operationId": "pos-retry-order-payment",
"summary": "Retry payment",
"description": "To generate new payment request if first payment request is failed or expired. Retry payment request can be made after 15 mins of last request or immediately after last payment request is marked as failed. 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"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"payment_method": {
"$ref": "#/components/schemas/PaymentMethodPayload"
}
}
}
}
}
},
"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.",
"oneOf": [
{
"$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"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Order payments"
],
"x-speakeasy-group": "pos",
"x-speakeasy-name-override": "retryOrderPayment"
}Auto-generated from OpenAPI spec and TypeScript definitions