Payments
Initialize, retrieve, list and cancel payments via the Payments API.
The Payment (transaction) object represents a payment collection attempt. Its lifecycle goes from
pending to succeeded (or failed). All routes share the base https://api.wajub.com.
Before you begin
To initialize a payment, you need a public key (pk_...) found in the
Wajub dashboard.
Marketplaces: acting on behalf of a subaccount
Platforms can attribute a payment to a connected subaccount by sending an X-Sync header
alongside their own key — see Subaccounts for the full contract and error
cases.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /payments | Initialize a payment |
GET | /payments/{id} | Retrieve a payment |
GET | /payments | List payments |
DELETE | /payments/{id} | Cancel a payment |
GET | /payments/{id}/refunds | List refunds for a payment |
The Payment object
Create response vs. retrieval response
The POST /payments (create) response includes two additional fields —
authorization_url and authorization_token — that are not present on subsequent retrieval
responses. These are the two most important fields in the create response.
idstringoptionalauthorization_urlstringoptionalauthorization_tokenstringoptionalreferencestringoptionalstatusenumoptionalamountintegeroptionalamount_paidinteger?optionalcurrencystringoptionalchannelstring?optionalpayment_methodobject?optionalsettledbooleanoptionaldescriptionstring?optionalitemsarray?optionaltaxobject?optionalfailure_reasonstring?optionalcustomerobject?optionalmetadataobject?optionalcallbackstring?optionalsandboxbooleanoptionalcredited_atdatetime?optionalcreated_atdatetimeoptionalLifecycle
Events
| Event | Trigger |
|---|---|
payment.created | Payment initialized |
payment.processing | Payment submitted to the provider |
payment.succeeded | Payment successfully validated |
payment.failed | Payment failed (see failure_reason) |
payment.cancelled | Payment cancelled by the customer or expired |
See the full event catalog for refund-specific events — a refund on a
payment does not re-emit a payment.* event, it emits refund.* events instead.