/create
This endpoint creates a new invoice for payment. You provide the payment amount and the currency in fiat (e.g., USD, EUR, RUB), and the API returns a pay_url that you should send to your customer to complete the payment.
The endpoint also allows optional UI customization via the ui object and supports specifying a webhook URL to receive payment status updates. All required fields are validated, and the API ensures that the invoice is ready for immediate use once created.
To check whether the invoice has been paid, you can either:
- Send a request to the
/infoendpoint to retrieve the current status of the invoice, or - Specify a webhook URL when creating the invoice and wait for the API to send a payment status update automatically.
HTTP Request
Section titled “HTTP Request”- Method:
POST - URL:
https://api.cru.cash/v1/invoice/create - Headers:
Authorization: Bearer YOUR_API_KEY_HERE
Request Fields
Section titled “Request Fields”| Field | JSON Name | Type | Required | Description / Validation |
|---|---|---|---|---|
| Lifetime * | lifetime | int | true | Lifetime in minutes. Minimum 3, maximum 1440. |
| Amount * | amount | string | true | Payment amount in fiat currency. Minimum: 100 RUB, 1 USD, 1 EUR. Maximum: 10,000,000. |
| Currency * | currency | string | true | Currency in which the amount is specified. Allowed values: RUB, USD, EUR. |
| Payload | payload | string | false | Merchant-provided data attached to the invoice. Optional. Stored and forwarded as-is. Not visible to the client. Length: 5-16384 characters. |
| Webhook | webhook | string | false | Webhook URL for notifications. Optional. Must use HTTPS. Length: 10–2048 characters. |
| Ui.Description | ui.description | string | false | Payment description. Optional. Minimum 3, maximum 256 characters. Allowed characters: Latin letters, Cyrillic letters, digits, space, #. |
| Ui.RedirectUrl | ui.redirect_url | string | false | Redirect URL after payment. Optional. Must use HTTP or HTTPS. Length: 10–2048 characters. |
Response Fields
Section titled “Response Fields”| Field | JSON Name | Type | Description |
|---|---|---|---|
| Invoice ID | invoice.id | string | Unique ID of the created invoice. |
| Expiration Time | invoice.expires_at | int | Unix timestamp when the invoice expires. |
| Payment URL | pay_url | string | URL to send to the customer to complete the payment. |
| Testing Mode | test_mode | boolean | Indicates whether the invoice was created in test mode. |
Request & Responses Body Examples
Section titled “Request & Responses Body Examples”| Header | Value | Description |
|---|---|---|
| Authorization | Bearer YOUR_API_KEY_HERE | Your API key for authentication |
Creates a new invoice with a lifetime of 30 minutes and a payment amount of 100 USD. After the payment is completed, a webhook notification will be sent to https://test-webhook.com
Request #1
Section titled “Request #1”{"lifetime": 30,"amount": "100","webhook": "https://test-webhook.com","currency": "USD","payload": "{\"product\":\"vpn_pro\",\"period\":30,\"user_id\":\"u_987654\",\"note\":\"Invoice for monthly VPN subscription\"}""ui": { "description": "Payment for order #9876", "redirect_url": "https://t.me/crucashbot" }}Response #1
Section titled “Response #1”{"invoice": { "id": "f2b19206-2003-4b16-b254-4418a07bac47", "expires_at": 1768572610},"pay_url": "http://pay.cru.cash/invoice/f2b19206-2003-4b16-b254-4418a07bac47","test_mode": false}Creates a new invoice with a lifetime of 5 minutes and a payment amount of 2300 RUB.
Request #2
Section titled “Request #2”{"lifetime": 5,"amount": "2300","currency": "RUB"}Response #2
Section titled “Response #2”{"invoice": { "id": "0afd1195-52c5-48e5-a401-a52c5953d3c8", "expires_at": 1768572913},"pay_url": "http://pay.cru.cash/invoice/0afd1195-52c5-48e5-a401-a52c5953d3c8","test_mode": false}