# Update a product `PUT https://api.leapa.co/v2/products/{product_id}` Send your API key as a bearer token in the `Authorization` header. ## Path parameters - `product_id` · _string_ · **required** Example: `prd_84c2e7f019` ## Request body Required. `application/json`. - `name` · _string_ — Name of the product. Constraint: Optional, Ignore null value, (min=3, max=40) Must be: 3 to 80 characters - `status` · _string_ — Status of the product. Contraint: ignore null value Allowed values: `soldout`, `available`, `unavailable` - `description` · _string_ — Short description of the product. Constraint: Optional, Ignore null value, Size (min= 3, max=100) Must be: 3 to 100 characters - `type` · _string_ — Product type. Constraint: Optional, Ignore null value Allowed values: `service`, `good`, `addon`, `standard`, `single`, `triple`, `quad`, `suite`, `presidential`, `king`, `queen`, `interconnecting`, `adjoining`, `adjacent`, `studio`, `room`, `apartment`, `not_supported` - `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` - `code` · _string_ — Code of the product. Constraint: Optional, Ignore null value - `rate_ids` · _array of string_ — List of Rate Id that can be applied to the product price. ```json { "name": "Jeanne Ndayishimiye", "status": "soldout", "description": "Room 204, two nights", "type": "service", "price_details": [ { "price": 0, "currency": "BIF" } ], "code": "string", "rate_ids": [ "string" ] } ``` ## Response 200 - `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 - `200` OK - `400` Bad request - `401` Unauthorized - `402` Payment required - `403` Forbidden - `404` Not found - `428` Precondition required - `500` Server error ## Example ```bash curl -X PUT "https://api.leapa.co/v2/products/prd_84c2e7f019" \ -H "Authorization: Bearer $LEAPA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Jeanne Ndayishimiye", "status": "soldout", "description": "Room 204, two nights", "type": "service", "price_details": [ { "price": 0, "currency": "BIF" } ], "code": "string", "rate_ids": [ "string" ] }' ``` --- _Generated from the Leapa documentation at leapa.co/docs._