Skip to main content
POST
/
checkout
/
v1
/
session
Create Checkout Session
curl --request POST \
  --url https://api-sandbox.appcharge.com/checkout/v1/session \
  --header 'Content-Type: application/json' \
  --header 'x-publisher-token: <x-publisher-token>' \
  --data '
{
  "priceDetails": {
    "price": 1000,
    "currency": "USD"
  },
  "offer": {
    "name": "Treasure Chest",
    "sku": "68452829c5e8",
    "assetUrl": "https://media-dev.appcharge.com/image.png",
    "description": "<string>",
    "displayName": "<string>",
    "pricePointMetadata": 123
  },
  "customer": {
    "id": "7c99fba665c4a",
    "email": "[email protected]"
  },
  "items": [
    {
      "name": "coins",
      "sku": "coins_386f9b",
      "quantity": 3300000,
      "assetUrl": "https://media-dev.appcharge.com/coin.png",
      "quantityDisplay": "3.3M",
      "displayName": "<string>"
    }
  ],
  "countryCode2": "US",
  "receiptMetadata": {
    "locale": "fr-CA"
  },
  "sessionMetadata": {},
  "attributes": {},
  "redirectUrl": "<string>"
}
'
{
  "checkoutSessionToken": "<string>",
  "purchaseId": "<string>",
  "url": "<string>"
}

Headers

x-publisher-token
string
required

Your checkout token that will be presented at Appcharge's dashboard under Admin section -> Integration tab -> Publisher token

Body

application/json
priceDetails
object
required
offer
object
required
customer
object
required
items
object[]

List of items in the offer.

countryCode2
string

Two-letter country code of the player in ISO-3166 alpha-2 format. If not provided, Appcharge determines the customer's country from the player's IP address.

Note: Setting a country manually will affect the applicable tax jurisdiction and rates. It's your responsibility to ensure that any country values provided via the API align with your regulatory and business requirements.

Example:

"US"

receiptMetadata
object

Metadata for the receipt.

Note: If you want the receipt to be sent in a specific language, first configure your translations in the Publisher Dashboard or via the Translations API service, and then include the desired locale here.

sessionMetadata
object

This entity serves as a versatile container for storing any pertinent information related to the player's session. You can add any additional data you wish to pass as a payload.

attributes
object

A set of custom key-value pairs that you can define to tag players for segmentation and A/B testing. These attributes can then be used to filter players in the Publisher Dashboard.

Example: { "BF_test": "test", "monetization_persona": "non_payer" }

redirectUrl
string<uri>

A deeplink URL for redirecting the player to your domain, bringing them back to the game. For more information, see Link Out Without SDK.

Note: This property is not relevant if you're using the Payment Links SDK.

Response

Checkout session created successfully.

checkoutSessionToken
string

Checkout session token.

purchaseId
string

Purchase ID.

url
string

Checkout session URL hosted on Appcharge.