Páginas filhas
  • APIs Integrações - Pedido

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Totvs custom tabs box
tabsDados integrados c/ Winthor, Gravação Pedido/Retorno, Consulta de Pedido
idspasso1,passo2,passo3

A integração consiste em receber e enviar dados do pedido que serão utilizados no E-Commerce.

Totvs custom tabs box items
defaultyes
referenciapasso1

Os dados integrados são: 

APIPCPEDCPCPEDI
createDatapcpedc.datapcpedi.data
idpcpedc.codclipcpedi.codcli
orderIdpcpedc.numpedpcpedi.numped
orderStatuspcpedc.posicao
chargingIdpcpedc.codcob
TotalPricepcpedc.vltotal
paymentPlanIdpcpedc.codplpag
saleTypepcpedc.condvenda
branchIdpcpedc.codfilial
saleOriginpcpedc.origemped
productSKUERPReferenceKey
pcpedi.codprod
sellPrice
pcpedi.pvenda
quantity
pcpedi.qt
realCost
pcpedi.vlcustoreal
warehouseBranchId
pcpedi.codfilialretira
position
pcpedi.numseq
taxFigureId
pcpedi.codst
valueFreightpcpedc.vlfrete
intermediaryCompanyNamepcpedc.descintermediador
idIntermediaryEmployerpcpedc.cnpjintermediador
carrierIdpcpedc.codfornecfrete
lastChangepcpedc.dtfat (prioridade 1)
lastChangepcpedc.data (prioridade 2)
orderIdHubepcpedc.numpedhube
orderIdMktplacepcpedc.numpedmktplace
saleOriginpcpedc.origemped
freightDispatchpcpedc.fretedespacho
uniqueSequentialNumberpcpedc.nsu
dateUniqueSequentialNumberpcpedc.dtnsu
Totvs custom tabs box items
defaultno
referenciapasso2

Exemplo do envio da requisição:

Bloco de código
languagejs
titleURI
method: 'POST',
url: '/api/wholesale/v1/orders/'
Bloco de código
languagejs
titleBody Request
{
    "createData": "2020-03-23T13:24:36.955102+13:24",
     "orderIdHube": "string",
    "orderIdMktplace": "string",
    "orderStatus": "string",
    "chargingId": "string",
    "DiscountValue": 0.0,
    "carrierId": 0,
    "paymentPlanId": 0,
    "saleType": 0,
    "branchId": "string",
    "saleOrigin": "W",
    "uniqueSequentialNumber": "string",
    "dateUniqueSequentialNumber": "string",
    "intermediaryCompanyName": "string",
    "idIntermediaryEmployer": "string",
    "valueFreight": 0,
    "otherExpenses": 0
    "customer": {
        "id": 0
    },
	"permissions": {
        "acceptOrderWithoutTax": true
    },
    "listOfOrderItem": [
        {
            "productSKUERPReferenceKey": "string",
            "sellPrice":0,
            "quantity": 0.0,
            "realCost": 0.0,
            "warehouseBranchId": "string",
            "gift": true,
            "giftPrice": 0,
            "taxFigureId": 0
        }
    ]
}
Bloco de código
languagejs
titleBody Response
{
    "branchId": "string",
    "carrierId": 0,
    "chargingId": "string",
    "createData": "2021-08-06T15:40:00.000000+15:40",
    "customer": {
        "activityId": 0,
        "addressInfo": "",
        "billingAddress": "",
        "billingZipCode": "",
        "businessDistrict": "",
        "cityId": 0,
        "commercialAddress": "",
        "commercialZipCode": "",
        "corporate": false,
        "corporatePhone": "",
        "countryId": 0,
        "email": "",
        "finalCostumer": false,
        "id": 0,
        "paymentPlanId": 0,
        "sellerId": 0,
        "squareId": 0,
        "stateInscription": "",
        "tradeName": ""
    },
    "lastChange": "2021-08-06T15:40:00",
    "listOfOrderItem": [
        {
            "accountingCost": 0.0,
            "basePriceRCA": 0.0,
            "comissionPercent": 0,
            "fecp": 0,
            "financialCost": 0.0,
            "gift": false,
            "giftPrice": 0,
            "packingId": 0,
            "position": 0,
            "productId": 0,
            "productSKUERPReferenceKey": "00000-00",
            "quantity": 0.0,
            "realCost": 0.0,
            "replacementCost": 0.0,
            "resourceValueCMV": 0,
            "resourceValueCustumerCMV": 0,
            "sellPrice": 0.0,
            "sellPriceBaseST": 0,
            "sellPriceIPI": 0,
            "sellPriceST": 0,
            "stGNRE": 0,
            "tablePrice": 0.0,
            "tablePriceIPI": 0,
            "tablePriceST": 0,
            "taxFigureId": 0,
            "truncItem": false,
            "wantageQuantity": 0,
            "warehouseBranchId": "string"
        }
    ],
	"permissions": {
        "acceptOrderWithoutTax": true
    },
    "orderId": "string",
    "orderIdHube": "string",
	"orderIdMktplace: "string",
    "orderStatus": "string",
    "otherExpenses": 0,
    "paymentPlanId": 0,
    "saleOrigin": "W",
    "saleType": 0,
    "saleTypePayment": "string",
    "totalValue": "0.0"
}
Totvs custom tabs box items
defaultno
referenciapasso3

