Method: https://oms.tpl.com.br/api/put/order

Objective: Sends the order
          
            
JSON Composition for sending:

{
*"auth" : key obtained in get/auth method
,*"order" :
{
*"number" : text (50) – must be unique, contain only characters 0..9, A..Z, "-", "." or "_"
,*"date" : date - dd/mm/yyyy format (order creation date in ERP)
,"info": this field can be filled with free text or with the JSON below for handling information from ERP
{
"erp": generator ERP identifier,
,"iderp": order ID in the platform or marketplace,
,"numeropedidoloja": order number recognized in this store
},
,"salesChannel" : text(50) – literal containing the name of the sales channel
,"gift" : text(1) – Y or N to use gift wrapping
,"giftFrom" : text(100) – message to be printed on gift wrap
,"giftTo" : text(100) – message to be printed on gift wrap
,"giftMessage" : text(255) – message to be printed on gift wrap
,"marketPlaceId" : text(30) - order ID in marketplace
,"marketPlaceName" : text(50) - marketplace name
,*"deliveryTo" :
{
*"name": text (100) – contain only characters 0..9, A..Z, "-", ".", "_" or spaces
*,"identification": text(20) – cnpj/cpf contain only 0..9
*,"phone": text(11) – contact phone contain only 0..9
*,"mail" : text(255) – contact email
*,"address" :
{
*"street" : text (255) – no special characters/accents
*,"number": text (50) – identification of the delivery location number
,"complement" : text (255) – no special characters/accents
*,"neighborhood" : text(255) – no special characters/accents
*,"city" : text(255) – no special characters/accents
*,"state" : text(3)
*,"zipCode" : text(8) – characters 0..9 (leading zeros)
}
,"note" : text – order observation information
}
,"shipping" :
{
"company": text(255) – no special characters/accents
,"method": text(50) – no special characters/accents
,"invoice": base64 of the Nfe XML
,"tracking": SRO code from CORREIOS
,"extra_identification" : extra identification code to be passed to WMS
,"value": order value to be transported
,"weight": order weight to be transported
}
,"warehouse" : text(255) – warehouse name
,"attachments" :
[
{
"type" : slip/label
,"pdf" : PDF base64
,"zpl" : ZPL base64
}
]
*,"items":
[
{
*"sku": text(50) – no special characters/accents
,"name" : text(100) - for BESTMILE clients informing this field allows automatic registration
,"measurement" : text(20) - contains unit name for conversion (optional, but if informed must be configured in FMS)
*,"amount": integer – quantity (must be greater than 0)
*,"unitWeight": integer – grams
,"cubingHeight": integer – cm
,"info" : text – for data exchange
,"cubingWidth": integer – cm
,"cubingDepth" : integer - cm
,"kit" : main SKU of the kit
,"part" : identification of the batch for outbound
}
]

}

(if "shipping" is not informed but agreed between TPL and CLIENT, it will be filled automatically according to the rule stipulated between the parties, which can be the fastest or cheapest; otherwise error 403 will be triggered)

attachments: To use this resource, consultation with the projects and implementation team is required. Only one attachment is allowed (can contain multiple pages but not multiple PDFs).
info: Both TAGs serve to transit any type of info (csv, json, etc) for tasks agreed between TPL and CLIENT.
salesChannel: Free literal (not mandatory) for marketplace identification or cutoff rules.

Important: We do not handle billing addresses; our records are limited to the delivery location.

Returns:
{
"code" : integer
,"message": text
,"id" : integer
,"stock": integer (0=not analyzed, 200=stock available, 404=no stock)
,"missing" : list of SKUs with no available stock
}

Code:
200: Order received successfully (internal ID returned)
202: Order already sent, internal ID returned in id field
400: Invalid recipient data
402: Invalid data received
403: Shipping not informed
404: SKU not found, check SKU in message
405: Mandatory TAG not informed
406: Quantity error
407: Data not as expected
408: Mode not associated with carrier
409: Carrier non-existent
410: Invalid phone number
411: Invoice key already used
412: UF field invalid size
413: Date in invalid format
417: SKU inactive or not found
418: Package not configured in FMS
428: XML/nfe invalid
429: Internal handler failure – contact IT
433: Operation type not served by carrier
434: Sales channel not informed but mandatory
500: Invalid auth
503: Request excess (120 per minute)