Skip to main content

Overview

Transactions are a crucial part of the flow in Capa, this will guide you on the listing of the transaction and the cancel of the transaction when a user needs to make this action.

Transaction Statuses

Every transaction response (Create On-Ramp, Create Off-Ramp, Create Cross-Ramp, List Transactions, Cancel Transaction) includes status. It is always present and never null. status is a single string enum shared by all transaction types. Each type only reaches a subset of it, listed below.
Treat status as an open enum. New values can be added without a new API version, so ignore (or log) a value you do not recognize instead of failing.

All Values

Final States

  • CANCELLED, EXPIRED and REFUNDED never change.
  • COMPLETED, FAILED and REFUND_FAILED are final for normal processing, but can still move into a refund (AWAITING_REFUND). For example, a payout provider can reverse a fiat payment it had reported as delivered.
  • CRYPTO_NOT_RECEIVED is not final.

Refunds

From most statuses a transaction can move to AWAITING_REFUND, and from there to REFUNDED or REFUND_FAILED. REFUND_FAILED can move to REFUNDED or back to AWAITING_REFUND. A refund cannot start from WAITING_INVOICE or CRYPTO_NOT_RECEIVED (no funds have been received yet), nor from CANCELLED, EXPIRED or REFUNDED.

Allowed Transitions

A status can always stay the same. Every status in the From columns below except WAITING_INVOICE and CRYPTO_NOT_RECEIVED can also move to AWAITING_REFUND; the final statuses CANCELLED and EXPIRED cannot (Refunds). Capa’s operations team can also intervene manually on a transaction, for example to complete it.
The lifecycle diagrams are in the On-Ramp, Off-Ramp and Cross-Ramp guides.

Historical Transactions (REGULAR flow)

New transactions always use the lifecycle above (flow is OTC). Transactions created before the REGULAR flow was retired keep their statuses, so you can still see these when listing past transactions:
  • On-ramp: PENDING β†’ FIAT_RECEIVED, EXPIRED, CANCELLED; FIAT_RECEIVED β†’ IN_PROGRESS, CANCELLED; IN_PROGRESS β†’ COMPLETED.
  • Off-ramp: PENDING β†’ CRYPTO_RECEIVED, CRYPTO_NOT_RECEIVED, EXPIRED, CANCELLED; CRYPTO_NOT_RECEIVED β†’ CRYPTO_RECEIVED, CANCELLED; CRYPTO_RECEIVED β†’ IN_PROGRESS, FAILED, CANCELLED; IN_PROGRESS β†’ COMPLETED_CRYPTO_RECEIVAL, FAILED; COMPLETED_CRYPTO_RECEIVAL β†’ BANK_TRANSFER_PENDING, CANCELLED; BANK_TRANSFER_PENDING β†’ READY_BANK_TRANSFER; READY_BANK_TRANSFER β†’ COMPLETED.
The refund rules are the same.

List Transactions

To get a list of the user’s transactions use the List User Transactions Endpoint. The endpoint has multiple ways in which it can be filtered, by type of transaction, transaction id, user id and it can be listed in order.

Transaction Detail

To get the information of a single transaction the List User Transactions Endpoint can be used and filtered by transaction id so you only receive the specific information of that transaction

Cancel Transaction

Use the Cancel User Transaction Endpoint when an On/Off Ramp wants to be cancelled Only when an On Ramp is in PENDING_PAYMENT status it can be canceled Only when an Off Ramp is in PENDING_PAYMENT or in COMPLETED_CRYPTO_RECEIVAL status it can be canceled Only when a Cross Ramp is in WAITING_INVOICE or PENDING_FUNDS status it can be canceled. Its child orders are cancelled with it and a CANCELLED_CROSS_RAMP webhook is sent
What’s Next