Method: https://oms.tpl.com.br/api/get/purchase

Objective: Search inbound invoice status
          
            
JSON Composition for inbound invoice inquiry:

{
*"auth" : key obtained in get/auth method
*,"invoice" :
{
"key" : invoice key (*1)
,"number" : invoice number
,"serial" : invoice serial number
}
}

*1 - if the key is provided, it is not necessary to inform number and serial

Returns with:
{
"code" : integer – system execution code
,"message" : text – "OK" message or error details
,"id": integer – internal invoice number
,"detail" : object
{
"dh" : event date and time
,"supplier": issuer name
,"supplierdocument": issuer CNPJ
,"number": fiscal invoice number
,"serie": fiscal invoice series
,"key": fiscal invoice key
,"code" : event code
,"message" : event description
}
,"historical" : object
[
{
"noteIssued" : invoice creation date/time
,"included" : date/time record was created on the platform
,"processing" : date/time document was sent to wms for processing
,"internalized" : date/time wms returned the internalized invoice OK
}
]
,"items" : object
[
"sku" : sku registered in oms
,"sku_nf" : sku received in the inbound invoice
,"qtdade" : valid quantity (q.nf - (q.missing + q.damage)
,"qavaria" : quantity of damaged items
,"qfaltante" : quantity of missing items
,"lote" : object with batch data
[
"lote" : batch number
,"fabricacao" : dd/mm/yyyy
,"validade" : dd/mm/yyyy
,"quantidade" : quantity
]
,"seriais" : vector containing received serials
,"ocorrencias" : object containing occurrences vector
[
{
"tipo" : text containing the type of occurrence
,"quantidade" : quantity of items in the occurrence
,"series" : vector containing list of serials
,"lotes" : vector containing list of batches
}
]
]
}

code
200: request processed successfully
400: fiscal invoice contained errors, check "message" tag
401: invoice already in the system
402: invalid received data - json
404: invoice not found
500: invalid auth
501: user unauthorized to insert purchase invoice
502: client blocked

code / detail
0: invoice received waiting for processing
1: invoice being processed in wms
3: invoice rejected
4: invoice internalized