Create a Product
This endpoint needs your API key
Send it as a bearer token in the Authorization header. A request without one is answered with 401. See Authentication for where to find your key and how to keep it secret.
Request
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"
]
}'Response
Created
{
"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"
]
}Request body
Required. Send it as JSON.
namestringrequiredName of the product. Constraints: Not null, Size(min=3, max=80)
Must be:3 to 80 characterscodestringrequiredCode of the product. Constraints: Not null, Size(min=3, max=20)
Must be:3 to 20 charactersdescriptionstringrequiredShort description of the product. Constraints: Not null, Size(min=3, max=100)
Must be:3 to 100 characterstypestringrequiredProduct type. Constraints: Not null
Allowed values:servicegoodaddonstandardsingletriplequadsuiteand 10 morestatusstringrequiredStatus of the product.
Allowed values:soldoutavailableunavailableimagesarray of stringList of images URL of the product
price_detailsarray of PriceDetailRequestrequiredList of Product Price Details. Constraints: Not null
priceinteger<int64>requiredPrice of the product. Constraints: Not null, Should be a positive number
currencystringrequiredCurrency of the product. Constraints: Not null, Should be a positive number
Allowed values:BIFUSDKESXAF
attributes_hospitality_industryProductAttributebedTypestringnumberOfGuestsinteger<int32>amenitiesarray of string
rate_idsarray of stringList of Rate Id that can be applied to the product price.
Response
idstringProduct ID
namestringProduct Name
codestringProduct Code
descriptionstringProduct Description
statusstringProduct Status
Allowed values:soldoutavailableunavailabletypestringProduct type
Allowed values:servicegoodaddonstandardsingletriplequadsuiteand 10 moreimagesarray of stringList of images URL of the product
attributesProductAttributebedTypestringnumberOfGuestsinteger<int32>amenitiesarray of string
rateIdarray of stringcreated_dateinteger<int64>Product creation time
price_detailsarray of PriceDetailResponseDetail of the price
priceinteger<int64>Price of the product. Constraints: Not null, Should be a positive number
currencystringCurrency of the product. Constraints: Not null, Should be a positive number
Allowed values:BIFUSDKESXAF
livebooleanWhether is the production data or test data.
rate_idsarray of stringRate Id that will affect the product price.
Status codes
201Created400Bad request401Unauthorized402Payment required403Forbidden404Not found428Precondition required500Server error