Skip to main content
Withdrawals and refunds are server-side money operations. Every request on this page must include the headers described in Request signing. The official SDKs generate the signature and request headers for these operations. See the TypeScript, Python, and PHP examples. The direct HTTP examples below are useful when integrating without an SDK.
Use https://api-sandbox.billions.works as the base URL while developing and testing these flows.

Create a withdrawal

The selected method must use the same currency, the merchant must be operational, the amount must satisfy configured limits, and the available balance must be sufficient. Create and manage withdrawal methods in the Billions dashboard, then send the method ID in this request.

Direct HTTP TypeScript

cURL

Generate the timestamp, UUID, and signature on your backend before making the request:

Refund a crypto invoice

Refund to the single sender address recorded on the invoice:
Or provide the destination explicitly:
withdrawToSameAddress: true is accepted only when the invoice contains exactly one incoming transaction with a sender address. The invoice must belong to the merchant, be completed, use a non-fiat payment currency, and have no active or completed refund.

Direct HTTP TypeScript

Refund a fiat invoice

The invoice must belong to the merchant, be completed, settle in fiat, and have no active or completed refund. The merchant balance must cover the refund.

Direct HTTP TypeScript

Response

All three endpoints return the operation under request. Its id equals the signed x-billions-request-id.
Refund responses additionally include invoice_id, type, to_address, and withdraw_to_same_address. Payout processor status and transaction ID may be filled asynchronously.