API Reference

Create order

This API allows the creation of orders in the LORI system. Below is the JSON structure for order creation along with descriptions of each field.

Reques Body Example

{
    "createDate": "", // Date when the order is created (format: YYYY-MM-DD)
    "externalId": "0000582633", // External identifier for the order (string)
    "channel": "marketplace", // The sales channel through which the order was made (string)
    "cpfPickUp": "", // CPF (Brazilian ID) of the person picking up the order (string)
    "dealerCode": "", // Code of the dealer processing the order (string)
    "isDelivery": true, // Indicates if the order is for delivery (boolean)
    "status": "", // Current status of the order (integer)
    "orderNote": "", // Additional notes about the order (string)

    "buyer": {
        "fullName": "Silvia Muller Kauffman", // Full name of the buyer (string)
        "email": "[email protected]", // Email address of the buyer (string)
        "cpf": "38725567881", // CPF (Brazilian ID) of the buyer (string)
        "phoneNumber": "99999999999", // Buyer's phone number (string)
        "gender": 0, // Gender of the buyer (0 for male, 1 for female)
        "dateOfBirth": null, // Buyer's date of birth (format: YYYY-MM-DD)
        "address": {
            "street": "Rua Doutor Albuquerque Lins", // Street address of the buyer (string)
            "number": "993", // House or building number (string)
            "complement": "ap. 111", // Additional address information (string)
            "neighborhood": "Santa Cecília", // Buyer's neighborhood (string)
            "cep": "01230-001", // Postal code (CEP) of the buyer's address (string)
            "city": "São Paulo", // City of the buyer (string)
            "state": "SP", // State of the buyer (string)
            "reference": null, // Reference point for the address (string)
            "label": null // Name or label for the address (e.g., home, work) (string)
        }
    },

    "seller": {
        "cnpj": "95736210000159", // CNPJ (Brazilian business ID) of the seller (string)
        "pointSaleId": "95736210000159" // Point of sale identifier (string)
    },

    "freight": {
        "deliveryTime": 3, // Estimated delivery time (integer)
        "deliveryTimeUnit": "", // Unit for delivery time, e.g., days, hours (string)
        "estimateDate": "", // Estimated delivery date (format: YYYY-MM-DD)
        "reference": "Motoboy", // Reference for the freight (string)
        "description": "Motoboy", // Description of the delivery method (string)
        "amount": 0.0 // Cost of freight (float)
    },

    "deliveryAddress": {
        "street": "Rua Avenida Alameda", // Delivery street address (string)
        "number": "100", // Delivery house or building number (string)
        "complement": "ap. 111", // Additional delivery address information (string)
        "neighborhood": "Santa Cecília", // Delivery neighborhood (string)
        "cep": "01230-001", // Postal code (CEP) for delivery (string)
        "city": "São Paulo", // Delivery city (string)
        "state": "SP", // Delivery state (string)
        "latitude": null, // Latitude for geolocation (optional, float)
        "longitude": null, // Longitude for geolocation (optional, float)
        "reference": null, // Reference point for delivery address (string)
        "label": null // Name or label for the delivery address (e.g., home, work) (string)
    },

    "paymentInfo": {
        "externalTransactionId": "333040819", // External transaction identifier (string)
        "nsu": "333040819", // Unique sequence number for transaction (string)
        "acquirerApprovalCode": "038893", // Approval code from payment acquirer (string)
        "acquirerMessage": "Mastercard", // Message from payment acquirer (string)
        "statusMessage": null, // Status message for payment (string)
        "feeAmount": 0.0, // Transaction fee amount (float)
        "amount": 264.0, // Total payment amount (float)
        "quantityInstallments": 2, // Number of installments for payment (integer)

        "paymentMethod": {
            "type": 1, // Type of payment method (integer)
            "info": "Mastercard - **** **** **** 6455", // Information about the payment method (string)
            
            // Credit or Debit Card Information
            "cardHolder": null, // Name of the cardholder (string)
            "brand": "mastercard", // Card brand (string)
            "number": null, // Card number (optional, string)
            "finalNumber": "6455", // Last four digits of the card number (string)
            "binNumber": "549167", // Bank Identification Number (string)
            "expiration": null, // Card expiration date (optional, format: MM/YY)

            // Bank Slip Information
            "bankCode": null, // Bank code for bank slip (string)
            "bankSlipUrl": null, // URL for the bank slip (string)
            "bankSlipLine": null, // Line number for bank slip (string)
            "bankSlipExpirationDate": null // Expiration date for the bank slip (format: YYYY-MM-DD)
        }
    },

    "items": [
        {
            "quantity": 1, // Quantity of the item ordered (integer)
            "unitPrice": 79.0, // Price per unit of the item (float)
            "subTotalAmount": 79.0, // Subtotal amount for this item (unitPrice * quantity) (float)
            "discountPrice": 0.0, // Discount applied to this item (float)
            "totalAmount": 79.0, // Total amount after discount (subTotalAmount - discountPrice) (float)
            "itemNote": "", // Notes about the item (string)

            "sku": {
                "code": "7721", // SKU code (string)
                "auxCode": null, // Auxiliary code (string)
                "barcode": "7909300239857", // Barcode of the item (string)
                "productCode": "2724", // Product code (string)
                "product": {
                    "unitPrice": 220.00 // Unit price of the product (float)
                }
            },

            "isGift": false, // Indicates if the item is a gift (boolean)
            "giftMessage": "", // Message for the gift (string)
            "coupon": "" // Coupon applied to the item (string)
        }
    ],

    "discountAmount": 0.0, // Total discount amount applied to the order (float)
    "subTotalAmount": 264.0, // Subtotal amount of the order (float)
    "freightAmount": 0.0, // Freight amount for the order (float)
    "totalAmount": 264.0 // Total order amount including discounts and freight (float)
}

