Create customer portal session
Create customer portal session
Overview
Create customer portal session
Returns a short-lived URL so the customer can manage subscriptions and payment methods in the hosted portal.
When to use this
Use from your app when a logged-in buyer opens “Manage billing” without building portal UI yourself.
See also
Portal audit log · List subscriptions
Authentication
Merchant routes require an API key in the X-API-KEY header (see Integration overview). Use a test key against https://sandbox.api.lomi.africa and a live key against https://api.lomi.africa.
Endpoint
POST /customers/{id}/portal-launch-session
Base URLs:
https://sandbox.api.lomi.africahttps://api.lomi.africa
Request
Path parameters
| Name | Required | Schema | Description |
|---|---|---|---|
id | Yes | - | UUID du client |
Query parameters
No query parameters.
Request body
JSON request payload.
Schema: object
| Field | Required | Type | Description |
|---|---|---|---|
return_url | No | string | - |
flow_type | No | enum ("portal_home", "subscription_cancel", "subscription_manage") | - |
flow_subscription_id | No | string | - |
flow_after_completion_url | No | string | - |
Example body:
{
"return_url": "string",
"flow_type": "portal_home",
"flow_subscription_id": "string"
}Responses
| Status | Description |
|---|---|
201 | Created successfully |
401 | Invalid or missing API key |
404 | Resource not found |
Errors
Errors follow the standard JSON error format (status code and machine-readable message). Validate inputs before calling; 401 indicates a missing/invalid key, 404 a missing resource for this organization, 429 rate limiting. For safe retries on create-style calls, send an idempotency key when your flow supports it.
Example
curl -sS -X POST "https://sandbox.api.lomi.africa/customers/value/portal-launch-session" \
-H "X-API-KEY: $LOMI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"return_url":"string","flow_type":"portal_home","flow_subscription_id":"string"}'OpenAPI
- operationId:
CustomersController_createPortalLaunchSession - Operation:
POST /customers/{id}/portal-launch-session
Full schemas and Try it: API reference. Machine-readable contract: repo apps/docs/openapi.json.