Developer documentation
Build payments with clarity.
A practical reference for creating, looking up, and listing ZSI Pay payment sessions.
POST
/paymentsPayments
Create a payment
Create a hosted payment session for an order, then redirect your customer to the returned payment URL.
Authentication
Include both merchant credentials with every request.
x-zsi-api-keyYour merchant API key.
x-zsi-api-secretYour merchant API secret.
Request body
Send a JSON object with the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
| merchant_transaction_id | string | Required | A unique order or transaction identifier from your system. |
| customer_email | string | Required | The email address of the customer completing payment. |
| success_url | string | Required | The URL to redirect to after a successful payment. |
| cancel_url | string | Required | The URL to redirect to when a payment is cancelled. |
| items | array | Required | Order items with id, name, quantity, and price. |
| metadata | object | Optional | Merchant-defined information associated with the payment. |
Example
Use environment variables to keep credentials out of source code.
cURL
curl --request POST https://api-pay.zsi.ai/v1/payments \
--header "x-zsi-api-key: $ZSI_API_KEY" \
--header "x-zsi-api-secret: $ZSI_API_SECRET" \
--header "Content-Type: application/json" \
--data '{
"merchant_transaction_id": "ORDER-123456",
"customer_email": "customer@example.com",
"success_url": "https://merchant.example/payment/success",
"cancel_url": "https://merchant.example/payment/cancel",
"items": [{ "id": "1", "name": "Product 1", "quantity": 3, "price": 2 }],
"metadata": { "order_id": "123456", "customer_name": "John Doe" }
}'Response codes
200
Success
A hosted payment session was created.
400
Validation error
One or more fields are missing or invalid.
409
Conflict
The merchant transaction ID already exists.
API base URL
https://api-pay.zsi.ai/v1All endpoints in this reference are relative to this base URL.
