Update a product

PATCH

PATCH https://external-api.lia.com.br/external_api/v1/products/:id

Body params

Only the fields sent are changed.

NameDescriptionRequiredType
nameName of your productfalseString
full_amount_centsFull price of your product in cents. While the product is enabled, it must be between 500 and 500000000 and not lower than the amount of its highest enabled offerfalseInteger
kind_idKind unique identifierfalseString
shift_idShift unique identifierfalseString
access_periodIt defines the period your product will be accessible days, period, lifetime or undefined_periodfalseString
duration_in_daysTotal duration in days, mandatory if access_period is daysfalseInteger
duration_in_hoursTotal duration in hoursfalseInteger
start_dateDate your product will start being available, ISO8601 format, mandatory if access_period is periodfalseString
end_dateDate your product will stop being available, ISO8601 format, mandatory if access_period is periodfalseString
descriptionThe description of your productfalseString
meta_pixel_codeYour Meta Pixel’s ID, used for trackingfalseString
google_pixel_codeYour Google Tag Manager ID, used for trackingfalseString
metadataSave any important data for your integrationfalseHash
bannerImage of your product, png, jpeg and webp with less than 500kBfalseFormdata image

Example request

curl --location --request PATCH 'https://external-api-sandbox.lia.com.br/external_api/v1/products/:id' \
--header 'Authorization: Bearer token' \
--form 'name="Test Product"' \
--form 'full_amount_cents="77777777"' \
--form 'kind_id="95c7a40c-fe12-4459-bc53-7a16cf6b2493"' \
--form 'shift_id="7b062161-db67-4ae4-b591-1ee242dcebb3"' \
--form 'access_period="lifetime"' \
--form 'description="Something nice"' \
--form 'meta_pixel_code="some_string"' \
--form 'google_pixel_code="some_string"' \
--form 'metadata[key]="value of metadata key"' \
--form 'banner=@"/path/to/file"'

Example response

{
  "id": "ce375417-b11a-527a-85f1-30d1202cd5c3",
  "name": "Mentoria",
  "full_amount_cents": 299700,
  "full_amount_currency": "BRL",
  "created_at": "2023-09-21T14:30:07.673-03:00",
  "description": null,
  "availability": "enabled",
  "duration_in_hours": null,
  "access_period": "days",
  "duration_in_days": 90,
  "start_date": null,
  "end_date": null,
  "meta_pixel_code": "",
  "google_pixel_code": "",
  "banner_url": null,
  "updated_at": "2023-09-21T14:30:07.673-03:00",
  "metadata": {},
  "company_id": "6883d1f9-0cf0-5167-a6bd-fc57b08454a5",
  "formatted_access_period": "90 dias",
  "kind": {
    "id": "f14e02ca-3175-5468-a3fd-7f6c15393d19",
    "name": "Mentoria"
  },
  "shift": {
    "id": "7b062161-db67-4ae4-b591-1ee242dcebb3",
    "name": "Turno Matutino"
  },
  "offers": [
    {
      "id": "c013d81e-57e9-519e-8f3b-8d161568dbca",
      "name": "Cartão de Crédito",
      "amount_cents": 299700,
      "amount_currency": "BRL",
      "availability": "enabled",
      "created_at": "2023-09-21T14:30:46.636-03:00",
      "updated_at": "2023-09-21T14:30:46.636-03:00",
      "url": "https://pague.lia.com.br/lia/oferta?offer_id=c013d81e-57e9-519e-8f3b-8d161568dbca",
      "smart_payment_enabled": false,
      "checkout_type": "default",
      "expires_at": null,
      "seats": null,
      "product": {
        "id": "ce375417-b11a-527a-85f1-30d1202cd5c3",
        "name": "Mentoria",
        "full_amount_cents": 299700,
        "full_amount_currency": "BRL",
        "created_at": "2023-09-21T14:30:07.673-03:00",
        "description": null,
        "availability": "enabled",
        "duration_in_hours": null,
        "access_period": "days",
        "duration_in_days": 90,
        "start_date": null,
        "end_date": null,
        "meta_pixel_code": "",
        "google_pixel_code": "",
        "banner_url": null,
        "updated_at": "2023-09-21T14:30:07.673-03:00",
        "metadata": {}
      }
    }
  ]
}