Create an order

POST

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

Body params

NameDescriptionRequiredType
offer_idOffer’s IDtrueString
emailCustomer’s emailtrueString
phoneCustomer’s phonetrueString
customer_nameCustomer name. Letters (accented included) and spaces onlytrueString
customer_birthdateCustomer birthdate (YYYY-MM-DD), not in the futuretrueString
customer_documentCustomer document. Must be a valid CPFtrueString
addressAddress object. Required only when the offer’s checkout_type is defaultfalseObject
signatureSignature objecttrueObject
query_paramsQuery params of the customer’s visit; the utm_* keys are stored in the order’s metadata.utm_paramsfalseObject
device_idCustomer’s device identifier, stored in the order’s metadata.device_idfalseString
customer_company_nameCompany name of the customer. Only stored when the customer_document_switch feature is enabled for your companyfalseString
customer_company_documentCompany document (CNPJ) of the customer. Only stored when the customer_document_switch feature is enabled for your companyfalseString

Address object

NameDescriptionRequiredType
zipcodeZipcode, 8 digits, with or without -trueString
streetStreettrueString
neighborhoodNeighborhoodtrueString
numberNumbertrueString
complementComplementfalseString
city_ibge_codeCity IBGE code, the ibge_code from List cities. Send it with state or state_id, or send city_id instead. An unknown city answers 404falseString
stateState acronym, e.g. SPfalseString
state_idState’s ID, from List statesfalseString
city_idCity’s ID, from List citiesfalseString

Signature object

NameDescriptionRequiredType
remote_ipIP address of the customertrueString
user_agentUser agent of the customer’s browsertrueString

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"
}