For the complete documentation index, see llms.txt. This page is also available as Markdown.

Checkout

Operations related to checkout

Get necessary identifiers for basket

get

Get all the necessary user identifiers to purchase the requested basket. Some products require specific user identifiers in order to be purchased. For example, a product that grants a Discord role will require a discord_id, and a product that provides perks in Ark: Survival Ascended will require an eos_id. This route returns all the necessary information before proceeding with a purchase.

No API key is required.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
storeintegerRequired

Store ID. This ID is required in order to identify to which store you want to checkout. If you have an API key, you can request the /whoami route in order to figure out your store ID.

Example: 762
productsinteger[]Required

An array of product id to be purchased.

Example: [12,123]
Responses
200

Array of required user identifiers.

application/json
string[]OptionalExample: ["discord_id","eos_id"]
get/store/checkout/identifiers
GET /v1/store/checkout/identifiers?store=762&products=12 HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  "discord_id",
  "eos_id"
]

Generate a checkout link

post

Generate an checkout link, provide a basket of what you want to checkout, and the endpoint will return you an URL to which to redirect.

No API key is required.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
storeintegerRequired

Store ID. This ID is required in order to identify to which store you want to checkout. If you have an API key, you can request the /whoami route in order to figure out your store ID.

Example: 762
currencystringOptional

Display currency code (optional). Supported currencies: GBP, USD, EUR, CAD, AUD, CHF. If omitted, prices are displayed in store currency. Converts all product prices (price, old_price, min_donation) and custom field prices.

Example: USD
redirectbooleanOptional

If enabled, the endpoint will send a 302 Redirection instead of an JSON.

Default: falseExample: false
Body
currencystringOptional

Display currency code (optional). Supported currencies: GBP, USD, EUR, CAD, AUD, CHF. If omitted, prices are displayed in store currency. Converts all product prices (price, old_price, min_donation) and custom field prices.

Example: USD
redirect_success_checkoutstringOptional

This optional parameter allows you to redirect your users to a specific URL after the payment was processed successfully.

Example: https://mywebsite.com/page/success
redirect_canceled_checkoutstringOptional

This optional parameter allows you to redirect your users to a specific URL if the user want to return back.

Example: https://mywebsite.com/page/cancel
redirect_pending_checkoutstringOptional

This optional parameter allows you to redirect your users to a specific URL after the payment was processed successfully but is still being verified.

Example: https://mywebsite.com/page/pending
Responses
200

Checkout link generated successfully.

application/json
urlstringOptionalExample: https://fivem.tip4serv.com/checkout?key=eyJwcm9kdWN0cyI6IFt7InByb2R1Y3RfaWQiOjEyLCJ0eXBlIjoiYWRkdG9jYXJ0In1dfQ%3D%3D
post/store/checkout
POST /v1/store/checkout?store=762 HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 712

{
  "products": [
    {
      "product_id": 12,
      "product_slug": "product-1",
      "type": "addtocart",
      "quantity": 1,
      "donation_amount": 10.5,
      "server_selection": 12,
      "custom_fields": {
        "2": 1,
        "3": 3,
        "4": "wooden_sword"
      }
    }
  ],
  "currency": "USD",
  "user": {
    "email": "duster@example.com",
    "minecraft_username": "Notch",
    "steam_id": "76561198000000000",
    "discord_id": 274785054121525250,
    "epic_id": "1234567890123456789",
    "player_id": "C84A567",
    "eos_id": "0123456789abcdef0123456789abcdef",
    "fivem_citizen_id": "abc123",
    "ingame_username": "PlayerOne",
    "rust_username": "RustPlayer"
  },
  "redirect_success_checkout": "https://mywebsite.com/page/success",
  "redirect_canceled_checkout": "https://mywebsite.com/page/cancel",
  "redirect_pending_checkout": "https://mywebsite.com/page/pending"
}
{
  "url": "https://fivem.tip4serv.com/checkout?key=eyJwcm9kdWN0cyI6IFt7InByb2R1Y3RfaWQiOjEyLCJ0eXBlIjoiYWRkdG9jYXJ0In1dfQ%3D%3D"
}

Last updated