Checkout Session is a standard object used to start accepting the crypto payments in USDC, USDT, DAI, ETH, BTC, MATIC, etc.
Let's create our first Checkout Session to accept 1 USDC from user.
We will be using a curl to request Bitstream APIs.
Make sure you generate your API_KEY from our Dashboard. If you don't have one, then generate it from here.
You will need test ERC20 Faucets to make the payment, you can request them from https://dashboard.bitstream.dev/faucet. If you need more faucet, then feel free to contact our team via Telegram.
As you are using test environment, there is no real money involved. So feel free to play around.
# Creating a Checkout Session for 1 USDC
curl --request POST \
--url 'https://api.bitstream.dev/api/v1/checkout/sessions' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"successUrl": "https://bitstream.com/success?cid={CHECKOUT_SESSION_ID}",
"lineItems": {
"data": [
{
"priceData": {
"currency": "usdc",
"unitAmount": "100000000",
"productData": {
"name": "Basic",
"description": "For early stage projects who are getting started"
}
}
}
]
}
}'