Create checkout session
Creates a checkout session that stays open for 1 hour and returns a checkout_url to redirect the
buyer to. Line items are dynamic: send a name and an amount (in minor units, for example cents) for
each one. When the buyer pays they're sent to return_url with checkout_id added to the query string.
Requires the checkouts:write permission.
AuthorizationBearer <lp_test_sk_… / lp_live_sk_…>A bearer key's secret in the Authorization header. Keep it on your server.
storeId*stringYour store ID, shown in Dashboard → Developers → API keys.
uuidapplication/json- body
items*array<>Line items. Together they must add up to between 99 and 100000000 minor units ($0.99 at least).
1 <= items <= 10title?stringHeading on the checkout page. Defaults to your store name.
1 <= length <= 128description?stringShown under the total on the checkout page.
1 <= length <= 500currency?stringThree-letter ISO 4217 code. Defaults to your store's currency (USD).
^[a-zA-Z]{3}$amount?integerExpected total in minor units. If you send it, it must equal the items total, a safeguard against pricing bugs.
customer*metadata?Up to 20 string values (keys up to 40 characters), stored on the session.
properties <= 20return_url?stringHTTPS URL the buyer goes to after paying. checkout_id is added to its query string.
uricancel_url?stringHTTPS URL behind the checkout page's back link.
uriCheckout session created.
application/json- response
ok*booleandata*curl -X POST 'https://api.lollipay.cc/v1/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkouts' \ -H 'Content-Type: application/json' \ -d '{ "title": "Upgrade to Pro", "items": [ { "name": "Pro plan (yearly)", "amount": 4900 }, { "name": "Extra seat", "amount": 1500, "quantity": 2 } ], "amount": 7900, "currency": "usd", "customer": { "email": "buyer@example.com", "name": "Emma Wilson" }, "metadata": { "order_id": "A-1042" }, "return_url": "https://example.com/thanks", "cancel_url": "https://example.com/pricing"}'{ "ok": true, "data": { "id": "cs_55ca30f7581d9a76ac7188349f33b4811c4b43f28935ed507586d3bd92fa4982", "object": "checkout_session", "livemode": false, "status": "open", "title": "Upgrade to Pro", "description": null, "checkout_url": "https://checkout.lollipay.cc/invoice/cs_55ca30f7581d9a76ac7188349f33b4811c4b43f28935ed507586d3bd92fa4982", "merchant": { "id": "4f9c2d1e-7b3a-4c58-9e21-6d0f8a3b5c47", "name": "Example", "statement_descriptor": "ALTURA", "website": "https://example.com" }, "currency": "USD", "amount": 7900, "discount_amount": 0, "tax_amount": 0, "total_amount": 7900, "items": [ { "name": "Pro plan (yearly)", "amount": 4900, "quantity": 1, "image": null }, { "name": "Extra seat", "amount": 1500, "quantity": 2, "image": null } ], "customer": { "email": "buyer@example.com", "name": "Emma Wilson" }, "metadata": { "order_id": "A-1042" }, "return_url": "https://example.com/thanks", "cancel_url": "https://example.com/pricing", "payment_id": null, "created_at": 1792315200, "expires_at": 1792336800, "completed_at": null }}Overview
The Lollipay REST API. Try every endpoint from this site with your own test key.
Retrieve checkout session GET
Returns a checkout session created with a key of the same mode. Use it on your `return_url` page to confirm `status` is `complete` before fulfilling the order. Requires the `checkouts:read` permission (`checkouts:write` includes it).