Checkout
Create a checkout session
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.
Authorization: APIKey TOKEN.linesCreateCheckoutSessionLineManagementDto[]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.
inline_productInlineProductCreateDtoOptionalOptional inline product definition for dynamic products.
Requires special approval, use `product_id` instead.
invaliddayweekmonth
invaliddayweekmonthyear
unknownUnknown tax code.
digital_goods_subscriptionYou provide customers access to photographs, audiovisual works, audio works, and books, delivered electronically to a customer for non-permanent access, with right of use conditioned on continued payment to the seller.
digital_goods_permanentYou provide customers access to photographs, audiovisual works, audio works, and books, delivered electronically to a customer.
saasSaaS: Pre-written software, delivered electronically. You provide customers access to a hosted software application, described as computer programs designed to permit the user to perform a group of coordinated functions, tasks, or activities. You are typically responsible for all aspects of making the software service available.
downloaded_softwarePre-written, non-custom computer software that is delivered electronically for download onto customers' devices/servers. No tangible personal property (e.g. CD-ROM, etc.) is delivered or used in conjunction with the download.
digital_goods_subscription_gamingCloud based or downloaded access to digital gaming services (used by default for game servers).
digital_goods_permanent_gamingPermanent digital goods for gaming (not recommended).
iaasInfrastructure as a Service: Providing users remote access to data center equipment and computing power.
paasPlatform as a Service: A cloud computing service bundle that includes both the infrastructure (servers, storage, and networking) and the middleware (development tools, business intelligence services, database management systems) that provides the customer a complete development and deployment environment in the cloud.
saas_securityCloud-based SaaS, designed to secure customer data. Pre-written software, delivered electronically, designed specifically to provide protection of computer systems, software, or data against unauthorized access or intrusion. This includes separately charged maintenance and updates delivered electronically, whether included in the cost of the software or charged as a separate line item.
saas_storageCloud-based SaaS, designed to backup customer data. Pre-written software, delivered electronically, designed purely as storage for a customer's data. You provide customers access to a software product solely to facilitate the storage of digital products, digital codes, computer software or master copies of software. This includes separately charged maintenance and updates delivered electronically, whether included in the cost of the software or charged as a separate line item.
payout_splitsCreateCheckoutSessionLineManagementPayoutSplitDto[]OptionalOptional payout splits for line items (requires approval)
customer_detailsCheckoutCustomerDetailsDtoOptionalThe billing details of the customer the checkout belongs to.
billing_addressAddressDtoOptionalRepresents a physical or billing address
Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/checkouts" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "411486491630370816",
"lines": [
{
"quantity": 0,
"subscription": true,
"trial": true,
"gift_to": {
"id": "76561198152492642",
"platform": "invalid"
},
"gift_to_customer_id": "411486491630370816",
"selected_gameserver_id": "411486491630370816",
"custom_variables": {},
"product_id": "411486491630370816",
"inline_product": {
"slug": "string",
"name": "string",
"description": "string",
"label": "string",
"price": 0,
"single_game_server_only": true,
"allow_one_time_purchase": true,
"allow_subscription": true,
"subscription_interval_value": 0,
"subscription_interval_scale": "invalid",
"trial": {
"enabled": true,
"period_value": 0,
"period_scale": "invalid",
"revoke_immediately_when_canceled": true,
"new_customers_only": true,
"new_customer_order_lookback_value": 0,
"new_customer_order_lookback_scale": "invalid",
"allow_repeat_trials": true,
"repeat_trial_cooldown_value": 0,
"repeat_trial_cooldown_scale": "invalid"
},
"upselling": {
"enabled": true,
"recommendations": [
{
"discount_amount": 0,
"discount_type": "unknown",
"prefer_as_subscription": true,
"recommended_product_id": "411486491630370816",
"type": "unknown",
"minimum_base_product_quantity": 0,
"minimum_recommended_product_quantity": 0,
"quantity_to_add": 0
}
]
},
"remove_after_enabled": true,
"remove_after_time_value": 0,
"remove_after_time_scale": "invalid",
"store_stock_limit": {
"enabled": true,
"include_trials": true,
"time_scale": "invalid",
"quantity": 0,
"time_value": 0
},
"customer_stock_limit": {
"enabled": true,
"include_trials": true,
"time_scale": "invalid",
"quantity": 0,
"time_value": 0
},
"stock_limit_do_not_include_removed": true,
"tags": [
"411486491630370816"
],
"gameservers": [
"411486491630370816"
],
"commands": [
{
"content": "string",
"online_only": true,
"stage": "invalid",
"override_execute_on_gameserver_ids": [
"411486491630370816"
]
}
],
"deliverable_actions": {
"grant_giftcard": true
},
"metadata": {},
"payout_splits": [
{
"platform_fee": 0,
"user_id": "411486491630370816",
"percentage": 0
}
],
"tax_code": "unknown",
"allow_concurrent_active_items": true,
"is_hidden": true,
"is_gifting_disabled": true,
"enabled_at": "2024-01-01T00:00:00Z",
"enabled_until": "2024-01-01T00:00:00Z",
"required_product_ids": [
"411486491630370816"
],
"required_product_all": true,
"custom_variable_ids": [
"411486491630370816"
],
"is_gift_cards_disabled": true,
"is_coupons_disabled": true,
"is_affiliate_links_disabled": true,
"tier_group_id": "411486491630370816"
},
"payout_splits": [
{
"payout_id": "string",
"percentage": 5000,
"platform_fee": 500
}
],
"metadata": {}
}
],
"coupon_id": "411486491630370816",
"promo_codes": [
"string"
],
"affiliate_code": "string",
"return_url": "string",
"cancel_url": "string",
"auto_redirect": true,
"metadata": {},
"customer_details": {
"billing_name": "string",
"billing_email": "string",
"billing_address": {
"country": "string",
"state": "string",
"city": "string",
"postal_code": "string",
"line_1": "string",
"line_2": "string"
},
"billing_tax_id": "string"
}
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.checkout.createCheckoutSession({
customer_id: "411486491630370816",
lines: [
{
quantity: 0,
subscription: true,
trial: true,
gift_to: {
id: "76561198152492642",
platform: "invalid",
},
gift_to_customer_id: "411486491630370816",
selected_gameserver_id: "411486491630370816",
custom_variables: {},
product_id: "411486491630370816",
inline_product: {
slug: "string",
name: "string",
description: "string",
label: "string",
price: 0,
single_game_server_only: true,
allow_one_time_purchase: true,
allow_subscription: true,
subscription_interval_value: 0,
subscription_interval_scale: "invalid",
trial: {
enabled: true,
period_value: 0,
period_scale: "invalid",
revoke_immediately_when_canceled: true,
new_customers_only: true,
new_customer_order_lookback_value: 0,
new_customer_order_lookback_scale: "invalid",
allow_repeat_trials: true,
repeat_trial_cooldown_value: 0,
repeat_trial_cooldown_scale: "invalid",
},
upselling: {
enabled: true,
recommendations: [
{
discount_amount: 0,
discount_type: "unknown",
prefer_as_subscription: true,
recommended_product_id: "411486491630370816",
type: "unknown",
minimum_base_product_quantity: 0,
minimum_recommended_product_quantity: 0,
quantity_to_add: 0,
},
],
},
remove_after_enabled: true,
remove_after_time_value: 0,
remove_after_time_scale: "invalid",
store_stock_limit: {
enabled: true,
include_trials: true,
time_scale: "invalid",
quantity: 0,
time_value: 0,
},
customer_stock_limit: {
enabled: true,
include_trials: true,
time_scale: "invalid",
quantity: 0,
time_value: 0,
},
stock_limit_do_not_include_removed: true,
tags: [
"411486491630370816",
],
gameservers: [
"411486491630370816",
],
commands: [
{
content: "string",
online_only: true,
stage: "invalid",
override_execute_on_gameserver_ids: [
"411486491630370816",
],
},
],
deliverable_actions: {
grant_giftcard: true,
},
metadata: {},
payout_splits: [
{
platform_fee: 0,
user_id: "411486491630370816",
percentage: 0,
},
],
tax_code: "unknown",
allow_concurrent_active_items: true,
is_hidden: true,
is_gifting_disabled: true,
enabled_at: "2024-01-01T00:00:00Z",
enabled_until: "2024-01-01T00:00:00Z",
required_product_ids: [
"411486491630370816",
],
required_product_all: true,
custom_variable_ids: [
"411486491630370816",
],
is_gift_cards_disabled: true,
is_coupons_disabled: true,
is_affiliate_links_disabled: true,
tier_group_id: "411486491630370816",
},
payout_splits: [
{
payout_id: "string",
percentage: 5000,
platform_fee: 500,
},
],
metadata: {},
},
],
coupon_id: "411486491630370816",
promo_codes: [
"string",
],
affiliate_code: "string",
return_url: "string",
cancel_url: "string",
auto_redirect: true,
metadata: {},
customer_details: {
billing_name: "string",
billing_email: "string",
billing_address: {
country: "string",
state: "string",
city: "string",
postal_code: "string",
line_1: "string",
line_2: "string",
},
billing_tax_id: "string",
},
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"customer_id": "411486491630370816",
"lines": [
{
"quantity": 0,
"subscription": True,
"trial": True,
"gift_to": {
"id": "76561198152492642",
"platform": "invalid",
},
"gift_to_customer_id": "411486491630370816",
"selected_gameserver_id": "411486491630370816",
"custom_variables": {},
"product_id": "411486491630370816",
"inline_product": {
"slug": "string",
"name": "string",
"description": "string",
"label": "string",
"price": 0,
"single_game_server_only": True,
"allow_one_time_purchase": True,
"allow_subscription": True,
"subscription_interval_value": 0,
"subscription_interval_scale": "invalid",
"trial": {
"enabled": True,
"period_value": 0,
"period_scale": "invalid",
"revoke_immediately_when_canceled": True,
"new_customers_only": True,
"new_customer_order_lookback_value": 0,
"new_customer_order_lookback_scale": "invalid",
"allow_repeat_trials": True,
"repeat_trial_cooldown_value": 0,
"repeat_trial_cooldown_scale": "invalid",
},
"upselling": {
"enabled": True,
"recommendations": [
{
"discount_amount": 0,
"discount_type": "unknown",
"prefer_as_subscription": True,
"recommended_product_id": "411486491630370816",
"type": "unknown",
"minimum_base_product_quantity": 0,
"minimum_recommended_product_quantity": 0,
"quantity_to_add": 0,
},
],
},
"remove_after_enabled": True,
"remove_after_time_value": 0,
"remove_after_time_scale": "invalid",
"store_stock_limit": {
"enabled": True,
"include_trials": True,
"time_scale": "invalid",
"quantity": 0,
"time_value": 0,
},
"customer_stock_limit": {
"enabled": True,
"include_trials": True,
"time_scale": "invalid",
"quantity": 0,
"time_value": 0,
},
"stock_limit_do_not_include_removed": True,
"tags": [
"411486491630370816",
],
"gameservers": [
"411486491630370816",
],
"commands": [
{
"content": "string",
"online_only": True,
"stage": "invalid",
"override_execute_on_gameserver_ids": [
"411486491630370816",
],
},
],
"deliverable_actions": {
"grant_giftcard": True,
},
"metadata": {},
"payout_splits": [
{
"platform_fee": 0,
"user_id": "411486491630370816",
"percentage": 0,
},
],
"tax_code": "unknown",
"allow_concurrent_active_items": True,
"is_hidden": True,
"is_gifting_disabled": True,
"enabled_at": "2024-01-01T00:00:00Z",
"enabled_until": "2024-01-01T00:00:00Z",
"required_product_ids": [
"411486491630370816",
],
"required_product_all": True,
"custom_variable_ids": [
"411486491630370816",
],
"is_gift_cards_disabled": True,
"is_coupons_disabled": True,
"is_affiliate_links_disabled": True,
"tier_group_id": "411486491630370816",
},
"payout_splits": [
{
"payout_id": "string",
"percentage": 5000,
"platform_fee": 500,
},
],
"metadata": {},
},
],
"coupon_id": "411486491630370816",
"promo_codes": [
"string",
],
"affiliate_code": "string",
"return_url": "string",
"cancel_url": "string",
"auto_redirect": True,
"metadata": {},
"customer_details": {
"billing_name": "string",
"billing_email": "string",
"billing_address": {
"country": "string",
"state": "string",
"city": "string",
"postal_code": "string",
"line_1": "string",
"line_2": "string",
},
"billing_tax_id": "string",
},
}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/checkouts", headers=headers, json=payload){
"id": "411486491630370816",
"token": "string",
"url": "string"
}