POST https://external-api.lia.com.br/external_api/v1/orders
Body params
| Name | Description | Required | Type |
|---|---|---|---|
| offer_id | Offer’s ID | true | String |
| Customer’s email | true | String | |
| phone | Customer’s phone | true | String |
| customer_name | Customer name. Letters (accented included) and spaces only | true | String |
| customer_birthdate | Customer birthdate (YYYY-MM-DD), not in the future | true | String |
| customer_document | Customer document. Must be a valid CPF | true | String |
| address | Address object. Required only when the offer’s checkout_type is default | false | Object |
| signature | Signature object | true | Object |
| query_params | Query params of the customer’s visit; the utm_* keys are stored in the order’s metadata.utm_params | false | Object |
| device_id | Customer’s device identifier, stored in the order’s metadata.device_id | false | String |
| customer_company_name | Company name of the customer. Only stored when the customer_document_switch feature is enabled for your company | false | String |
| customer_company_document | Company document (CNPJ) of the customer. Only stored when the customer_document_switch feature is enabled for your company | false | String |
Address object
| Name | Description | Required | Type |
|---|---|---|---|
| zipcode | Zipcode, 8 digits, with or without - | true | String |
| street | Street | true | String |
| neighborhood | Neighborhood | true | String |
| number | Number | true | String |
| complement | Complement | false | String |
| city_ibge_code | City IBGE code, the ibge_code from List cities. Send it with state or state_id, or send city_id instead. An unknown city answers 404 | false | String |
| state | State acronym, e.g. SP | false | String |
| state_id | State’s ID, from List states | false | String |
| city_id | City’s ID, from List cities | false | String |
Signature object
| Name | Description | Required | Type |
|---|---|---|---|
| remote_ip | IP address of the customer | true | String |
| user_agent | User agent of the customer’s browser | true | String |
After creation, all orders undergo analysis. If the customer check fails to meet approval, the order will be AUTOMATICALLY canceled. Access to these analyses is available through the order object.
To skip the identity, financial and defaulting customer analyses in sandbox environment, use the following customer_document: 000.000.001-91. They are recorded as approved; the blacklist check still runs.
Example request
curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/orders' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data-raw '{
"offer_id": "8dd4fffd-e1b3-503f-a7f2-963c6d32c0cd",
"email": "john.armless@example.com",
"phone": "+5511999999999",
"customer_name": "John Armless",
"customer_birthdate": "1990-01-01",
"customer_document": "00000000191",
"address": {
"zipcode": "01001-000",
"street": "Rua Exemplo",
"neighborhood": "Centro",
"number": "100",
"complement": "",
"city_ibge_code": "3549904",
"state": "SP"
},
"signature": {
"remote_ip": "127.0.0.1",
"user_agent": "Mozilla/5.0"
}
}'
Example response
{
"address": {
"city": {
"ibge_code": "3549904",
"id": "137f7173-928a-596d-82f8-b63c8890c047",
"name": "São José dos Campos",
"state": {
"acronym": "SP",
"id": "50405e03-46a1-5b31-8ed1-d08167af85f6",
"name": "São Paulo"
},
"state_id": "50405e03-46a1-5b31-8ed1-d08167af85f6"
},
"complement": "",
"id": "7f5d4d5b-c5bd-567a-ae5b-614e0f249a32",
"neighborhood": "Centro",
"number": "100",
"street": "Rua Exemplo",
"zipcode": "01001000"
},
"amount_cents": 20000,
"analyses": [
{
"created_at": "2024-05-13T18:05:35.765-03:00",
"denied_reason": null,
"id": "275cba72-bf89-511f-88cb-792299920c54",
"kind": "identity",
"status": "approved"
},
{
"created_at": "2024-05-13T18:05:36.046-03:00",
"denied_reason": null,
"id": "ea824377-f607-5080-939d-5edcde16ba5b",
"kind": "defaulting_customer",
"status": "approved"
}
],
"billings": [],
"cancelation_reason": null,
"checkout_type": "default",
"created_at": "2024-05-13T18:05:35.625-03:00",
"customer_birthdate": "1990-01-01",
"customer_document": "00000000191",
"customer_name": "John Armless",
"customer_type": "person",
"email": {
"address": "john.armless@example.com",
"contact_type": "email",
"created_at": "2024-05-13T18:05:35.675-03:00",
"id": "dac9a2d6-9d0e-5165-837f-5db9a3626773",
"purpose": "communication",
"updated_at": "2024-05-13T18:05:35.675-03:00",
"validated": false
},
"finished_at": null,
"id": "80509ba1-fb93-5b12-b055-03de830e97a9",
"metadata": {},
"offer": {
"amount_cents": 20000,
"amount_currency": "BRL",
"availability": "enabled",
"checkout_type": "default",
"created_at": "2024-05-13T08:55:25.858-03:00",
"expires_at": null,
"id": "8dd4fffd-e1b3-503f-a7f2-963c6d32c0cd",
"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": "7e2d9f50-27fa-5d87-924f-b0bb50434d50",
"interest_rate": "0.0",
"max_amount_cents": null,
"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": "10d95971-868c-517a-9354-8a2b8905fccd",
"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": "a622575f-2f5d-532f-9c8f-22e33593d3ce",
"kind": {
"id": "95c7a40c-fe12-4459-bc53-7a16cf6b2493",
"name": "Curso"
},
"meta_pixel_code": "",
"metadata": {},
"name": "Curso Exemplo",
"shift": {
"id": "7b062161-db67-4ae4-b591-1ee242dcebb3",
"name": "Online"
},
"start_date": null,
"updated_at": "2024-04-17T16:00:27.445-03:00"
},
"seats": null,
"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=8dd4fffd-e1b3-503f-a7f2-963c6d32c0cd"
},
"offers": [],
"phone": {
"address": "11999999999",
"contact_type": "phone",
"created_at": "2024-05-13T18:05:35.667-03:00",
"id": "60f6e814-a63f-57bc-851d-adf44c07140c",
"purpose": "communication",
"updated_at": "2024-05-13T18:05:35.667-03:00",
"validated": false
},
"root_billing": null,
"status": "in_progress",
"translated_cancelation_reason": null,
"updated_at": "2024-05-13T18:05:35.979-03:00",
"url": "https://pague-sandbox.lia.com.br/lia/pedido?order_id=80509ba1-fb93-5b12-b055-03de830e97a9"
}