Malaleem API
POST /api/v1/checkout

Create checkout session

Create a hosted checkout session for an order. Returns a `url` to redirect the shopper to. For multivendor stores, include a `splits` object describing each vendor's payout and the marketplace commission. For Multisite, identify the site via `metadata.site_url` / `metadata.blog_id`.

Parameters

amount integer · required

Order total in minor units (cents).

currency string · required

ISO-4217 currency code.

reference string

Your order number (e.g. the WooCommerce order id).

return_url string

Where to send the shopper after payment.

cancel_url string

Where to send the shopper if they cancel.

webhook_url string

Override the API key's default webhook endpoint.

customer_email string

Shopper email for the receipt.

line_items object | array

{ items: [{ name, qty, amount }] } shown on the pay page. A bare array is accepted and stored as { items: [...] }.

splits object | array

Multivendor payout: { platform, commission, vendors: [{ vendor_id, name, amount, currency }] }. A bare array is stored as { items: [...] }.

metadata object

Arbitrary key/values echoed back on webhooks (order_id, site_url, blog_id).

curl https://malaleem.com/api/v1/checkout \
  -H "Authorization: Bearer {key_id}:{secret}" \
  -H "Content-Type: application/json" \
  -d '{"amount":4999,"currency":"USD","reference":"1042",
       "return_url":"https://store.example/thank-you",
       "line_items":{"items":[{"name":"T-shirt","qty":2,"amount":4999}]}}'