Objetivo

Este documento tem como objetivo explicar o funcionamento da integração do Pedido de Venda.

Pré-Requisitos e Restrições


 Integração


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

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

Exemplo do envio da requisição:

method: 'POST',
url: '/api/wholesale/v1/orders/'
{
    "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
        }
    ]
}
{
    "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"
}

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

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.
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

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