Buy Button Sessions
Sessions created when a customer clicks a buy button
Creates a new payment session when a customer clicks a buy button on the merchant's website. The orderRef must be unique per transaction. Returns the session with the associated conversion code for the payment portal.
Roles: SuperAdmin, SimpleUser, Service
JWT token obtained from /auth/login or /auth/login/manager. Include as Authorization: Bearer <token>.
Buy button ID
Merchant unique order reference — must be unique per transaction
Existing conversion code (if resuming a session)
Webhook URL called when payment completes
Redirect URL on payment cancellation
Redirect URL after successful payment
Session-specific price (string or number)
Session created
Whether the request succeeded
HTTP status code
Duplicate orderRef with active order, or button not found
Unauthorized
Validation error
POST /api/next/buy-button/sessions HTTP/1.1
Host: api.lyzi.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 282
{
"button": "text",
"orderRef": "text",
"conversionCode": "text",
"callbackUrl": "text",
"cancelUrl": "text",
"returnUrl": "text",
"price": null,
"currency": "text",
"buttonName": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
}
}{
"success": true,
"status": 1,
"data": {
"_id": "text",
"button": "text",
"buttonName": "text",
"orderRef": "text",
"conversionCode": "text",
"callbackUrl": "text",
"cancelUrl": "text",
"returnUrl": "text",
"price": null,
"currency": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
},
"conversion": {
"_id": "text",
"code": "text",
"shortCode": "text",
"fromAmount": "text",
"toAmount": "text",
"fromAsset": "EUR",
"toAsset": "USDC",
"status": "INITIAL",
"paymentChannel": "binance",
"webhookUrl": "text",
"alias": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}
}Returns the buy button session with its current conversion/order status.
Roles: SuperAdmin, Manager, SimpleUser, SuperManager, Service
JWT token obtained from /auth/login or /auth/login/manager. Include as Authorization: Bearer <token>.
Session ID
Session details including current conversion status
Whether the request succeeded
HTTP status code
Unauthorized
Session not found
GET /api/next/buy-button/sessions/{id} HTTP/1.1
Host: api.lyzi.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"success": true,
"status": 1,
"data": {
"_id": "text",
"button": "text",
"buttonName": "text",
"orderRef": "text",
"conversionCode": "text",
"callbackUrl": "text",
"cancelUrl": "text",
"returnUrl": "text",
"price": null,
"currency": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
},
"conversion": {
"_id": "text",
"code": "text",
"shortCode": "text",
"fromAmount": "text",
"toAmount": "text",
"fromAsset": "EUR",
"toAsset": "USDC",
"status": "INITIAL",
"paymentChannel": "binance",
"webhookUrl": "text",
"alias": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}
}Deletes a buy button session. If an active order is associated, it will also be cancelled.
Roles: SuperAdmin, SimpleUser, Service
JWT token obtained from /auth/login or /auth/login/manager. Include as Authorization: Bearer <token>.
Session ID
Session deleted
Whether the request succeeded
HTTP status code
Response payload
Unauthorized
Session not found
DELETE /api/next/buy-button/sessions/{id} HTTP/1.1
Host: api.lyzi.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"success": true,
"status": 1,
"data": null
}Retrieves the buy button session associated with a given payment order code, including the current conversion status.
Roles: SuperAdmin, Manager, SimpleUser, SuperManager, Service
JWT token obtained from /auth/login or /auth/login/manager. Include as Authorization: Bearer <token>.
Order code from /confirm_conversion/request
Session details with conversion status
Whether the request succeeded
HTTP status code
Unauthorized
Session not found
GET /api/next/buy-button/sessions/conversion/{code} HTTP/1.1
Host: api.lyzi.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"success": true,
"status": 1,
"data": {
"_id": "text",
"button": "text",
"buttonName": "text",
"orderRef": "text",
"conversionCode": "text",
"callbackUrl": "text",
"cancelUrl": "text",
"returnUrl": "text",
"price": null,
"currency": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
},
"conversion": {
"_id": "text",
"code": "text",
"shortCode": "text",
"fromAmount": "text",
"toAmount": "text",
"fromAsset": "EUR",
"toAsset": "USDC",
"status": "INITIAL",
"paymentChannel": "binance",
"webhookUrl": "text",
"alias": "text",
"goods": {
"goodsName": "text",
"goodsType": "01",
"goodsCategory": "0000",
"goodsDetail": "text",
"goodsQuantity": "text"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}
}Last updated