TeePayDocs
API ReferenceCheckout sessions

Create a checkout session

POST
/v1/checkout-sessions

Creates a TeePay hosted checkout page for your account. Redirect the customer to checkout_url. A payment profile is optional: when given, or when your account has a default profile, its branding, return URL and webhook URL are used. Repeating the same Idempotency-Key and body returns the same session with the header Idempotent-Replayed: true. Requires checkout:create. 30 creations per account per minute.

Authorization

BearerAuth
headerAuthorizationBearer <token>

Secret API key: tp_test_. or tp_live_.. Server-side only.

Header Parameters

Idempotency-Key*string
Match^[A-Za-z0-9_-]+$
Length8 <= length <= 120

Request Body

application/json
  1. body
title*string
Length1 <= length <= 100
description?string
Lengthlength <= 200
amount_minor*string

Integer minor units, e.g. "500000" is TZS 5,000.00.

Match^[1-9][0-9]{0,12}$
currency*string
Match^[A-Z]{3}$
expires_in?integer
Range3600 <= value <= 604800
Default86400
payment_profile_id?string
Formatuuid
reference?string

Your order ID, echoed back.

Match^[A-Za-z0-9_.:-]{1,64}$
metadata?
Propertiesproperties <= 10

Response Body

Checkout session

application/json
  1. response
id*string
Formatuuid
object*unknown
status*unknown

paid only after TeePay verified and ledger-posted the payment; never from a browser redirect.

Value in"open""processing""paid""expired""unavailable"
title*string
description*string
currency*string
Match^[A-Z]{3}$
amount_minor*string
Match^[1-9][0-9]{0,12}$
checkout_url*|

TeePay hosted checkout to send or redirect the customer to.

Formaturi
payment_profile_id*string|null
reference*string|null
metadata*
payment*|null
environment*unknown
Value in"live""sandbox"
created_at*string
expires_at*string|null
Example Request
curl -X POST 'https://api.teepay.me/v1/checkout-sessions' \  -H 'Idempotency-Key: order-1001' \  -H 'Content-Type: application/json' \  -d '{  "title": "Order 1001",  "description": "2 x Coffee bag",  "amount_minor": "500000",  "currency": "TZS",  "expires_in": 86400,  "reference": "order-1001",  "metadata": {    "cart": "c-77"  }}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "object": "checkout_session",  "status": "open",  "title": "string",  "description": "string",  "currency": "string",  "amount_minor": "string",  "checkout_url": "http://example.com",  "payment_profile_id": "string",  "reference": "string",  "metadata": {    "property1": "string",    "property2": "string"  },  "payment": {    "reference": "string"  },  "environment": "live",  "created_at": "string",  "expires_at": "string"}