Skip to main content

Transaction statuses

A transaction has three independent fields that together describe its state and outcome: status, result, and type. PaymentsAI also exposes a combinedStatus field that merges status and result into a single value for display.

Status: Where the transaction is

StatusMeaning
waitingThe transaction is waiting for an action to complete (for example, an offsite 3DS step).
sendingThe transaction is being sent to the gateway.
offsiteThe customer has been redirected offsite (for example, to a 3DS challenge or an alternative payment method).
completedThe transaction completed and funds were captured.
partially-refundedPart of the captured amount has been refunded.
refundedThe full captured amount has been refunded.
voidedAn authorization was released without capture.
disputedA chargeback has been opened against the transaction.
timeoutThe gateway did not respond in time.
not-sentThe transaction was never sent to the gateway.
suspendedThe transaction has been suspended.

Result: How the transaction turned out

ResultMeaning
approvedThe gateway approved the transaction.
declinedThe gateway declined the transaction.
canceledThe transaction was canceled.
abandonedThe customer abandoned an offsite step without completing it.
unknownThe outcome is not yet known.

The declined result is generic. When result is declined, the API response indicates that the transaction was declined and includes any available avsResponse, cvvResponse, and data3ds. It does not return the gateway's raw issuer decline code. The specific decline reason (gateway response code and message) is available in the PAI panel instead of the API response.

For customer-facing UI, show a generic "payment declined, try another card" message. Drive programmatic logic using the result field, and diagnose the specific reason inside the panel.

Type: What kind of transaction it is

TypeMeaning
saleAuthorize and capture in one step.
authorizeReserve funds without capturing.
captureCapture of a prior authorization.
refundA refund of a captured transaction.
creditA credit to the customer.
voidA release of a prior authorization without capture.
3ds-authenticationA 3D Secure authentication step.

You create only sale and authorize via POST /transactions. The other types appear on transactions that PaymentsAI generates as a result of other actions. For example, refund appears when you call the refund endpoint, and void appears when an authorization is released. The public API does not currently expose an endpoint to create a void transaction directly. See Transactions.

Combined status

The combinedStatus field collapses status and the abandoned value from result into one field, which provides a convenient way to populate a single status column in your UI. It can return any value of status listed above, plus abandoned: completed, refunded, partially-refunded, voided, waiting, timeout, not-sent, disputed, sending, offsite, suspended, or abandoned.

Lifecycle

A transaction starts either as an authorization (type: authorize, status: waiting) or as a direct sale (type: sale, status: completed). From there, it can be refunded, disputed, or remain terminal.

FromToTrigger
startwaitingPOST /transactions with type: "authorize"
startcompletedPOST /transactions with type: "sale"
waitingcompletedPOST /transactions with type: "sale" (using the same paymentInstrumentId) to capture the authorization. See Authorize and capture.
completedpartially-refundedPOST /transactions/{id}/refund with amount < refundableAmount
completedrefundedPOST /transactions/{id}/refund with no body or amount = refundableAmount
partially-refundedpartially-refundedAnother partial refund action.
partially-refundedrefundedFinal refund covering the remaining refundableAmount.
completeddisputedCardholder opens a chargeback through their bank. See Dispute process.

The refunded, voided, and disputed statuses are terminal from the API perspective. The refundableAmount becomes 0, and further refund calls return a 409 Conflict error. The waiting, sending, offsite, timeout, not-sent, and suspended statuses are transient. They resolve to one of the terminal states above or remain unchanged if the gateway fails to respond.