Create a payment
create_paymentGenerate a crypto payment and return a checkout URL so buyers can pay in their chosen coin straight to your wallet. Returns payment ID, URL, and status.
Instructions
Create a Cryptunnel payment and get a checkout url to send the buyer to. On that page the buyer picks a cryptocurrency and pays straight to the merchant's own wallet. Use it whenever someone has to be charged. Returns the payment id (keep it - get_payment needs it), the checkout url and the status "created". By default the payment is a sandbox payment: the buyer is offered testnet coins only and nothing real moves. Repeating an external_id returns the payment already created for it instead of a second one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | The amount to charge, in the fiat currency below, e.g. 10 or 49.99 | |
| is_test | No | true creates a sandbox payment (testnet coins, no fees, excluded from stats). false creates a real invoice and is only allowed when the server runs with CRYPTUNNEL_ALLOW_LIVE=1 | |
| currency | Yes | The fiat currency the amount is in: USD or EUR | |
| fail_url | No | Where the buyer is sent after a failure | |
| description | No | What the buyer is paying for, shown on the checkout page | |
| external_id | Yes | Your own order or invoice id. One payment per external_id | |
| success_url | No | Where the buyer is sent after paying | |
| callback_url | No | Webhook url called when the payment reaches a terminal status |