Skip to content

Commit 206e23e

Browse files
committed
docs: payment guide, payment methods table, x402, response modes
Made-with: Cursor
1 parent 5e659d9 commit 206e23e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,37 @@ bitrefill --help
4242
bitrefill logout
4343
```
4444

45+
## Paying
46+
47+
**Flow:** `get-product-details` → pick `product_id` + `package_id``buy-products` with `--cart_items` and `--payment_method`.
48+
49+
### Payment methods
50+
51+
| Method | Chain / asset | Response fields (raw) |
52+
|--------|----------------|----------------------|
53+
| `bitcoin` | Bitcoin (SegWit) | `address`, `BIP21`, `lightningInvoice`, `satoshiPrice` |
54+
| `lightning` | Lightning | `lightningInvoice`, `satoshiPrice` |
55+
| `ethereum` | Ethereum mainnet, native ETH | `address`, `paymentUri` / `BIP21`, `altcoinPrice` (ETH) |
56+
| `eth_base` | Base, native ETH | `address`, `paymentUri` (@8453) |
57+
| `usdc_base` | Base (8453) | `address`, `paymentUri`, `contractAddress` (USDC) |
58+
| `usdc_arbitrum` | Arbitrum (42161) | `address`, `paymentUri`, `contractAddress` |
59+
| `usdc_polygon` | Polygon (137) | `address`, `paymentUri`, `contractAddress` |
60+
| `usdc_erc20` | Ethereum (1) | `address`, `paymentUri`, `contractAddress` |
61+
| `usdc_solana` | Solana | `address` (base58), `contractAddress` (USDC SPL) |
62+
| `usdt_polygon`, `usdt_erc20` | Same as USDC, USDT | Same shape |
63+
| `balance` | Bitrefill account credit | No address; invoice created and paid from balance |
64+
65+
### Response mode
66+
67+
- **`--return_payment_link false`**: response includes **address**, **amount**, **BIP21** / **paymentUri** (and for Bitcoin, also **lightningInvoice**). Use for wallet pay.
68+
- **`--return_payment_link true`** (default): response includes **payment_link** (browser checkout) and **x402_payment_url** for programmatic pay.
69+
70+
### x402
71+
72+
[x402](https://docs.x402.org/) = HTTP 402 + `payment-required` header (Base64 JSON: amount, `payTo`, accepted networks, timeout). GET `x402_payment_url` → 402 + instructions → send crypto → resubmit with payment proof. For agents/tools; humans use **payment_link**.
73+
74+
**Check status:** `get-invoice-by-id --invoice_id <id>`.
75+
4576
## Legal
4677

4778
- [Terms of Service](https://www.bitrefill.com/terms)

0 commit comments

Comments
 (0)