API reference
Payment gateway API, version 1.0.0. Generated from the OpenAPI document served at /v1/openapi.json. Authenticate with an Authorization: Bearer header carrying a project API key. List endpoints accept limit (1 to 100) and cursor, and return the next cursor in the X-Next-Cursor header.
GET /events
Pull the event feed, oldest first. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
type | query | no |
GET /methods
List enabled payment methods. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
GET /openapi.json
This document. Required scope: undefined.
GET /payments
List payments. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
status | query | no |
reference | query | no |
customer_ref | query | no |
created_from | query | no |
created_to | query | no |
POST /payments
Create a payment. Required scope: payments:write.
Request body CreatePayment:
| Field | Type |
|---|---|
amount | integer |
cancel_url | string |
currency | string |
customer_email | string |
customer_ref | string |
description | string |
discount | any |
line_items | array |
metadata | object |
methods | array |
reference | string |
success_url | string |
tax | integer |
GET /payments/{id}
Get a payment. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
POST /payments/{id}/attempts
Start a payment attempt. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body CreateAttempt:
| Field | Type |
|---|---|
method | string |
option | string |
save_method | boolean |
POST /payments/{id}/cancel
Cancel a payment. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
POST /payments/{id}/refund
Refund a payment. Required scope: refunds:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body RefundInput:
| Field | Type |
|---|---|
amount | integer |
destination | string |
GET /plans
List billing plans. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
POST /plans
Create a billing plan. Required scope: payments:write.
Request body CreatePlan:
| Field | Type |
|---|---|
amount | integer |
currency | string |
description | string |
grace_days | integer |
interval | string |
interval_count | integer |
name | string |
trial_days | integer |
GET /plans/{id}
Get a billing plan. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
POST /plans/{id}/archive
Archive a billing plan. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
GET /rates
Current BTC rates. Required scope: payments:read.
GET /refunds
List refunds. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
payment_id | query | no |
status | query | no |
GET /saved-methods
List saved payment methods. Required scope: saved:write or payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
customer_ref | query | no |
DELETE /saved-methods/{id}
Delete a saved payment method. Required scope: saved:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
POST /saved-methods/{id}/charge
Charge a saved payment method. Required scope: saved:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body CreatePayment:
| Field | Type |
|---|---|
amount | integer |
cancel_url | string |
currency | string |
customer_email | string |
customer_ref | string |
description | string |
discount | any |
line_items | array |
metadata | object |
methods | array |
reference | string |
success_url | string |
tax | integer |
GET /subscriptions
List subscriptions. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
limit | query | no |
cursor | query | no |
customer_ref | query | no |
status | query | no |
POST /subscriptions
Create a subscription. Required scope: payments:write.
Request body CreateSubscription:
| Field | Type |
|---|---|
customer_ref | string |
plan_id | integer |
saved_method_id | integer |
GET /subscriptions/{id}
Get a subscription with its billing history. Required scope: payments:read.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
POST /subscriptions/{id}/cancel
Cancel a subscription now or at period end. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body CancelSubscription:
| Field | Type |
|---|---|
at_period_end | boolean |
POST /subscriptions/{id}/change-plan
Change plan, optionally prorating. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body ChangePlan:
| Field | Type |
|---|---|
plan_id | integer |
proration | string |
POST /subscriptions/{id}/pause
Pause a subscription. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |
POST /subscriptions/{id}/resume
Resume a subscription. Required scope: payments:write.
| Parameter | In | Required |
|---|---|---|
id | path | yes |