Checkout API
The Checkout API allows for creators to integrate a hosted checkout into an existing website with products created through the Coinable dashboard.
The API access key is required to use the Checkout API. Your API access key is located at the API Access page.
The
product_id
used in the products array can be obtained from the product details page on your dashboard.
post
https://api.coinablepay.com
/v1/api/checkouts
Initiate a checkout.
Make sure to update the examples with your
api_key
and product_ids.
curl -H "api-key: <api_key>" --location --request POST 'https://api.coinablepay.com/v1/api/checkouts
--data-raw '{
"cancel_url": "https://coinablepay.com/cancel_order.html",
"success_url": "https://coinablepay.com/success?order_number={ORDER_NUMBER}",
"request_currency": "USD",
"products": [
{
"id": "uGPJMwu4t9KRHuWCVUFdQD",
"quantity": 1
}
]}'
const axios = require('axios')
const url = `https://api.coinablepay.com/v1/api/checkouts`
const getCheckoutUrl = async () => {
const { data } = await axios.post(url,
{
cancel_url: "https://coinablepay.com/cancel_order.html",
success_url: "https://coinablepay.com/success?order_number={ORDER_NUMBER}",
request_currency: "USD",
products: [
{
id: "uGPJdwu4t9KRHuWCVdFVQD",
quantity: 1
},
{
id: "cGPJMwu4t9KRHuWCddFVQD",
quantity: 5
}
]
},
{
headers: {'api-key': '<api_key>'}
}
)
console.log("redirect url: ", data.redirect_url)
}
getCheckoutUrl()
Last modified 5mo ago