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) includesstatus. 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.
All Values
Final States
CANCELLED,EXPIREDandREFUNDEDnever change.COMPLETED,FAILEDandREFUND_FAILEDare 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_RECEIVEDis not final.
Refunds
From most statuses a transaction can move toAWAITING_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 exceptWAITING_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.
- On-ramp
- Off-ramp
- Cross-ramp
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.
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 transactionCancel 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 aCANCELLED_CROSS_RAMP webhook is sent
Whatβs Next