Checkout Sessions
New checkout session
Payments
- Transactions
- Buyers
- Checkout Sessions
- Payment links
- Payment options
- Refunds
Instruments
- Card schemes
- Payment methods
- Payment method definitions
Vault
- Account updater
- Network tokens
- Payment service tokens
- Vault Forwarding
Dashboard
- Reports
- Report executions
Checkout Sessions
New checkout session
Creates a new Checkout Session.
POST
/
checkout
/
sessions
curl --request POST \
--url https://api.mattildapayments.com/checkout/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cart_items": [
{
"name": "GoPro HERO9 Camcorder",
"quantity": 1,
"unit_amount": 37999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "item-789123",
"sku": "sku-789123",
"product_url": "https://example.com/items/gopro",
"image_url": "https://example.com/images/items/gopro.png",
"categories": [
"<string>"
],
"product_type": "physical"
}
],
"metadata": {
"key": "value"
}
}'
{
"type": "checkout-session",
"id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
"expires_at": "2022-01-01T00:00:00+00:00",
"cart_items": [
{
"name": "GoPro HERO9 Camcorder",
"quantity": 1,
"unit_amount": 37999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "item-789123",
"sku": "sku-789123",
"product_url": "https://example.com/items/gopro",
"image_url": "https://example.com/images/items/gopro.png",
"categories": [
"<string>"
],
"product_type": "physical"
}
],
"metadata": {
"key": "value"
},
"payment_method": {
"type": "payment_method",
"id": "<string>",
"method": "card",
"scheme": "visa",
"label": "4242",
"details": {
"bin": "411111",
"card_type": "credit",
"card_country": "MX"
}
}
}
This endpoint requires the checkout-sessions.write
scope.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
A request to create a checkout session.
Response
201
application/json
Returns the new Checkout Session.
A short-lived checkout session.
Was this page helpful?
curl --request POST \
--url https://api.mattildapayments.com/checkout/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cart_items": [
{
"name": "GoPro HERO9 Camcorder",
"quantity": 1,
"unit_amount": 37999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "item-789123",
"sku": "sku-789123",
"product_url": "https://example.com/items/gopro",
"image_url": "https://example.com/images/items/gopro.png",
"categories": [
"<string>"
],
"product_type": "physical"
}
],
"metadata": {
"key": "value"
}
}'
{
"type": "checkout-session",
"id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
"expires_at": "2022-01-01T00:00:00+00:00",
"cart_items": [
{
"name": "GoPro HERO9 Camcorder",
"quantity": 1,
"unit_amount": 37999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "item-789123",
"sku": "sku-789123",
"product_url": "https://example.com/items/gopro",
"image_url": "https://example.com/images/items/gopro.png",
"categories": [
"<string>"
],
"product_type": "physical"
}
],
"metadata": {
"key": "value"
},
"payment_method": {
"type": "payment_method",
"id": "<string>",
"method": "card",
"scheme": "visa",
"label": "4242",
"details": {
"bin": "411111",
"card_type": "credit",
"card_country": "MX"
}
}
}