Create a new invoice
POST/api/v1/stores/:storeId/invoices
Creates a Bitcoin payment invoice and returns the checkout link, Lightning invoice (BOLT11), and on-chain Bitcoin address.
Typical flow
- Your backend calls this endpoint when a customer checks out.
- Redirect the customer to
checkoutLink(or embed the QR codes fromqrCodes). - Coinsnap monitors the payment and sends a webhook event when the invoice is
Settled.
Payment methods
Lightning— instant, zero confirmation, recommended for most use cases.BTC— on-chain Bitcoin, requires 1 confirmation (~10 min).- Both enabled by default if
enabledPaymentMethodsis omitted.
Tip: Store your order reference in
orderIdso you can reconcile invoices with your own orders later.
Request
Responses
- 200
- 400
- 401
- 403
- 500
Successfully created the invoice
Bad request. Invalid input or unable to create the invoice.
Unauthorized.
Forbidden. Merchant account cannot accept payments, or terminalId is not authorized for this store.
Unexpected error.