Skip to content

pos-get-payment-status ​

Method: GET
Path: /pos/orders/{order_number}/payment-status

Tags: Order payments

Summary ​

Retrieve payment status

Description ​

Retrieves the authoritative payment status of an order. After a payment attempt, poll this endpoint from your return URL every 2-3 seconds until status is success or failed. When is_retry_available is true, the payment can be retried. For an order not on the customer's credit line that its loyalty points, credit balance or discounts pay in full, so it needs no payment, status is success once its purchase completes; until then it is pending (partially_paid once part of its credit balance is settled against it); amount_paid and amount_unpaid are the parts of that credit balance settled and still to be settled (both 0 when no credit balance is used); and is_retry_available is false. An order paid by bank transfer, into the customer's virtual account or recorded by an admin as one, reports the same way: pending until its transfers are settled against it, partially_paid while part of it is, then success, with amount_paid and amount_unpaid the parts settled and still to be settled. A refunded gateway order reports refunded or refund_initiated. A payment request cancelled with nothing paid reports failed. A cancelled order has no payment status to report: the request fails with the validation-error error code.

Pos SDK Usage ​

SDK Method: pos.getPaymentStatus()

Example:

typescript
const { data, error } = await pos.getPaymentStatus({ order_number: "1234567890" });

if (error) {
  console.error("Failed to get payment status:", error.message);
} else {
  console.log("Payment status:", data.status);
  console.log("Amount paid:", data.amount_paid);
  console.log("Amount unpaid:", data.amount_unpaid);
  console.log("Retry available:", data.is_retry_available);
}

TypeScript Definition ​

typescript
"pos-get-payment-status": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description order number */
                order_number: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        /** @default order details */
                        message: $Read<string>;
                        success: $Read<boolean>;
                        content: {
                            /** @enum {string} */
                            status: "pending" | "success" | "failed" | "partially_paid" | "debit_scheduled" | "collection_due" | "refunded" | "refund_initiated";
                            /** Format: double */
                            amount_paid: number;
                            /** Format: double */
                            amount_unpaid: number;
                            is_retry_available: boolean;
                        };
                    };
                };
            };
            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 ​

ReferenceResolves To
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

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 ​

json
{
  "operationId": "pos-get-payment-status",
  "summary": "Retrieve payment status",
  "description": "Retrieves the authoritative payment status of an order. After a payment attempt, poll this endpoint from your return URL every 2-3 seconds until `status` is `success` or `failed`. When `is_retry_available` is `true`, the payment can be retried. For an order not on the customer's credit line that its loyalty points, credit balance or discounts pay in full, so it needs no payment, `status` is `success` once its purchase completes; until then it is `pending` (`partially_paid` once part of its credit balance is settled against it); `amount_paid` and `amount_unpaid` are the parts of that credit balance settled and still to be settled (both `0` when no credit balance is used); and `is_retry_available` is `false`. An order paid by bank transfer, into the customer's virtual account or recorded by an admin as one, reports the same way: `pending` until its transfers are settled against it, `partially_paid` while part of it is, then `success`, with `amount_paid` and `amount_unpaid` the parts settled and still to be settled. A refunded gateway order reports `refunded` or `refund_initiated`. A payment request cancelled with nothing paid reports `failed`. A cancelled order has no payment status to report: the request fails with the `validation-error` error code.",
  "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}$"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "default": "order details",
                "readOnly": true
              },
              "success": {
                "type": "boolean",
                "readOnly": true
              },
              "content": {
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "success",
                      "failed",
                      "partially_paid",
                      "debit_scheduled",
                      "collection_due",
                      "refunded",
                      "refund_initiated"
                    ]
                  },
                  "amount_paid": {
                    "type": "number",
                    "format": "double"
                  },
                  "amount_unpaid": {
                    "type": "number",
                    "format": "double"
                  },
                  "is_retry_available": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "status",
                  "amount_paid",
                  "amount_unpaid",
                  "is_retry_available"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      },
      "links": {
        "RetryPayment": {
          "operationId": "pos-retry-order-payment",
          "parameters": {
            "order_number": "$request.path.order_number"
          },
          "description": "Retry the payment when `is_retry_available` is `true` and `status` is `failed`."
        },
        "GetOrderDetail": {
          "operationId": "pos-get-order-detail",
          "parameters": {
            "order_number": "$request.path.order_number"
          },
          "description": "Retrieve the full order detail after payment completes."
        }
      }
    },
    "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-get-payment-status"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Order payments"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-name-override": "getPaymentStatus"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: