Create "Buy Now" Button
Let us consider a case in which you run an online shop and want to accept cryptocurrency for your goods or services. To make the process quick and seamless for your customers, you can add a "Buy Now" button next to each item.
Using the CoinPayments API, you can enable your customers to complete their purchase with just a few clicks.
Here's how the process works:
Generate "Buy Now" Button
Generate "Buy Now" button by sending a request to POST /merchant/invoices/buy-now-button or alternatively, via the dashboard.
- Specify the product/service details, webhook notifications, button styling, and more by referencing the route documentation.
- Set the
type
topermanent
.
Display Generated HTML
Display the generated HTML from the API within your website, rendering the "Pay Using CoinPayments" button.
Customer Clicks "Pay Using CoinPayments"
Customer wants to purchase merchant product/service immediately, so they click the adjacent "Pay Using CoinPayments" button, initiating the payment flow.
Check Invoice Status
Check invoice status via configured webhooks, GET /merchant/invoices?q=invoice.id, or GET /invoice/:id/payment-currenciues/:currencyId/status