Skip to content

Update a product

PUT https://api.leapa.co/v2/products/{product_id}

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 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"
    ]
  }'

Response

OK

{
  "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"
  ]
}

Path parameters

Values that go into the URL itself.

  • product_idstringrequired
    Example:prd_84c2e7f019

Request body

application/json

Required. Send it as JSON.

  • namestring

    Name of the product. Constraint: Optional, Ignore null value, (min=3, max=40)

    Must be:3 to 80 characters
  • statusstring

    Status of the product. Contraint: ignore null value

    Allowed values:soldoutavailableunavailable
  • descriptionstring

    Short description of the product. Constraint: Optional, Ignore null value, Size (min= 3, max=100)

    Must be:3 to 100 characters
  • typestring

    Product type. Constraint: Optional, Ignore null value

    Allowed values:servicegoodaddonstandardsingletriplequadsuiteand 10 more
  • price_detailsarray of PriceDetailRequestrequired

    List of Product Price Details. Constraints: Not null

  • codestring

    Code of the product. Constraint: Optional, Ignore null value

  • rate_idsarray of string

    List of Rate Id that can be applied to the product price.

Response

application/json
  • idstring

    Product ID

  • namestring

    Product Name

  • codestring

    Product Code

  • descriptionstring

    Product Description

  • statusstring

    Product Status

    Allowed values:soldoutavailableunavailable
  • typestring

    Product type

    Allowed values:servicegoodaddonstandardsingletriplequadsuiteand 10 more
  • imagesarray of string

    List of images URL of the product

  • attributesProductAttribute
  • rateIdarray of string
  • created_dateinteger<int64>

    Product creation time

  • price_detailsarray of PriceDetailResponse

    Detail of the price

  • liveboolean

    Whether is the production data or test data.

  • rate_idsarray of string

    Rate Id that will affect the product price.

Status codes

  • 200OK
  • 400Bad request
  • 401Unauthorized
  • 402Payment required
  • 403Forbidden
  • 404Not found
  • 428Precondition required
  • 500Server error

Request

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"
    ]
  }'

Response

OK

{
  "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"
  ]
}