PayNow

Checkout

Create a checkout session

POSThttps://api.paynow.gg/v1/checkouts

Creates a checkout session using a Customer token. After creating the checkout session, redirect the customer to the `url` returned.

Headers
AuthorizationCustomer tokenRequired
Authentication token for this request, sent as Authorization: Customer TOKEN.
x-paynow-customer-ipstringOptional
The IP address (IPv4 or IPv6) of the customer. Required if the request is not being made from the customer's browser.
x-paynow-customer-countrycodestringOptional
The customer's country code in ISO 3166-1 alpha-2 format. Optional, but recommended if you have this available.
Request body
linesCreateCheckoutSessionLineDto[]Required
The line items to include in the checkout.
product_idFlakeIdRequired
quantityintegerRequired
The quantity of this product to purchase
custom_variablesobjectOptional
Key-value pair mapping custom variable identifiers to their selected values. Required only when the product includes custom variables.
gift_toCustomerPlatformAccountDtoOptional
Represents a customer platform association, used for gifting
idstringRequired
The account ID on the platform
platformenumRequired
Possible enum values
  • invalid
  • steam

    Steam profile platform - the ID param must be a Steam ID 64.

  • minecraft

    Minecraft 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_name

    PayNow name profile platform - the ID param must be a PayNow username.

  • paynow

    PayNow name profile platform - the ID param must be a PayNow username.

  • minecraft_java_name

    Minecraft Java Profile Platform - the ID param must be a Java minecraft nick.

  • minecraft_bedrock_name

    Minecraft Bedrock Profile Platform - the ID param must be a Bedrock minecraft nick.

  • xbox_xuid

    Minecraft Xbox XUID Profile Platform - the ID param must be an xbox xuid

  • minecraft_uuid

    Minecraft profile platform - the ID param must be a Minecraft UUID.

gift_to_customer_idFlakeIdOptional
selected_gameserver_idFlakeIdOptional
subscriptionbooleanOptional
Determines whether this line should create a subscription
trialbooleanOptional
Indicates whether the product should be trialed
affiliate_codestringOptional
Optional affiliate code to track referrals. An invalid affiliate code will NOT cause an error.
auto_redirectbooleanOptional
Whether to automatically redirect the customer (return_url must be set)
cancel_urlstringOptional
Optional URL to redirect to if checkout is canceled
coupon_idFlakeIdOptional
promo_codesstring[]Optional
Optional array of promo codes (coupons, gift cards, affiliates) to apply. An invalid promo code will cause an error.
return_urlstringOptional
Optional URL to redirect to after successful checkout
Response
200OKCreateCheckoutSessionResponseDto
Response after creating a checkout session
Show fields
idFlakeIdRequired
tokenstringRequired
The token for the checkout session
urlstringRequired
The URL to redirect the customer to complete checkout

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
}'
Response200
{
  "id": "411486491630370816",
  "token": "string",
  "url": "string"
}