# Create a Product `POST https://api.leapa.co/v2/products` Send your API key as a bearer token in the `Authorization` header. ## Request body Required. `application/json`. - `name` · _string_ · **required** — Name of the product. Constraints: Not null, Size(min=3, max=80) Must be: 3 to 80 characters - `code` · _string_ · **required** — Code of the product. Constraints: Not null, Size(min=3, max=20) Must be: 3 to 20 characters - `description` · _string_ · **required** — Short description of the product. Constraints: Not null, Size(min=3, max=100) Must be: 3 to 100 characters - `type` · _string_ · **required** — Product type. Constraints: Not null Allowed values: `service`, `good`, `addon`, `standard`, `single`, `triple`, `quad`, `suite`, `presidential`, `king`, `queen`, `interconnecting`, `adjoining`, `adjacent`, `studio`, `room`, `apartment`, `not_supported` - `status` · _string_ · **required** — Status of the product. Allowed values: `soldout`, `available`, `unavailable` - `images` · _array of string_ — List of images URL of the product - `price_details` · _array of PriceDetailRequest_ · **required** — List of Product Price Details. Constraints: Not null - `price` · _integer_ · **required** — Price of the product. Constraints: Not null, Should be a positive number - `currency` · _string_ · **required** — Currency of the product. Constraints: Not null, Should be a positive number Allowed values: `BIF`, `USD`, `KES`, `XAF` - `attributes_hospitality_industry` · _ProductAttribute_ - `bedType` · _string_ - `numberOfGuests` · _integer_ - `amenities` · _array of string_ - `rate_ids` · _array of string_ — List of Rate Id that can be applied to the product price. ```json { "name": "Jeanne Ndayishimiye", "code": "string", "description": "Room 204, two nights", "type": "service", "status": "soldout", "images": [ "string" ], "price_details": [ { "price": 0, "currency": "BIF" } ], "attributes_hospitality_industry": { "bedType": "string", "numberOfGuests": 0, "amenities": [ "AIR_CONDITIONING" ] }, "rate_ids": [ "string" ] } ``` ## Response 201 - `id` · _string_ — Product ID - `name` · _string_ — Product Name - `code` · _string_ — Product Code - `description` · _string_ — Product Description - `status` · _string_ — Product Status Allowed values: `soldout`, `available`, `unavailable` - `type` · _string_ — Product type Allowed values: `service`, `good`, `addon`, `standard`, `single`, `triple`, `quad`, `suite`, `presidential`, `king`, `queen`, `interconnecting`, `adjoining`, `adjacent`, `studio`, `room`, `apartment`, `not_supported` - `images` · _array of string_ — List of images URL of the product - `attributes` · _ProductAttribute_ - `bedType` · _string_ - `numberOfGuests` · _integer_ - `amenities` · _array of string_ - `rateId` · _array of string_ - `created_date` · _integer_ — Product creation time - `price_details` · _array of PriceDetailResponse_ — Detail of the price - `price` · _integer_ — Price of the product. Constraints: Not null, Should be a positive number - `currency` · _string_ — Currency of the product. Constraints: Not null, Should be a positive number Allowed values: `BIF`, `USD`, `KES`, `XAF` - `live` · _boolean_ — Whether is the production data or test data. - `rate_ids` · _array of string_ — Rate Id that will affect the product price. ```json { "id": "obj_5f21c8a40b", "name": "Jeanne Ndayishimiye", "code": "string", "description": "Room 204, two nights", "status": "soldout", "type": "service", "images": [ "string" ], "attributes": { "bedType": "string", "numberOfGuests": 0, "amenities": [ "AIR_CONDITIONING" ] }, "rateId": [ "rat_20b6df3c9e" ], "created_date": 0, "price_details": [ { "price": 0, "currency": "BIF" } ], "live": false, "rate_ids": [ "string" ] } ``` ## Status codes - `201` Created - `400` Bad request - `401` Unauthorized - `402` Payment required - `403` Forbidden - `404` Not found - `428` Precondition required - `500` Server error ## Example ```bash curl -X POST "https://api.leapa.co/v2/products" \ -H "Authorization: Bearer $LEAPA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Jeanne Ndayishimiye", "code": "string", "description": "Room 204, two nights", "type": "service", "status": "soldout", "images": [ "string" ], "price_details": [ { "price": 0, "currency": "BIF" } ], "attributes_hospitality_industry": { "bedType": "string", "numberOfGuests": 0, "amenities": [ "AIR_CONDITIONING" ] }, "rate_ids": [ "string" ] }' ``` --- _Generated from the Leapa documentation at leapa.co/docs._