Checkout Links API overview

Learn more about the Checkout Links API

The Checkout Links API allows you to create checkout sessions and accept payments. You send a POST request to Stash with payment related information, and then Stash creates the session and returns a checkout link to you.

Each request requires an authorization header with your API key. The body contains a JSON object with payment related information.

🚧

Always call this endpoint from your backend and then pass the checkout link to the client. This ensures that your API key isn't exposed to the internet.

Checkout Link parameters

You can view all parameters in the API Reference but the table highlights the required values.

ParameterContentType
shopHandleThe name of your shop. You can find this value in the Details section of Stash Studio.string
currencyThe currency code to use for the payment.string
externalUserAn object containing information about the player that initiated the purchase.object
itemsAn array of items included in the purchase.array[object]

externalUser

The externalUser object contains information about the player making the purchase. The ID is what ties the purchase to the player, and it's used in webhook events.

ParameterContentType
idThe ID of the user making the purchase.string
validatedEmailAn optional validated email for the user. When provided, receipts are sent to this email address.string

items[]

The items[] array contains each item in the cart. You define items using the following structure.

ParameterContentType
idThe item's ID.string
pricePerItemThe price for a single item.string
quantityThe number of items.int64
imageUrlThe URL to the item's image.string
nameThe item's name.string
descriptionThe item's description.string

Response objects

API responses include a JSON object containing a URL. You use this URL on the client side to start the payment flow for the player.

{
  "url": "https://test.stash.gg/docsdemos/order/609b-d48c-4b5f4e1",
  "id": "609b-d48c-4b5f4e1"
}

Example repositories

There's a Checkout Link client example built with React, as well as a playground. The playground is still in active development.