As consultas referente aos pedido, apresentam o JSON na resposta da requisição:  

Bloco de código
languagejs
titleURI
method: 'GET',
url: '/api/wholesale/v1/orders/'      -> Passar no Parms o campo orderId, para obter dados do pedido.

OU 

url: '/api/wholesale/v1/orders/list'  -> Passar na requisição os dados do Parms abaixo.
Bloco de código
languagejs
titleParams
branchId          : 0					- Código da Filial **requerido
daysOfSearch      : 0					- Dias de Pesquisa
orderId		      : 0					- Número Pedido
lastChange        : 2021-03-02T16:43:00	- Última alteração
viewDocument  	  : true/ false			- Dados da nota fiscal 
saleOrigin   	  : T					- Origem Venda (Todas existentes no 
order		 	  : lastChange			- Ordenação de busca 
orderStatus  	  : C					- Status do Pedido
page		 	  : 1					- Número Página
pageSize     	  : 10					- Tamanho da página
hasPedidoMktplace : true/ false			- Retorna apenas produtos que contenham id de Marketplace

Bloco de código
languagejs
titleBody Response
{
    "branchId": "string",
    "carrierId": 0,
    "chargingId": "string",
    "createData": "2021-08-06T15:40:00.000000+15:40",
    "customer": {
        "activityId": 0,
        "addressInfo": "",
        "billingAddress": "",
        "billingZipCode": "",
        "businessDistrict": "",
        "cityId": 0,
        "commercialAddress": "",
        "commercialZipCode": "",
        "corporate": false,
        "corporatePhone": "",
        "countryId": 0,
        "email": "",
        "finalCostumer": false,
        "id": 0,
        "paymentPlanId": 0,
        "sellerId": 0,
        "squareId": 0,
        "stateInscription": "",
        "tradeName": ""
    },
    "document": {
        "createData": "1900-01-01T00:00:00",
        "documentNumber": 0,
        "keyDocument": "",
        "lastChange": "1900-01-01T00:00:00"
    },
    "lastChange": "2021-08-06T15:40:00",
    "listOfOrderItem": [
        {
            "accountingCost": 0.0,
            "basePriceRCA": 0.0,
            "comissionPercent": 0,
            "fecp": 0,
            "financialCost": 0.0,
            "gift": false,
            "giftPrice": 0,
            "packingId": 0,
            "position": 0,
            "productId": 0,
            "productSKUERPReferenceKey": "00000-00",
            "quantity": 0.0,
            "realCost": 0.0,
            "replacementCost": 0.0,
            "resourceValueCMV": 0,
            "resourceValueCustumerCMV": 0,
            "sellPrice": 0.0,
            "sellPriceBaseST": 0,
            "sellPriceIPI": 0,
            "sellPriceST": 0,
            "stGNRE": 0,
            "tablePrice": 0.0,
            "tablePriceIPI": 0,
            "tablePriceST": 0,
            "taxFigureId": 0,
            "truncItem": false,
            "wantageQuantity": 0,
            "warehouseBranchId": "string"
        }
    ],
	"permissions": {
        "acceptOrderWithoutTax": true
    },
    "orderId": "string",
    "orderIdHube": "string",
	"orderIdMktplace: "string",
    "orderStatus": "string",
    "otherExpenses": 0,
    "paymentPlanId": 0,
    "saleOrigin": "W",
    "saleType": 0,
    "saleTypePayment": "string",
    "totalValue": "0.0"
}