New checkout session
/checkout/sessions
curl --request POST \
--url https://api.sandbox.{gr4vy_id}.gr4vy.app/checkout/sessions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json'
{
"cart_items": [
{
"categories": [
"string"
],
"discount_amount": "0",
"external_identifier": "item-789123",
"image_url": "https://example.com/images/items/gopro.png",
"name": "GoPro HERO9 Camcorder",
"product_type": "physical",
"product_url": "https://example.com/items/gopro",
"quantity": "1",
"sku": "sku-789123",
"tax_amount": "0",
"unit_amount": "37999"
}
],
"expires_at": "2022-01-01T00:00:00+00:00",
"id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
"metadata": {
"key": "value"
},
"type": "checkout-session"
}
This endpoint requires the checkout-sessions.write
scope.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
An array of cart items that represents the line items of a transaction.
Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.
Response
An array of cart items that represents the line items of a transaction.
The date and time when the Checkout Session will expire. By default this will be set to 1 hour from the date of creation.
The ID of the Checkout Session.
Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.
checkout-session
.
checkout-session
curl --request POST \
--url https://api.sandbox.{gr4vy_id}.gr4vy.app/checkout/sessions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json'
{
"cart_items": [
{
"categories": [
"string"
],
"discount_amount": "0",
"external_identifier": "item-789123",
"image_url": "https://example.com/images/items/gopro.png",
"name": "GoPro HERO9 Camcorder",
"product_type": "physical",
"product_url": "https://example.com/items/gopro",
"quantity": "1",
"sku": "sku-789123",
"tax_amount": "0",
"unit_amount": "37999"
}
],
"expires_at": "2022-01-01T00:00:00+00:00",
"id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
"metadata": {
"key": "value"
},
"type": "checkout-session"
}