Update an offer

PUT

PUT https://platform-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 ConfigurationsfalseString
availabilityDisable or enable an offer, enabled or disabledfalseString

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.

Example request

curl --location --request PUT 'https://platform-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
    },
    "payment_configurations": [
        {
            "payment_type": "upfront",
            "payment_methods": ["pix"],
            "expires_in_hours": 24
        }
    ]
}'

Example response

{
    "amount_cents": 20000,
    "amount_currency": "BRL",
    "availability": "enabled",
    "created_at": "2024-05-13T08:55:25.858-03:00",
    "id": "e988ca99-9ee4-4c54-8ea0-5776fa645018",
    "name": "Padrão VIA API",
    "payment_configurations": [
        {
            "allowed_down_payment_methods": [],
            "availability": "enabled",
            "down_payment_type": null,
            "down_payment_value": 0.0,
            "expires_in": 24,
            "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"
    },
    "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"
}