Field Descriptions

General Order Data

createDate (Date): Date when the order is created.
externalId (String): ID of the order in the sales channel (marketplace or app).
channel (String): Sales channel through which the order was made (e.g., “Marketplace”).
cpfPickUp (String): CPF of the person picking up the order (for “pick up in-store” mode).
dealerCode (String): Code of the dealer processing the order.
isDelivery (Boolean): Indicates if the order is for delivery (“true” for “Home Delivery”, “false” for “Pick Up In Store”).
status (Int): ID of the current status of the order.
orderNote (String): Additional notes about the order.

Consumer Data

buyer (Object): Object containing buyer information.
	fullName (String): Full name of the buyer.
	email (String): Email address of the buyer.
	cpf (String): CPF of the buyer.
  phoneNumber (String): Buyer’s phone number.
  gender (Integer): Gender of the buyer (0 for male, 1 for female).
  dateOfBirth (Date): Buyer’s date of birth.
  address (Object): Object containing address details.
  street (String): Street address of the buyer.
  number (String): House or building number.
  complement (String): Additional address information.
  neighborhood (String): Buyer’s neighborhood.
  cep (String): Postal code (CEP) of the buyer’s address.
  city (String): City of the buyer.
  state (String): State of the buyer.
  reference (String): Reference point for the address.
  label (String): Name or label for the address (e.g., home, work).

Seller Data

seller (Object): Object containing seller information.
  cnpj (String): CNPJ (Brazilian business ID) of the seller.
  pointSaleId (String): Identifier for the point of sale.

Freight Data

freight (Object): Object containing freight information.
  deliveryTime (Number): Estimated delivery time in days.
  deliveryTimeUnit (String): Unit for delivery time (e.g., days, hours).
  estimateDate (Date): Estimated delivery date.
  reference (String): Reference for the freight type (e.g., motoboy).
  description (String): Description of the delivery method.
  amount (Number): Cost of freight.

Delivery Address

deliveryAddress (Object): Object containing delivery address details.
  street (String): Delivery street address.
  number (String): Delivery house or building number.
  complement (String): Additional delivery address information.
  neighborhood (String): Delivery neighborhood.
  cep (String): Postal code (CEP) for delivery.
  city (String): Delivery city.
  state (String): Delivery state.
  latitude (String): Latitude for geolocation (optional).
  longitude (String): Longitude for geolocation (optional).
  reference (String): Reference point for delivery address.
  label (String): Name or label for the delivery address (e.g., home, work).

Order Items

items (Array): Array of objects, each representing a product in the order.
  quantity (Number): Quantity of the item ordered.
  unitPrice (Number): Price per unit of the item.
  subTotalAmount (Number): Subtotal amount for this item (unitPrice * quantity).
  discountPrice (Number): Discount applied to this item.
  totalAmount (Number): Total amount after discount (subTotalAmount - discountPrice).
  itemNote (String): Notes about the item.
  sku (Object): Object containing SKU information.
    code (String): SKU code.
    auxCode (String): Auxiliary code for the SKU.
    barcode (String): Barcode of the item.
    productCode (String): Product code.
    product (Object): Object containing product details.
    	unitPrice (Number): Unit price of the product.
  isGift (Boolean): Indicates if the item is a gift (true if yes, false otherwise).
  giftMessage (String): Message for the gift.
  coupon (String): Coupon code applied to the item.

Payment Information

paymentInfo (Object): Object containing payment details.
  externalTransactionId (String): External transaction identifier.
  nsu (String): Unique sequence number for transaction.
  acquirerApprovalCode (String): Approval code from the payment acquirer.
  acquirerMessage (String): Message from the payment acquirer.
  statusMessage (String): Status message for payment.
  feeAmount (Number): Transaction fee amount.
  amount (Number): Total payment amount.
  quantityInstallments (Number): Number of installments for payment.
  paymentMethod (Object): Object containing payment method details.
    type (Number): Type of payment method (1 for Credit Card, 2 for Debit Card, 3 for Bank Slip, 4 for Voucher, 5 for Pix).
    info (String): Description of the payment method.

Payment Method for Credit and Debit Cards

paymentMethod (Object): Object containing card payment details.
  cardHolder (String): Name of the cardholder (optional).
  brand (String): Card brand (e.g., Mastercard, Visa).
  number (String): Card number (optional).
  finalNumber (String): Last four digits of the card number.
  binNumber (String): Bank Identification Number (BIN).
  expiration (String): Card expiration date (format: MM/YY, optional).

Order Totals

subTotalAmount (Number): Total value of the items in the order before discounts and charges.
  freightAmount (Number): Freight charges for the order.
  discountAmount (Number): Total discounts applied to the order.
  totalAmount (Number): Total amount for the order, including items and freight.

This documentation provides a comprehensive overview of the fields required for creating orders through the LORI API. Each field is described in detail, including data types and example values where applicable.

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!