Refresh transaction status
Fetches the latest payment status from the payment provider and updates the
transaction record if the status has changed. Only applicable to transactions
in PENDING or PROCESSING status.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Fetches the latest payment status for a transaction directly from the payment provider and updates the stored transaction record if the status has advanced. Only transactions still in a non-terminal state (pending or processing) can be refreshed. Returns the updated transaction along with what changed.
Authentication & access
- Requires a client API token:
Authorization: Bearer <token>. - The caller must hold the
transactions.refresh_statuspermission and have the OWNER or OPERATIONS role.
Path parameter
transaction_id(string, required) — the UrbanpayX transaction ID to refresh. It must belong to your client.
State preconditions
- The transaction must be in
pendingorprocessingstatus. A transaction already in a terminal state (success,failed,expired,canceled) cannot be refreshed and returns400. - A short per-transaction cooldown is enforced between refreshes. Calling again before the cooldown elapses returns
429with the number of seconds to wait. - If the transaction has not yet produced an upstream payment session and is not in a reconciliation flow, it has nothing to query upstream and the request returns
400.
Behavior
When the transaction has an upstream payment session, the provider is queried for the current payment status and the result is mapped to an UrbanpayX status:
- If the provider reports a newer status and the transition is allowed, the transaction is updated,
updatedistrue, and a status-change event is emitted. Reaching a terminal status also clears any reconciliation flag. - If the provider status matches the current status, or the transition is not allowed, or the provider returns an unrecognized status, the transaction is left unchanged (
updatedisfalse) andmessageexplains why. - If the transaction advanced to a terminal state or its session changed concurrently (e.g. via a provider webhook) while the provider was being queried, the stale provider response is not applied; the latest stored state is returned with
updatedset tofalse.
Response
200 OK with a TransactionRefreshStatusResponse:
transaction— the updatedTransactionDetailResponse.provider_status— the raw status string returned by the payment provider (may benull).previous_status— the transaction status before this refresh.updated— whether this refresh changed the transaction status.message— a human-readable description of the outcome.
A 202 Accepted is returned instead when the transaction has no upstream payment session yet but is in a reconciliation flow (awaiting a provider callback or manual reconciliation). The provider is not queried; the response records the refresh attempt with updated set to false.
Error responses
| Status | When |
|---|---|
400 | Transaction is in a terminal status that cannot be refreshed; transaction has no upstream payment session and is not in a reconciliation flow; the payment provider rejected the status query |
404 | Transaction not found under this client, or the payment was not found on the payment provider |
502 | The payment provider returned an upstream error while fetching the status |
503 | The payment provider is unreachable |
Standard 401 (authentication), 403 (insufficient permission or role), and 429 (rate limit) responses apply to every endpoint and are documented in the Error reference.