Skip to main content

Retrieve payment status

From the merchant server, look up the current status using the saved paymentIntentId. API authentication is not required.

const response = await fetch(
`${process.env.STBL_PAY_BACKEND}/payment_status/${encodeURIComponent(paymentIntentId)}`,
);
if (!response.ok) throw new Error(`Status lookup failed: HTTP ${response.status}`);
const payment = await response.json();

Your own order display API needs login and an order ownership check. Use the ID saved on the order, not an arbitrary payment ID passed by the browser.

Handling the response​

The response fields are summarized in the REST reference. For the definition of each field, see PaymentStatusView in the OpenAPI specification. Amounts and fees are not included in this response. Do not treat a lookup failure or timeout as a failed payment.

StatusOrder-side handling
settledConfirm the match with the order, and mark it as paid exactly once
canceled / expired / failedEnd the order that has not been fulfilled, following your business rules
nonce_conflictThe outcome cannot be determined, so stop automatic shipping and automatic re-billing, and ask the contact to investigate with the payment ID
The other 6 statusesThe payment is in progress; continue looking it up

Use this for a confirming lookup when you receive a Webhook, and for periodic reconciliation of unconfirmed orders whose notification you missed. Keep checking even if the browser does not return.

See also Completion criteria and Meaning of statuses.