Pedido Multi Origem
Neste ponto vamos entender qual o fluxo a ser seguido nos pedidos multi CD.
No caso de pedidos onde a conta possua estoque multi CD (warehouses diferentes), ao consumi-los na fila de integração de pedidos (queues), será possível identificar de qual CD (warehouse) o pedido deve ser despachado.
O CD (warehouse) onde o pedido foi gerado, é possível identificar através do campo "remote_store_id" dentro de "items", conforme exemplo abaixo:
1
"items": [{
2
"special_price": 799.0,
3
"shipping_cost": 14.99,
4
"remote_store_id": "L052",
5
"qty": 1,
6
"product_id": "4282443",
7
"original_price": 799.0,
8
"name": "LG K12+ 32GB AZUL",
9
"id": "4282443",
10
"gift_wrap": null,
11
"detail": null
12
}
Copied!
Onde "remote_store_id" será informando o CD (Warehouse) de despacho do pedido.
Segue a baixo um JSON de exemplo, do consumo na queues:
1
{
2
"placed_at": "2019-10-16T14:50:54-03:00",
3
"calculation_type": "spreadsheet",
4
"seller_shipping_cost": 0,
5
"status": {
6
"type": "DELIVERED",
7
"label": "Completo (entregue) (SkyHub)",
8
"code": "complete"
9
},
10
"shipping_estimate_id": "4ffd38ed65ac40c883ea0c327acdf221",
11
"shipped_date": "2019-10-16T20:50:32.484000",
12
"tags": [],
13
"payments": [
14
{
15
"value": 813.99,
16
"transaction_date": "2019-10-16T16:48:00-03:00",
17
"status": null,
18
"sefaz": {
19
"type_integration": "1",
20
"payment_indicator": "1",
21
"name_payment": "Cartão de Crédito",
22
"name_card_issuer": "Mastercard",
23
"id_payment": "3",
24
"id_card_issuer": "02"
25
},
26
"parcels": 12,
27
"method": "CREDIT_CARD",
28
"description": "No valor de: 813.99",
29
"card_issuer": "00558456000171",
30
"autorization_id": "016304"
31
}
32
],
33
"import_info": {
34
"ss_name": "Lojas Americanas",
35
"remote_id": "02-111111111",
36
"remote_code": "111111111111"
37
},
38
"shipping_cost": 14.99,
39
"estimated_delivery_shift": null,
40
"billing_address": {
41
"street": "Rua Nossa Senhora",
42
"secondary_phone": "71 000000000",
43
"region": "BA",
44
"reference": "Em frente a Pitta Segurança",
45
"postcode": "40290250",
46
"phone": "71 00000000",
47
"number": "05",
48
"neighborhood": "Acupe de Brotas",
49
"full_name": "JACIARA",
50
"detail": "Em frente a Pitta Segurança",
51
"country": "BR",
52
"complement": null,
53
"city": "Salvador"
54
},
55
"shipping_method": null,
56
"discount": 0,
57
"customer": {
58
"vat_number": "76860543817",
59
"phones": [
60
"71 0000000",
61
"71 00000000"
62
],
63
"name": "JACIARA",
64
"gender": "",
65
"email": "[email protected]",
66
"date_of_birth": "1979-04-26"
67
},
68
"total_ordered": 813.99,
69
"shipping_address": {
70
"street": "RUA Nossa Senhora",
71
"secondary_phone": "71 00000000",
72
"region": "BA",
73
"reference": "Em frente a Pitta Segurança",
74
"postcode": "40290250",
75
"phone": "71 0000000",
76
"number": "05",
77
"neighborhood": "Acupe de Brotas",
78
"full_name": "JACIARA",
79
"detail": "Em frente a Pitta Segurança",
80
"country": "BR",
81
"complement": null,
82
"city": "Salvador"
83
},
84
"exported_at": "2019-10-16T18:45:57-03:00",
85
"updated_at": "2019-10-16T17:46:17-03:00",
86
"sync_status": "SYNCED",
87
"delivered_date": "2019-10-16T18:39:55-03:00",
88
"items": [
89
{
90
"special_price": 799,
91
"shipping_cost": 14.99,
92
"remote_store_id": "L052",
93
"qty": 1,
94
"product_id": "4282443",
95
"original_price": 799,
96
"name": "LG K12+ 32GB AZUL",
97
"id": "4282443",
98
"gift_wrap": null,
99
"detail": null
100
}
101
],
102
"approved_date": "2019-10-16T19:55:27.021000",
103
"channel": "Lojas Americanas",
104
"pick_ups": [
105
{
106
"store_code": "L052",
107
"items": [
108
{
109
"qty": 1,
110
"product_id": "4282443",
111
"id": "4282443"
112
}
113
],
114
"agent": {
115
"vat_number": null,
116
"name": null
117
}
118
}
119
],
120
"invoices": [
121
{
122
"volume_qty": null,
123
"number": "000032613",
124
"line": "001",
125
"key": "12345678901234567890123456789012345678901234",
126
"issue_date": "2019-10-22T11:39:23-03:00"
127
}
128
],
129
"code": "Lojas Americanas-111111111111",
130
"interest": 0,
131
"delivery_contract_type": "SHIPSTORE",
132
"estimated_delivery": "2019-10-16T00:00:00-03:00",
133
"shipping_carrier": "",
134
"shipments": [
135
{
136
"tracks": [
137
{
138
"url": null,
139
"method": null,
140
"code": "T3JkZXJOb2RlOjE3NjkyOTYy",
141
"carrier": "SPREADSHEET"
142
}
143
],
144
"items": [
145
{
146
"sku": "4282443",
147
"qty": 1
148
}
149
],
150
"code": "Lojas Americanas-111111111111"
151
}
152
],
153
"imported_at": "2019-10-16T14:55:13-03:00"
154
}
Copied!
Last modified 1mo ago
Copy link