Update an offer

PUT

PUT https://external-api.lia.com.br/external_api/v1/offers/:id

Body params

NameDescriptionRequiredType
nameName of your offerfalseString
amount_centsAmount in cents of your offer (1000 is the same as R$ 10,00)falseInteger
payment_configurationsList of Payment ConfigurationsfalseArray
availabilityDisable or enable an offer, enabled or disabledfalseString
expires_atDate and time, in ISO8601, after which the offer stops selling. Must be in the futurefalseString
seatsNumber of sales the offer accepts before it stops selling. Must be greater than 0falseInteger
exclude_from_campaignKeeps the offer out of every campaign, so it keeps selling at its own valuesfalseBoolean

An offer can never have a amount greater than its product’s amount. If you want to create an offer with amount greater than its product’s, first update the product amount.

When updating an offer, if you change the amount_cents a new offer link will be created and the previous offer will be disabled.

Send expires_at or seats as null to drop that limit and keep the offer selling. Leaving the field out of the request keeps the limit the offer already has. See automatic expiration.

Send exclude_from_campaign as true to pull the offer out of the campaigns running for its company and its product, or as false to let it take part again. It is documented ahead of the campaigns release and has no effect yet — see campaigns.

Example request

curl --location --request PUT 'https://external-api-sandbox.lia.com.br/external_api/v1/offers/ebe69210-c9a8-42dc-8cda-3aedb3d7be90' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data '{
    "offer": {
        "name": "Padrão VIA API",
        "amount_cents": 20000,
        "expires_at": "2024-06-13T23:59:59-03:00",
        "seats": 30
    },
    "payment_configurations": [
        {
            "payment_type": "upfront",
            "payment_methods": ["pix"],
            "expires_in_hours": 24
        }
    ]
}'

Example response

{
    "amount_cents": 20000,
    "amount_currency": "BRL",
    "availability": "enabled",
    "checkout_type": "default"
    "created_at": "2024-05-13T08:55:25.858-03:00",
    "expires_at": "2024-06-13T23:59:59.000-03:00",
    "id": "e988ca99-9ee4-4c54-8ea0-5776fa645018",
    "name": "Padrão VIA API",
    "payment_configurations": [
        {
            "allowed_down_payment_methods": [],
            "availability": "enabled",
            "down_payment_interest_rate": null
            "down_payment_type": null,
            "down_payment_value": 0.0,
            "expires_in": 24,
            "fee_embedded_in_down_payment": false
            "financed_type": null,
            "id": "50dac8e0-cd4c-4024-a46b-fb090c2d6b0a",
            "interest_rate": 0.0,
            "max_down_payment_installments": null,
            "max_installments": 1,
            "min_installment_amount_cents": 5000,
            "payment_methods": [
                "pix"
            ],
            "payment_type": "upfront",
            "registration_fee": 0.0,
            "take_rate_type": "absolute",
            "take_rate_value": 297.0
        }
    ],
    "product": {
        "access_period": "lifetime",
        "availability": "enabled",
        "banner_url": null,
        "company_id": "80d5f5dd-f4d4-43fa-ad1d-3cab56c4c83a",
        "created_at": "2024-04-17T16:00:27.445-03:00",
        "description": "",
        "duration_in_days": 0,
        "duration_in_hours": 0,
        "end_date": null,
        "formatted_access_period": "Vitalício",
        "full_amount_cents": 198694,
        "full_amount_currency": "BRL",
        "google_pixel_code": "",
        "id": "c500bcfc-4716-4ad3-9b08-16cb712aaee6",
        "kind": {
            "id": "95c7a40c-fe12-4459-bc53-7a16cf6b2493",
            "name": "Curso"
        },
        "meta_pixel_code": "",
        "metadata": {},
        "name": "Analista Comercial -",
        "shift": {
            "id": "7b062161-db67-4ae4-b591-1ee242dcebb3",
            "name": "Online"
        },
        "start_date": null,
        "updated_at": "2024-04-17T16:00:27.445-03:00"
    },
    "seats": 30,
    "smart_payment_enabled": false,
    "updated_at": "2024-05-13T08:55:25.858-03:00",
    "url": "https://pague-sandbox.lia.com.br/lia/oferta?offer_id=e988ca19-9ee4-4c54-8ea0-5776fa645018"
}