-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathLandedCost.json
More file actions
702 lines (701 loc) · 26.6 KB
/
LandedCost.json
File metadata and controls
702 lines (701 loc) · 26.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
{
"openapi": "3.0.3",
"info": {
"title": "Landed Cost ",
"termsOfService": "https://www.ups.com/upsdeveloperkit/assets/html/serviceAgreement.html",
"version": ""
},
"servers": [
{
"url": "https://wwwcie.ups.com/api/",
"description": "Customer Integration Environment"
},
{
"url": "https://onlinetools.ups.com/api/",
"description": "Production"
}
],
"tags": [
{
"name": "LandedCost_other",
"x-displayName": "Methods",
"description": "Landed Cost provides an all-inclusive cost estimate of international shipments. <br /><a href=\"https://developer.ups.com/api/reference/landedcostquoting/business-rules\" target=\"_blank\">Business Rules</a><br /><a href=\"https://developer.ups.com/api/reference/landedcostquoting/appendix\" target=\"_blank\">Appendix</a><br /><a href=\"https://developer.ups.com/api/reference/landedcostquoting/errors\" target=\"_blank\">Errors</a><br /><a href=\"https://github.com/UPS-API\" target=\"_blank\">GitHub - view sample integration code</a>"
}
],
"paths": {
"/landedcost/{version}/quotes": {
"post": {
"summary": "Landed Cost",
"description": "Landed Cost provides an all-inclusive cost estimate of international shipments.",
"operationId": "LandedCost",
"parameters": [
{
"in": "header",
"name": "transId",
"schema": {
"type": "string"
},
"description": "An identifier unique to the request. Length 32",
"required": true
},
{
"in": "header",
"name": "transactionSrc",
"schema": {
"type": "string",
"default": "testing"
},
"description": "An identifier of the client/source application that is making the request.Length 512",
"required": true
},
{
"in": "path",
"name": "version",
"schema": {
"type": "string",
"default": "v1"
},
"description": "Version of API",
"required": true
},
{
"in": "header",
"name": "AccountNumber",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "Generate sample code for popular API requests by selecting an example below. To view a full sample request and response, first click \"Authorize\" and enter your application credentials, then populate the required parameters above and click \"Try it out\".",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LandedCostRequest"
},
"examples": {
"json": {
"summary": "A sample JSON request (Standard Example)",
"value": {
"currencyCode": "GBP",
"transID": "325467165",
"allowPartialLandedCostResult": false,
"shipment": {
"id": "ShipmentID83",
"importCountryCode": "GB",
"importProvince": "",
"shipDate": "",
"exportCountryCode": "US",
"incoterms": "",
"shipmentItems": [
{
"commodityId": "1",
"grossWeight": "",
"grossWeightUnit": "",
"priceEach": "125",
"hsCode": "400932",
"quantity": 24,
"UOM": "Each",
"originCountryCode": "GB",
"commodityCurrencyCode": "GBP",
"description": ""
},
{
"commodityId": "4",
"grossWeight": "",
"grossWeightUnit": "",
"priceEach": "0.5",
"hsCode": "",
"quantity": 900,
"UOM": "Each",
"originCountryCode": "GB",
"commodityCurrencyCode": "GBP",
"description": "Cord5mm{PK50Yellow/Red"
}
],
"transModes": "",
"transportCost": "",
"shipmentType": "Sale"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LandedCostResponse"
},
"examples": {
"json": {
"summary": "A sample JSON response",
"value": {
"shipment": {
"currencyCode": "GBP",
"id": "ShipmentID83",
"brokerageFeeItems": [
{
"chargeName": "DisbursementFee",
"chargeAmount": 19.05
},
{
"chargeName": "EntryPreparationFee",
"chargeAmount": 5.6
}
],
"totalBrokerageFees": 24.65,
"totalDuties": 60,
"totalCommodityLevelTaxesAndFees": 0,
"totalShipmentLevelTaxesAndFees": 0,
"totalVAT": 702,
"totalDutyandTax": 762,
"grandTotal": 786.65,
"importCountryCode": "GB",
"shipmentItems": [
{
"commodityId": "1",
"commodityDuty": 60,
"totalCommodityTaxesAndFees": 0,
"commodityVAT": 612,
"totalCommodityDutyandTax": 672,
"commodityCurrencyCode": "GBP",
"isCalculable": true,
"hsCode": "4009320090"
},
{
"commodityId": "4",
"commodityDuty": 0,
"totalCommodityTaxesAndFees": 0,
"commodityVAT": 90,
"totalCommodityDutyandTax": 90,
"commodityCurrencyCode": "GBP",
"isCalculable": true,
"hsCode": "8546901000"
}
]
},
"alversion": 0,
"dpversion": null,
"transID": "325467165",
"error": null,
"perfStats": {
"absLayerTime": "139",
"fulfillTime": "ThuFeb027:56:53.231-05:002023",
"receiptTime": "ThuFeb027:56:53.091-05:002023"
}
}
}
}
}
}
},
"401": {
"description": "Unauthorized Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
}
}
}
},
"security": [
{
"oauth2": []
}
],
"components": {
"securitySchemes": {
"oauth2": {
"type": "oauth2",
"description": "Find your Client ID and Secret on your app info page. <br/> 1. Select \\\"Try It\\\" <br/> 2. In the Security section enter your Client ID and Secret.<br/> 3. Select \\\"Request Token\\\"<br/> 4. Enter any additional information in the Body and Parameters sections.<br/> 5. Select \\\"Send\\\" to execute your API request",
"flows": {
"clientCredentials": {
"x-tokenEndpointAuthMethod": "client_secret_basic",
"tokenUrl": "https://wwwcie.ups.com/security/v1/oauth/token",
"scopes": {}
}
}
}
},
"schemas": {
"LandedCostRequest": {
"type": "object",
"required": [
"currencyCode",
"transID",
"alversion",
"shipment"
],
"properties": {
"currencyCode": {
"type": "string",
"maximum": 1,
"maxLength": 3,
"description": "Specifies the currency of transaction or purchase.",
"example": "USD, CAD, EUR"
},
"transID": {
"type": "string",
"maximum": 1,
"maxLength": 50,
"description": "Unique transaction ID for the request.",
"example": "LCUAT20220208053048_197985278292494"
},
"allowPartialLandedCostResult": {
"type": "boolean",
"maximum": 1,
"description": "This is the optional flag to indicate that partial landed cost calculations are acceptable to be used by upstream systems. When set to �false�, the system will return an error when at least one commodity in the shipment is invalid (all or none); no results will be sent back for that request. When set to �true�, the system will return partial calculations when applicable Valid values: true = Partial Landed Cost result will return false = All or No result will return - (default)"
},
"alversion": {
"type": "integer",
"maximum": 1,
"description": "Version number of the instance that processed this request. This must match the major number of the corresponding ICD version.",
"example": "1, 2, 3"
},
"shipment": {
"$ref": "#/components/schemas/LandedCostRequest_Shipment"
}
},
"xml": {
"name": "LandedCostRequest"
},
"maximum": 1,
"description": "The root element for the Landed Cost document."
},
"LandedCostRequest_Shipment": {
"type": "object",
"maximum": 1,
"description": "Every Landed Cost request must be based on a shipment.",
"required": [
"id",
"importCountryCode",
"exportCountryCode",
"shipmentItems"
],
"properties": {
"id": {
"maximum": 1,
"maxLength": 100,
"type": "string",
"description": "Specifies the Shipment ID in the Landed Cost quote. It is an arbitrary string provided by the user of the API that will be returned with the Landed Cost Quote to indicate which shipment tariffs apply to. There are similar IDs associated with the Product and Order objects."
},
"importCountryCode": {
"maximum": 1,
"maxLength": 2,
"type": "string",
"description": "Specifies the Import/Ship To/Destination/Final country of the shipment. Check Country List in the Appendix.",
"example": "US, MX, CA"
},
"importProvince": {
"maximum": 1,
"type": "string",
"maxLength": 100,
"description": "Province/State is only supported for a few countries such as Mexico, Canada, etc. Check Province List in the Appendix",
"example": "Alberta, Ontario, North Frontier Zone"
},
"shipDate": {
"type": "string",
"maximum": 1,
"maxLength": 10,
"description": "Default by current date if not provided. Valid date in YYYY-MM-DD format.",
"example": "2022-02-28"
},
"incoterms": {
"type": "string",
"maximum": 1,
"maxLength": 3,
"description": "Supported Incoterm Values: 1. CFR Cost & Freight 2. CIF Cost, Insurance & Freight 3. CIP Carriage and Insurance Paid To 4. CPT Carriage Paid To 5. DAP Delivered At Place 6. DAT Delivered At Terminal 7. DDP Delivered Duty Paid 8. DPU Delivered at Place Unloaded 9. EXW Ex Works 10. FAS Free Alongside Ship 11. FCA Free Carrier 12. FOB Free On Board (Default)",
"default": "FOB",
"example": "FOB, CFR"
},
"exportCountryCode": {
"type": "string",
"maximum": 1,
"maxLength": 2,
"description": "Specifies the export/ship from/origin country of the shipment. Check Country List in the Appendix section. Note: Export country code must be different from Import country code",
"example": "DE, CN, JP"
},
"transModes": {
"type": "string",
"maximum": 1,
"maxLength": 9,
"description": "The modes of transportation. [Upper case alphabet]. Supported Values: 1. INT_AIR 2. INT_OCEAN 3. INT_RAIL 4. INT_TRUCK 5. DOM_AIR 6. DOM_OCEAN 7. DOM_RAIL 8. DOM_TRUCK Default value will be varied and based on import country."
},
"transportCost": {
"maximum": 1,
"type": "number",
"description": "Specifies the Freight charge or transport costs, which are used for tariff calculations. Landed cost result might have some dependency on the freight charges in some countries. Therefore, freight amount should be always provided for accurate Landed Cost result. Allowed value: 1. Any non-negative floating-point number. 2. Numeric value with optional decimal value.",
"example": 100.6
},
"shipmentType": {
"type": "string",
"maximum": 1,
"maxLength": 35,
"description": "Specifies the shipment type such as Gift, Document, Commercial (Sale), etc. Supported Shipment Type: 1. GIFT 2. COMMERCIAL 3. SALE 4. SAMPLE 5. REPAIR 6. RETURN 7. OTHER Default value will be varied and based on import country"
},
"shipmentItems": {
"type": "array",
"maximum": 99,
"items": {
"$ref": "#/components/schemas/Request_ShipmentItems"
},
"description": "Array of shipment item (commodity) objects that are in a shipment."
}
}
},
"Request_ShipmentItems": {
"type": "object",
"required": [
"commodityId",
"priceEach",
"commodityCurrencyCode",
"quantity",
"UOM",
"originCountryCode"
],
"properties": {
"commodityId": {
"type": "string",
"maximum": 1,
"maxLength": 100,
"description": "Commodity ID is used to associate tariffs with product in the output. Should be unique for each commodity in a request. It is an arbitrary string provided by the user of the API that will be returned with the Landed Cost Quote to indicate which commodity tariffs apply to."
},
"grossWeight": {
"type": "number",
"maximum": 1,
"description": "Specifies the gross weight of the commodity as any non-negative value.",
"example": 10.34
},
"grossWeightUnit": {
"type": "string",
"maximum": 1,
"maxLength": 2,
"description": "Specifies the units of the gross weight. Required if GrossWeight is used. If GrossWeight is not specified, this value must not be set to anything but null. Supported values: LB, KG",
"example": "KG"
},
"priceEach": {
"type": "number",
"maximum": 1,
"description": "Specifies the price for each commodity unit in the settlement currency. The total price of the entire number of shipmentItems may not exceed 999999999999.99",
"example": 346.32
},
"commodityCurrencyCode": {
"type": "string",
"maximum": 1,
"maxLength": 3,
"description": "Specifies the Currency Code used for commodity price. All commodities must have the same currency code.",
"example": "USD, CAD, EUR"
},
"quantity": {
"type": "integer",
"maximum": 1,
"description": "Specifies the number of product units to be shipped. The total price of the entire number of shipmentItems may not exceed 999999999999.99, 1 or greater than 1"
},
"UOM": {
"type": "string",
"maximum": 1,
"description": "Specify unit of measure. Check UOM List in the Appendices section",
"example": "KILOGRAM, BAG"
},
"hsCode": {
"type": "string",
"maximum": 1,
"maxLength": 40,
"description": "Specifies a valid HS or HTS code for the shipment�s destination or import country. This field is required if description is not provided. Valid HTS Code with or without periods",
"example": "0901.90.00.10"
},
"description": {
"type": "string",
"maximum": 1,
"maxLength": 150,
"description": "This field is populated with description of the commodity. This field is required if hsCode is not provided."
},
"originCountryCode": {
"type": "string",
"maximum": 1,
"maxLength": 2,
"description": "Country of Manufacture or origin.",
"example": "US, CA, JP, MX"
}
}
},
"LandedCostResponse": {
"type": "object",
"required": [
"shipment",
"alVersion",
"perfStats",
"transID"
],
"properties": {
"shipment": {
"type": "object",
"required": [
"currencyCode",
"importCountryCode",
"id",
"brokerageFeeItems",
"totalBrokerageFees",
"totalDuties",
"totalCommodityLevelTaxesAndFees",
"totalShipmentLevelTaxesAndFees",
"totalVAT",
"totalDutyAndTax",
"grandTotal",
"shipmentItems"
],
"description": "Every Landed Cost response must be based on a shipment.",
"properties": {
"currencyCode": {
"type": "string",
"maximum": 1,
"maxLength": 3,
"description": "Specifies the Currency Code set at the commodity level. This currency is applicable for all duty, tax, VAT, and fee at the shipment and commodity level.",
"example": "USD, CAD, EUR"
},
"importCountryCode": {
"type": "string",
"maximum": 1,
"maxLength": 2,
"description": "Specifies the Import/Ship To/Destination/Final country of the shipment. Check Country List in the Appendices section.",
"example": "US, CA, MX"
},
"id": {
"type": "string",
"maximum": 1,
"maxLength": 100,
"description": "Specifies the Shipment ID in the Landed Cost quote"
},
"brokerageFeeItems": {
"type": "array",
"maximum": 1,
"items": {
"$ref": "#/components/schemas/brokerageFeeItems"
},
"description": "An Array of Brokerage fee"
},
"totalBrokerageFees": {
"type": "number",
"maximum": 1,
"description": "Grand Total of all applicable Brokerage Fees"
},
"totalDuties": {
"type": "number",
"maximum": 1,
"description": "Total duty amount of this shipment"
},
"totalCommodityLevelTaxesAndFees": {
"type": "number",
"maximum": 1,
"description": "Total tax and other fees at commodity level"
},
"totalShipmentLevelTaxesAndFees": {
"type": "number",
"maximum": 1,
"description": "Total tax and other fees at shipment level"
},
"totalVAT": {
"type": "number",
"maximum": 1,
"description": "Total VAT of this shipment"
},
"totalDutyAndTax": {
"type": "number",
"maximum": 1,
"description": "Grand Total combined duty, VAT, tax, and other fees of all commodities of this shipment including shipment level taxes and fee"
},
"grandTotal": {
"type": "number",
"maximum": 1,
"description": "(TotalDutyAndTax+ totalBrokerageFees)"
},
"shipmentItems": {
"oneOf": [
{
"items": {
"$ref": "#/components/schemas/Response_ShipmentItems"
},
"type": "array",
"maximum": 99
},
{
"$ref": "#/components/schemas/Response_ShipmentItems"
}
],
"description": "An Array or List of Landed Cost result for all valid commodities"
},
"transID": {
"type": "string",
"maxLength": 50,
"description": "An identifier unique to the request"
},
"perfStats": {
"type": "object",
"maximum": 1,
"required": [
"absLayerTime",
"fulfillTime",
"receiptTime"
],
"description": "See ALPerfStats",
"properties": {
"absLayerTime": {
"type": "string",
"maximum": 1,
"maxLength": 20,
"description": "Time taken through the abstraction layer in milliseconds"
},
"fulfillTime": {
"type": "string",
"maximum": 1,
"maxLength": 32,
"description": "Request completed time"
},
"receiptTime": {
"type": "string",
"maximum": 1,
"maxLength": 32,
"description": "Request receipt time"
}
}
},
"alVersion": {
"type": "integer",
"maximum": 1,
"maxLength": 10,
"description": "Version number of the instance that processed this request. Default by 1"
},
"errors": {
"$ref": "#/components/schemas/Errors"
}
}
}
},
"xml": {
"name": "LandedCostResponse"
},
"maximum": 1
},
"brokerageFeeItems": {
"properties": {
"chargeName": {
"type": "string",
"maximum": 1,
"maxLength": 50,
"description": "Brokerage Charge name this shipment. Possible Values: 1. Entry Preparation Fee 2. Disbursement Fee 3. Additional Line Fee"
},
"chargeAmount": {
"type": "number",
"maximum": 1,
"description": "Fee amount for the brokerage charges",
"example": 10.56
}
}
},
"Response_ShipmentItems": {
"required": [
"commodityID",
"hsCode",
"commodityDuty",
"commodityVAT",
"totalCommodityDutyAndTax",
"commodityCurrencyCode",
"isCalculable"
],
"properties": {
"commodityID": {
"type": "string",
"maximum": 1,
"description": "Specifies Commodity Id"
},
"hsCode": {
"type": "string",
"maxLength": 40,
"maximum": 1,
"description": "Specifies the HTS code of the commodity"
},
"commodityDuty": {
"type": "number",
"maximum": 1,
"description": "Duty amount of this commodity"
},
"totalCommodityTaxAndFee": {
"type": "number",
"maximum": 1,
"description": "Total tax and other fees of this commodity (excluding Duty and VAT)"
},
"commodityVAT": {
"type": "number",
"maximum": 1,
"description": "VAT amount of this commodity"
},
"totalCommodityDutyAndTax": {
"type": "number",
"maximum": 1,
"description": "Total combined duty, VAT, tax and other fees of this commodity"
},
"commodityCurrencyCode": {
"type": "string",
"maximum": 1,
"maxLength": 3,
"description": "Specifies the Currency Code used for commodity price"
},
"isCalculable": {
"type": "boolean",
"maximum": 1,
"description": "True/False. Indicator for successful Landed Cost calculation for this commodity",
"example": "true, false"
}
}
},
"Errors": {
"type": "object",
"maximum": 99,
"description": "Error code and description",
"properties": {
"code": {
"type": "string",
"maximum": 1,
"maxLength": 20,
"description": "Error Code"
},
"description": {
"type": "string",
"maximum": 1,
"maxLength": 128,
"description": "Description of the error"
},
"message": {
"type": "string",
"maximum": 1,
"maxLength": 128,
"description": "Consumer tailored error message"
},
"value": {
"type": "string",
"maximum": 1,
"maxLength": 128,
"description": "The value that caused the error."
},
"field": {
"type": "string",
"maximum": 1,
"maxLength": 256,
"description": "The path to the field causing the error as returned from the backend services"
}
}
}
}
}
}