Checkout
Creates a checkout session from a secure server using an API Key. If you have a Customer token, see the Storefront API Create Checkout endpoint.
An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.
Request to create a new checkout session from your back-end server using the management API.
customer_id needs to be specified explicitly here instead of using a Customer token.
411486491630370816Optional array of promo codes (coupons, gift cards, affiliates) to apply. An invalid promo code will cause an error.
Optional affiliate code to track referrals. An invalid affiliate code will NOT cause an error.
Optional URL to redirect to after successful checkout
Optional URL to redirect to if checkout is canceled
Whether to automatically redirect the customer (return_url must be set)
411486491630370816Optional metadata to associate with the checkout session. Do not store any sensitive information here.
OK
Response after creating a checkout session
411486491630370816The token for the checkout session
The URL to redirect the customer to complete checkout
Error response
POST /v1/stores/{storeId}/checkouts HTTP/1.1
Authorization: APIKey TOKEN_HERE
Content-Type: application/json
Accept: */*
Content-Length: 2708
{
"lines": [
{
"subscription": null,
"trial": null,
"gift_to": {
"platform": "invalid",
"id": "76561198152492642"
},
"gift_to_customer_id": "411486491630370816",
"quantity": 1,
"selected_gameserver_id": "411486491630370816",
"custom_variables": null,
"product_id": "411486491630370816",
"inline_product": {
"slug": null,
"name": null,
"description": null,
"label": null,
"price": null,
"single_game_server_only": null,
"allow_one_time_purchase": null,
"allow_subscription": null,
"subscription_interval_value": null,
"subscription_interval_scale": "invalid",
"trial": {
"enabled": null,
"period_value": null,
"period_scale": "invalid",
"revoke_immediately_when_canceled": null,
"new_customers_only": null,
"new_customer_order_lookback_value": null,
"new_customer_order_lookback_scale": "invalid",
"allow_repeat_trials": null,
"repeat_trial_cooldown_value": null,
"repeat_trial_cooldown_scale": "invalid"
},
"upselling": {
"enabled": null,
"recommendations": [
{
"recommended_product_id": "411486491630370816",
"type": "unknown",
"discount_type": "unknown",
"discount_amount": 1,
"minimum_base_product_quantity": null,
"minimum_recommended_product_quantity": null,
"quantity_to_add": null,
"prefer_as_subscription": true
}
]
},
"remove_after_enabled": null,
"remove_after_time_value": null,
"remove_after_time_scale": "invalid",
"store_stock_limit": {
"enabled": true,
"quantity": null,
"time_value": null,
"time_scale": "invalid",
"include_trials": true
},
"customer_stock_limit": {
"enabled": true,
"quantity": null,
"time_value": null,
"time_scale": "invalid",
"include_trials": true
},
"stock_limit_do_not_include_removed": null,
"tags": [
"411486491630370816"
],
"gameservers": [
"411486491630370816"
],
"commands": [
{
"stage": "invalid",
"content": "text",
"online_only": true,
"override_execute_on_gameserver_ids": [
"411486491630370816"
]
}
],
"deliverable_actions": {
"grant_giftcard": true
},
"metadata": null,
"payout_splits": [
{
"user_id": "411486491630370816",
"percentage": null,
"platform_fee": 1
}
],
"tax_code": "unknown",
"allow_concurrent_active_items": null,
"is_hidden": null,
"is_gifting_disabled": null,
"enabled_at": null,
"enabled_until": null,
"required_product_ids": [
"411486491630370816"
],
"required_product_all": null,
"custom_variable_ids": [
"411486491630370816"
],
"is_gift_cards_disabled": null,
"is_coupons_disabled": null,
"is_affiliate_links_disabled": null,
"tier_group_id": "411486491630370816"
},
"payout_splits": [
{
"payout_id": "text",
"percentage": 5000,
"platform_fee": 500
}
],
"metadata": null
}
],
"coupon_id": "411486491630370816",
"promo_codes": [
"text"
],
"affiliate_code": null,
"return_url": null,
"cancel_url": null,
"auto_redirect": null,
"customer_id": "411486491630370816",
"metadata": null,
"customer_details": {
"billing_name": null,
"billing_email": null,
"billing_address": {
"country": null,
"state": null,
"city": null,
"postal_code": null,
"line_1": null,
"line_2": null
},
"billing_tax_id": null
}
}{
"id": "411486491630370816",
"token": "text",
"url": "text"
}Last updated
Was this helpful?
