Payments
Create a payment request
Generate a new payment request for a product, subscription, or invoice.
The Create a Payment Request endpoint generates a payment request that can be sent to a customer. This is commonly used for invoicing, pre-authorizations, or collecting payments without immediately charging a card.
Endpoint
Headers
Key | Value | Required |
---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer <access_token> | Yes |
Request Body
Field | Type | Required | Description |
---|---|---|---|
account_id | string | Yes | ID of the account requesting the payment. |
amount | int | Yes | Payment amount in minor units (e.g., 7500 = $75.00). |
currency | string | Yes | ISO 4217 currency code (e.g., USD, EUR). |
customer_email | string | Yes | Email address of the customer to send the payment request. |
reference | string | No | Optional external reference for tracking (e.g., invoice number). |
metadata | object | No | Optional custom metadata for internal tracking. |
Response
Successful Response (201 Created)
Field | Type | Description |
---|---|---|
id | string | Unique payment request ID. |
account_id | string | ID of the account creating the request. |
amount | int | Amount in minor units. |
currency | string | Currency code. |
status | string | Current status (pending, succeeded, failed). |
customer_email | string | Email of the customer receiving the request. |
reference | string | Optional external reference. |
metadata | object | Custom metadata attached to the payment. |
created_at | string | ISO 8601 timestamp of creation. |
payment_url | string | Unique URL where the customer can complete the payment. |
Error Response (400 / 402 / 404)
Error Code | Meaning |
---|---|
invalid_request | Required fields missing or invalid. |
unauthorized | Missing or invalid access token. |
account_not_found | The provided account ID does not exist. |
Example Usage
cURL
JavaScript (Fetch)
Payment requests remain in a pending status until the customer completes the payment. You can monitor status using the Check Payment Status endpoint.