PATCH https://platform-api.lia.com.br/external_api/v1/products/:id
Body params
Name | Description | Required | Type |
---|---|---|---|
name | Name of your product | true | String |
full_amount_cents | Full price of your product in cents | true | Integer |
kind_id | Kind unique identifier | true | String |
shift_id | Shift unique identifier | true | String |
access_period | It defines the period your product will be accessible days , period or lifetime | true | String |
duration_in_days | Total duration in days, mandatory if access_period is days | false | Integer |
start_date | Date your product will start being available, ISO8601 format, mandatory if access_period is period | false | String |
end_date | Date your product will stop being available, ISO8601 format, mandatory if access_period is period | false | String |
description | The description of your product | false | String |
meta_pixel_code | Your Meta Pixel’s ID, used for tracking | false | String |
google_pixel_code | Your Google Tag Manager ID, used for tracking | false | String |
metadata | Save any important data for your integration | false | Hash |
banner | Image of your product, png, jpeg and webp with less than 500kB | false | Formdata image |
Example request
curl --location --request PATCH 'https://platform-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-1ee242dcebb"' \
--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": "8538ab61-1c4f-404b-8cfe-0dbab2bedc09",
"name": "Mentoria",
"full_amount_cents": 299700,
"created_at": "2023-09-21T14:30:07.673-03:00",
"updated_at": "2023-09-21T14:30:07.673-03:00",
"description": null,
"duration_in_hours": null,
"access_period": "days",
"duration_in_days": 90,
"start_date": null,
"end_date": null,
"availability": "enabled",
"formatted_access_period": "90 dias",
"company": {
"id": "6cdfdd04-ab2d-48ef-81bf-3e53ebc5644a",
"document": "28638760000148",
"name": "Testing Company",
"slug": "test-company",
"created_at": "2023-05-11T13:17:33.470-03:00",
"updated_at": "2023-10-18T13:48:02.666-03:00",
"theme_customizations": {
"dark": false,
"palette": "pink"
},
"logo": "https://platform-api.lia.com.br/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWszTldJMk1qbGxaQzAwWmpWa0xUUmpaVFF0WVRjNE5pMWhOMkV6TkRKalpqUmlObUlHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--6417d20a8a16fe69dddbe908a4c591b04f49822d/lia.webp",
"email": null,
"phone": null,
"address": {
"id": "3913166c-2dac-4610-9d62-f646d69ba4f6",
"zipcode": "12244392",
"neighborhood": "Testing",
"street": "Avenida Ironman Victor Garrido",
"number": "1234",
"complement": null,
"created_at": "2023-05-11T13:17:33.393-03:00",
"updated_at": "2023-05-11T13:17:33.393-03:00",
"city": {
"id": "c478db95-9188-461f-933a-e89b09644f16",
"name": "São José dos Campos",
"ibge_code": "3549904",
"created_at": "2023-05-11T11:42:11.721-03:00",
"updated_at": "2023-05-11T11:42:11.721-03:00",
"state": {
"id": "c3d17d30-4750-4d15-ba71-1d0d782323a8",
"name": "São Paulo",
"acronym": "SP",
"created_at": "2023-05-11T11:42:11.706-03:00",
"updated_at": "2023-05-11T11:42:11.706-03:00"
}
}
}
},
"kind": {
"id": "bba09b78-6d27-449a-a67a-cbe207f39f83",
"name": "Mentoria",
"created_at": "2023-07-26T15:10:27.177-03:00",
"updated_at": "2023-07-26T15:10:27.177-03:00"
},
"offers": [
{
"id": "f429f9de-7f34-4957-93ef-ba9d773be7c5",
"amount_cents": 299700,
"created_at": "2023-09-21T14:30:46.636-03:00",
"updated_at": "2023-09-21T14:30:46.636-03:00",
"name": "Cartão de Crédito",
"availability": "enabled"
}
]
}