# Open payment sessions as a distributor

This guide opens a session for one of a fund's schemes and hands it to the investor. Read [Distributor](/capital-markets/distributor) first for what the relationship fixes.

## Before you start

- Distributor access is enabled for your business.
- You have an active relationship with the fund.
- The fund has given you the scheme codes you may sell.
- You have your API key. See [Get started](/get-started).


## 1. Create the session on your server

Send the scheme code in `data.scheme.scheme_code`. Matching ignores case and surrounding spaces.

```curl
curl -X POST 'https://api.glomopay.com/api/v1/payment-sessions' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "john.doe@example.com",
    "data": {
      "scheme": {
        "scheme_code": "SCH001",
        "amount": 500000,
        "currency": "USD"
      },
      "kyc": {
        "pan": "ABCPE1234F"
      }
    }
  }'
```

| Field  | Required  | Notes  |
|  --- | --- | --- |
| `data.scheme.scheme_code` | Yes | A scheme the fund has enabled for you. |
| `email` | No | Prefills the investor's email. Required if you send `pan`, `phone` or `dob`. |
| `data.scheme.amount`, `data.scheme.currency` | No | Prefills the amount, in cents of `USD`. Send both or neither. Send whole dollars (a multiple of `100`). |
| `data.kyc` | No | Prefills `pan`, `phone`, `country` and `dob` for KYC. |


Do not send `customer_id`; it returns 422. `distributor_arn` is ignored.

The response:

```json
{
  "id": "psess_6819d8046mpKt",
  "status": "active",
  "session_type": "kyc_lrs_folio",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_at": "2026-05-07T10:30:00Z"
}
```

`session_type` is the fund's, not yours. Keep `token` on your server until you hand it to the investor's checkout. Do not log it or send it anywhere else.

## 2. Launch the session for the investor

Pass `id` and `token` to the Unified SDK as `paymentSessionId` and `paymentSessionToken`. See [Unified SDK → Payment Session](/platform/sdk/unified-sdk). To open it inside a mobile app, see [Web Checkout in a Mobile App](/platform/sdk/web-checkout-in-mobile-app).

The investor then completes the fund's journey. Your ARN is shown on the checkout and cannot be changed.

## Errors

| Status  | Message  | What to do  |
|  --- | --- | --- |
| 400 | `scheme_code is required` | Send `data.scheme.scheme_code`. |
| 403 | `Payment session is not enabled for this business` | The fund does not have payment sessions enabled. Contact Glomo support. |
| 403 | `No active relationship with this fund` | Your relationship with the fund is disabled. Contact the fund. |
| 403 | `Scheme not enabled for this relationship` | The fund has not enabled this scheme for you. Contact the fund. |
| 404 | `Scheme not found` | The code matches no active scheme, or no fund you have a relationship with. Check the code. |
| 409 | `PAN is already registered with a different email` | The PAN is registered under another email. Use that email. |
| 422 | `Scheme is not available for distribution` | The scheme is a direct plan. Use the fund's regular-plan scheme. |
| 422 | `Fund is not configured for scheme sessions` | The fund's journey has no scheme step. Contact Glomo support. |
| 422 | `Distributor ARN is not configured for this fund` | Your ARN is missing on the relationship. Contact Glomo support. |
| 422 | `customer_id is not supported for relationship-originated sessions` | Remove `customer_id`. Send `email` instead. |


For the full request schema, see [Create a payment session](/api-reference/openapi/payment_session/createpaymentsession).