Create a product

POST

POST https://platform-api.lia.com.br/external_api/v1/products

Body params

NameDescriptionRequiredType
nameName of your producttrueString
full_amount_centsFull price of your product in centstrueInteger
kind_idKind unique identifiertrueString
shift_idShift unique identifiertrueString
access_periodIt defines the period your product will be accessible days, period or lifetimetrueString
duration_in_daysTotal duration in days, mandatory if access_period is daysfalseInteger
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 'https://platform-api.lia.com.br/external_api/v1/products' \
--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": "testing-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"
        }
    ]
}