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. It stays success once refunded (the order lists its refunds), and is failed when its payment request was cancelled with nothing paid. 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";
                            /** Format: double */
                            amount_paid: number;
                            /** Format: double */
                            amount_unpaid: number;
                            is_retry_available: boolean;
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References ​

ReferenceResolves To
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters ​

  • order_number (path): order number

Responses ​

200 ​

OK

400 ​

Bad request

401 ​

Not authorized for given operation on the Resource

404 ​

Requested resource not found

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. It stays `success` once refunded (the order lists its refunds), and is `failed` when its payment request was cancelled with nothing paid. 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"
      }
    }
  ],
  "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"
                    ]
                  },
                  "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"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Order payments"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-name-override": "getPaymentStatus"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: