line_items

Update a line item

Changed on

Update a line item

patch/line_items/{lineItemId}

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/line_items/{lineItemId}
  • Auth
    HTTP bearer

Path parameters

lineItemIdstring required

The resource's id

Request body

Example request

{
  "data": {
    "id": "XAyRWNUzyN",
    "attributes": {
      "sku_code": "TSHIRTMM000000FFFFFFXLXX",
      "bundle_code": "BUNDLEMM000000FFFFFFXLXX",
      "quantity": 4,
      "_external_price": true,
      "_reserve_stock": true,
      "_reset_restocked_quantity": true,
      "unit_amount_cents": 10000,
      "compare_at_amount_cents": 13000,
      "options_amount_cents": 1000,
      "name": "Men's Black T-shirt with White Logo (XL)",
      "image_url": "https://img.yourdomain.com/skus/xYZkjABcde.png",
      "frequency": "monthly",
      "_reset_circuit": true,
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "tags": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      }
    }
  }
}

Response

The updated line item object

Changes

    • info

      added the optional property // to the response with the status

    • breaking

      request property / was restricted to a list of enum values

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property default value line_items was removed

    • info

      added the new line_items enum value to the request property /

    • info

      added the media type application/vnd.api+json for the response with the status