curl https://pay.talescria.com/v1/sessions \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount": {"minorUnits": "12999", "currency": "USD"}, "country": "US", "methods": ["card"]}'
{
"session": {
"id": "chk_3f6e2c1a-…",
"state": "open",
"amount": { "minorUnits": "12999", "currency": "USD" },
"country": "US",
"merchantName": "Acme Studio Ltd",
"environment": "test",
"availableMethods": ["card"],
"paymentId": null,
"nextAction": null,
"underReview": false,
"attempts": [],
"createdAt": 1763128800000,
"expiresAt": 1763130600000,
"updatedAt": 1763128800000
}
}
Checkout
Create a checkout session
Start a hosted payment page for an amount your server sets.
POST
/
v1
/
sessions
curl https://pay.talescria.com/v1/sessions \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount": {"minorUnits": "12999", "currency": "USD"}, "country": "US", "methods": ["card"]}'
{
"session": {
"id": "chk_3f6e2c1a-…",
"state": "open",
"amount": { "minorUnits": "12999", "currency": "USD" },
"country": "US",
"merchantName": "Acme Studio Ltd",
"environment": "test",
"availableMethods": ["card"],
"paymentId": null,
"nextAction": null,
"underReview": false,
"attempts": [],
"createdAt": 1763128800000,
"expiresAt": 1763130600000,
"updatedAt": 1763128800000
}
}
Creates a session and returns it. Send the payer to
https://pay.talescria.com/pay/s/{id}. See Hosted checkout.
Requires the checkout:write scope. The payment lands in your default account for the currency.
Payment methods to offer. Use
["card"]. Leave it out for every method available to your account.Response
The session. See Retrieve a checkout session for its fields.
Errors
| Status | Code | Meaning |
|---|---|---|
400 | VALIDATION | A field is missing or malformed, or there’s no account in this currency. |
401 | UNAUTHORIZED | The access token isn’t valid. |
422 | METHOD_NOT_AVAILABLE | A method you asked for isn’t available. |
502 | IDENTITY_UNAVAILABLE | Temporarily unavailable. Retry. |
curl https://pay.talescria.com/v1/sessions \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount": {"minorUnits": "12999", "currency": "USD"}, "country": "US", "methods": ["card"]}'
{
"session": {
"id": "chk_3f6e2c1a-…",
"state": "open",
"amount": { "minorUnits": "12999", "currency": "USD" },
"country": "US",
"merchantName": "Acme Studio Ltd",
"environment": "test",
"availableMethods": ["card"],
"paymentId": null,
"nextAction": null,
"underReview": false,
"attempts": [],
"createdAt": 1763128800000,
"expiresAt": 1763130600000,
"updatedAt": 1763128800000
}
}