Create a offer

POST

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

Body params

NameDescriptionRequiredType
nameName of your offertrueString
product_idProduct’s IDtrueString
amount_centsAmount in cents of your offer. Value must be at least 500 (1000 is the same as R$ 10,00)trueInteger
payment_configurationsList of Payment ConfigurationstrueArray
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 the product’s amount. If you want to create an offer with amount greater than the product, first update the product amount.

Both expires_at and seats default to null, which means the offer keeps selling until you disable it. See automatic expiration.

exclude_from_campaign defaults to false, which means the offer takes part in the campaigns running for its company and its product. It is documented ahead of the campaigns release and has no effect yet — see campaigns.

To check company defaults for payment configurations, refer to the payment configurations section.

Example request

curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/offers' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data '{
    "offer": {
        "product_id": "c500bcfc-4716-4ad3-9b08-16cb712aaee6",
        "name": "Padrão VIA API",
        "amount_cents": 10000,
        "expires_at": "2024-06-13T23:59:59-03:00",
        "seats": 30
    },
    "payment_configurations": [
        {
            "payment_type": "upfront",
            "payment_methods": ["pix"],
            "expires_in_hours": 72
        },
        {
            "payment_type": "upfront",
            "payment_methods": ["credit_card"],
            "expires_in_hours": 24,
            "interest_rate": 0.01,
            "max_installments": 2
        },
        {
            "payment_type": "financed",
            "financed_type": "bolepix",
            "allowed_down_payment_methods": ["pix", "credit_card"],
            "payment_methods": ["pix", "boleto", "credit_card"],
            "expires_in_hours": 48,
            "interest_rate": 0.07,      // remember to respect the company maximum
            "max_installments": 20,     // remember to respect the company maximum
            "down_payment_type": "percentage",           // or "absolute"
            "down_payment_value": 12000      // remember to respect the company minimum
        }
    ]
}'

Example response

{
  "amount_cents": 10000,
  "amount_currency": "BRL",
  "availability": "enabled",
  "created_at": "2024-05-13T08:28:51.494-03:00",
  "expires_at": "2024-06-13T23:59:59.000-03:00",
  "id": "ebe69210-c9a8-42dc-8cda-3aedb3d7be90",
  "name": "Padrão VIA API",
  "payment_configurations": [
    {
      "allowed_down_payment_methods": [],
      "availability": "enabled",
      "down_payment_type": null,
      "down_payment_value": 0.0,
      "expires_in": 72,
      "financed_type": null,
      "id": "4d78071e-5a2d-4622-af97-bf645863f175",
      "interest_rate": 0.0,
      "max_down_payment_installments": null,
      "max_installments": 1,
      "min_installment_amount_cents": 0,
      "payment_methods": ["pix"],
      "payment_type": "upfront",
      "registration_fee": 0.0,
      "take_rate_type": "absolute",
      "take_rate_value": 297.0
    },
    {
      "allowed_down_payment_methods": [],
      "availability": "enabled",
      "down_payment_type": null,
      "down_payment_value": 0.0,
      "expires_in": 24,
      "financed_type": null,
      "id": "f50a159d-21ee-46cf-a711-c4a5dc074f54",
      "interest_rate": 0.01,
      "max_down_payment_installments": null,
      "max_installments": 2,
      "min_installment_amount_cents": 100,
      "payment_methods": ["credit_card"],
      "payment_type": "upfront",
      "registration_fee": 0.0,
      "take_rate_type": "percentage",
      "take_rate_value": 0.0297
    },
    {
      "allowed_down_payment_methods": ["pix", "credit_card"],
      "availability": "enabled",
      "down_payment_type": "percentage",
      "down_payment_value": 12000.0,
      "expires_in": 24,
      "financed_type": "bolepix",
      "id": "",
      "interest_rate": 0.07,
      "max_down_payment_installments": 4,
      "max_installments": 20,
      "min_installment_amount_cents": 5000,
      "payment_methods": ["pix", "boleto", "credit_card"],
      "payment_type": "financed",
      "registration_fee": 0.0297,
      "take_rate_type": "percentage",
      "take_rate_value": 0.08
    }
  ],
  "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,
  "updated_at": "2024-05-13T08:28:51.494-03:00",
  "url": "https://pague-sandbox.lia.com.br/lia/oferta?offer_id=ebe69211-c9a8-42dc-8cda-3aedb3d7be90"
}