# Create product
Source: https://docs.lomi.africa/api/products/ProductsController_create

Create product

***

title: "Create product"
description: "Create product"
full: true
method: post
path: /products
operationId: ProductsController\_create
---------------------------------------

## Overview

Create product

Creates a catalog product with at least one price in a single request. Supports pay\_what\_you\_want via pricing\_model and minimum\_amount/maximum\_amount on nested prices. For a usage product, the price amount is the pack price and included\_units is how many units that payment buys.

### When to use this

Use when onboarding catalog data for checkout, subscriptions, or payment links backed by SKUs.

### See also

[List products](/api/products/ProductsController_findAll) · [Payment links](/api/payment-links/PaymentLinksController_create)

## Authentication

Merchant routes require an API key in the `X-API-KEY` header (see [Integration overview](/api)). Use a **test** key against `https://sandbox.api.lomi.africa` and a **live** key against `https://api.lomi.africa`.

## Endpoint

`POST /products`

Base URLs:

* `https://sandbox.api.lomi.africa`
* `https://api.lomi.africa`

## Request

### Path parameters

*No path parameters beyond the URL pattern.*

### Query parameters

*No query parameters.*

### Request body

JSON request payload.

Schema: `CreateProductDto`

| Field          | Required | Type     | Description                                                                                                                        |
| -------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `name`         | Yes      | `string` | Product name                                                                                                                       |
| `product_type` | Yes      | `string` | `one_time`, `recurring`, or `usage_based`                                                                                          |
| `prices`       | Yes      | `array`  | At least one price. `amount` is what the customer pays. For a usage product, `included_units` is how many units that payment buys. |
| `usage_unit`   | No       | `string` | Unit label on a usage product                                                                                                      |
| `meter_code`   | No       | `string` | Meter name. Defaults to a slug of the product name.                                                                                |

Example body:

```json
{
  "name": "API calls",
  "product_type": "usage_based",
  "usage_unit": "call",
  "prices": [
    { "amount": 5000, "currency_code": "XOF", "included_units": 1000 }
  ]
}
```

## Responses

| Status | Description                                |
| ------ | ------------------------------------------ |
| `201`  | Created successfully                       |
| `400`  | Bad request, invalid or missing parameters |
| `401`  | Invalid or missing API key                 |

## 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

```bash
curl -sS -X POST "https://sandbox.api.lomi.africa/products" \
  -H "X-API-KEY: $LOMI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"API calls","product_type":"usage_based","usage_unit":"call","prices":[{"amount":5000,"currency_code":"XOF","included_units":1000}]}'
```

## OpenAPI

* **operationId**: `ProductsController_create`
* **Operation**: `POST /products`

Full schemas and **Try it**: [API reference](/api). Machine-readable contract: repo `apps/docs/openapi.json`.
