API reference
The merchant API is how your server talks to cTpeWay. This reference is generated from the API description, so it lists exactly what the API defines today.
| Base URL | https://api.ctpeway.com |
| API version | 2.0 |
| Description file | merchant.v1.json (OpenAPI 3.1.0) |
Server-to-server API for merchants. Authenticate with a secret API key.
Authentication
Section titled “Authentication”Send your API key as a bearer token in the Authorization header. Secret API key: Authorization: Bearer ctp_live_sk_…. A publishable key (ctp_…_pk_…) is accepted by these operations only, which serve reference data: getRate, listAssets, listNetworks (each marked x-publishable-key: true). Every other operation refuses it with 403 publishable_key_not_allowed, whatever Origin the request carries: that header binds browsers, not other clients, and nothing on this API relies on it.
See API keys and domains for key types, permissions and how to keep a key safe.
Endpoints
Section titled “Endpoints”These are the endpoints the API description defines so far. The guides also mention endpoints that are planned but not listed here yet; those are marked planned.
Invoices
Section titled “Invoices”| Endpoint | What it does |
|---|---|
| GET/v1/invoices | List invoices |
| POST/v1/invoices | Create an invoice |
| GET/v1/invoices/{id} | Retrieve an invoice |
| POST/v1/invoices/{id}/cancel | Cancel an invoice |
| POST/v1/invoices/{id}/accept_late_payment | Accept a late payment |
| POST/v1/invoices/{id}/accept | Accept what was paid as payment in full |
Payments
Section titled “Payments”| Endpoint | What it does |
|---|---|
| GET/v1/payments | List payments |
| GET/v1/invoices/{id}/payments | List the payments of an invoice |
| GET/v1/deposit_addresses/{id}/payments | List the payments to a deposit address |
| GET/v1/payments/{id} | Retrieve a payment |
Settlements
Section titled “Settlements”| Endpoint | What it does |
|---|---|
| GET/v1/settlements | List settlements |
| GET/v1/settlements/{id} | Retrieve a settlement |
| POST/v1/settlements/{id}/release | Try to release a settlement now |
Deposit addresses
Section titled “Deposit addresses”| Endpoint | What it does |
|---|---|
| GET/v1/deposit_addresses | List deposit addresses |
| POST/v1/deposit_addresses | Create a reusable deposit address |
| GET/v1/deposit_addresses/{id} | Retrieve a deposit address |
| PATCH/v1/deposit_addresses/{id} | Rename, disable or enable a deposit address |
Master wallets
Section titled “Master wallets”| Endpoint | What it does |
|---|---|
| GET/v1/master_wallets | List master wallets |
| GET/v1/master_wallets/{network} | Retrieve the master wallet of a network |
Reference
Section titled “Reference”| Endpoint | What it does |
|---|---|
| GET/v1/networks | List networks |
| GET/v1/assets | List assets |
| GET/v1/rates | The current price of an asset |
| Endpoint | What it does |
|---|---|
| POST/v1/test/invoices/{id}/simulate_payment | Simulate a payment to an invoice |
| POST/v1/test/deposit_addresses/{id}/simulate_payment | Simulate a payment to a deposit address |
| POST/v1/test/payments/{id}/confirm | Confirm a simulated payment that was left at detected |
| POST/v1/test/payments/{id}/add_confirmation | Give a simulated payment one more confirmation |
| POST/v1/test/payments/{id}/attach_transaction | Give a simulated inferred payment its transaction |
| POST/v1/test/webhooks/ping | Send a test event |
Payouts
Section titled “Payouts”| Endpoint | What it does |
|---|---|
| GET/v1/payouts | List payouts |
| POST/v1/payouts | Pay out from a master wallet |
| GET/v1/payouts/{id} | Retrieve a payout |
| POST/v1/payouts/{id}/cancel | Cancel a payout that has not been signed |
Refunds
Section titled “Refunds”| Endpoint | What it does |
|---|---|
| GET/v1/refunds | List refunds |
| POST/v1/refunds | Refund a payment |
| GET/v1/refunds/{id} | Retrieve a refund |
Webhooks
Section titled “Webhooks”| Endpoint | What it does |
|---|---|
| GET/v1/webhook_endpoints | List webhook endpoints |
| POST/v1/webhook_endpoints | Create a webhook endpoint |
| GET/v1/webhook_endpoints/{id} | Retrieve a webhook endpoint |
| PATCH/v1/webhook_endpoints/{id} | Update a webhook endpoint |
| DELETE/v1/webhook_endpoints/{id} | Delete a webhook endpoint |
| POST/v1/webhook_endpoints/{id}/rotate_secret | Rotate the signing secret |
| GET/v1/webhook_endpoints/{id}/deliveries | List deliveries to an endpoint |
Events
Section titled “Events”| Endpoint | What it does |
|---|---|
| GET/v1/events | List events |
| GET/v1/events/{id} | Retrieve an event |
| GET/v1/events/{id}/deliveries | List deliveries of an event |
| POST/v1/events/{id}/redeliver | Send an event again |
Webhook events
Section titled “Webhook events”Events that cTpeWay sends to your server are listed under Webhook events.

