Checkout
Create a checkout session
Creates a checkout session using a Customer token. After creating the checkout session, redirect the customer to the `url` returned.
Authorization: Customer TOKEN.linesCreateCheckoutSessionLineDto[]RequiredThe line items to include in the checkout.
gift_toCustomerPlatformAccountDtoOptionalRepresents a customer platform association, used for gifting
invalidsteamSteam profile platform - the ID param must be a Steam ID 64.
minecraftMinecraft profile platform - the ID param must be a Minecraft nick. If your store platform is Geyser, this automatically sets the Minecraft platform based on the prefix configured in store settings.
paynow_namePayNow name profile platform - the ID param must be a PayNow username.
paynowPayNow name profile platform - the ID param must be a PayNow username.
minecraft_java_nameMinecraft Java Profile Platform - the ID param must be a Java minecraft nick.
minecraft_bedrock_nameMinecraft Bedrock Profile Platform - the ID param must be a Bedrock minecraft nick.
xbox_xuidMinecraft Xbox XUID Profile Platform - the ID param must be an xbox xuid
minecraft_uuidMinecraft profile platform - the ID param must be a Minecraft UUID.
Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/checkouts" \
-H "Authorization: Customer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"lines": [
{
"product_id": "411486491630370816",
"quantity": 0,
"subscription": true,
"trial": true,
"gift_to": {
"id": "76561198152492642",
"platform": "invalid"
},
"gift_to_customer_id": "411486491630370816",
"selected_gameserver_id": "411486491630370816",
"custom_variables": {}
}
],
"coupon_id": "411486491630370816",
"promo_codes": [
"string"
],
"affiliate_code": "string",
"return_url": "string",
"cancel_url": "string",
"auto_redirect": true
}'import { createStorefrontClient } from "@paynow-gg/typescript-sdk";
const paynow = createStorefrontClient({
storeId: "STORE_ID",
customerToken: "CUSTOMER_TOKEN",
});
const result = await paynow.checkout.createCheckoutSession({
lines: [
{
product_id: "411486491630370816",
quantity: 0,
subscription: true,
trial: true,
gift_to: {
id: "76561198152492642",
platform: "invalid",
},
gift_to_customer_id: "411486491630370816",
selected_gameserver_id: "411486491630370816",
custom_variables: {},
},
],
coupon_id: "411486491630370816",
promo_codes: [
"string",
],
affiliate_code: "string",
return_url: "string",
cancel_url: "string",
auto_redirect: true,
});import requests
headers = {"Authorization": "Customer TOKEN"}
payload = {
"lines": [
{
"product_id": "411486491630370816",
"quantity": 0,
"subscription": True,
"trial": True,
"gift_to": {
"id": "76561198152492642",
"platform": "invalid",
},
"gift_to_customer_id": "411486491630370816",
"selected_gameserver_id": "411486491630370816",
"custom_variables": {},
},
],
"coupon_id": "411486491630370816",
"promo_codes": [
"string",
],
"affiliate_code": "string",
"return_url": "string",
"cancel_url": "string",
"auto_redirect": True,
}
response = requests.post("https://api.paynow.gg/v1/checkouts", headers=headers, json=payload){
"id": "411486491630370816",
"token": "string",
"url": "string"
}