@shipengine/connect-fulfillment-provider-api 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/app/fulfillment-provider-app-definition.d.ts +3 -3
  2. package/lib/app/fulfillment-provider-app.js +2 -2
  3. package/lib/app/fulfillment-provider-app.js.map +1 -1
  4. package/lib/models/index.d.ts +1 -1
  5. package/lib/models/index.js +1 -1
  6. package/lib/models/index.js.map +1 -1
  7. package/lib/models/sales-order-fulfillments.d.ts +19 -0
  8. package/lib/{requests/get-fulfillment-request.js → models/sales-order-fulfillments.js} +1 -1
  9. package/lib/models/sales-order-fulfillments.js.map +1 -0
  10. package/lib/requests/{get-fulfillment-request.d.ts → get-fulfillments-request.d.ts} +1 -1
  11. package/lib/{responses/get-fulfillment-response.js → requests/get-fulfillments-request.js} +1 -1
  12. package/lib/requests/get-fulfillments-request.js.map +1 -0
  13. package/lib/requests/index.d.ts +1 -1
  14. package/lib/requests/index.js +1 -1
  15. package/lib/requests/index.js.map +1 -1
  16. package/lib/responses/get-fulfillments-response.d.ts +7 -0
  17. package/lib/{models/sales-order-status-change.js → responses/get-fulfillments-response.js} +1 -1
  18. package/lib/responses/get-fulfillments-response.js.map +1 -0
  19. package/lib/responses/get-recent-changes-response.d.ts +2 -2
  20. package/lib/responses/index.d.ts +1 -1
  21. package/lib/responses/index.js +1 -1
  22. package/lib/responses/index.js.map +1 -1
  23. package/package.json +1 -1
  24. package/spec.json +2806 -2659
  25. package/spec.yaml +182 -77
  26. package/tsconfig.tsbuildinfo +1 -1
  27. package/lib/models/sales-order-status-change.d.ts +0 -22
  28. package/lib/models/sales-order-status-change.js.map +0 -1
  29. package/lib/requests/get-fulfillment-request.js.map +0 -1
  30. package/lib/responses/get-fulfillment-response.d.ts +0 -8
  31. package/lib/responses/get-fulfillment-response.js.map +0 -1
package/spec.yaml CHANGED
@@ -32,6 +32,7 @@ paths:
32
32
  auth:
33
33
  $ref: '#/components/schemas/Auth'
34
34
  description: Contains form data for connecting to the app
35
+ description: Verify credentials are valid for a new connection to a fulfillment provider
35
36
  /delegate_fulfillment:
36
37
  post:
37
38
  summary: Delegate Fulfillment
@@ -46,7 +47,7 @@ paths:
46
47
  properties:
47
48
  fulfillment_provider_order_id:
48
49
  type: string
49
- description: ''
50
+ description: Delegate a sales order to a fulfillment provider. The fulfillment provider will attempt to fulfill the shipment of all line items. Returns the identifier used by the fulfillment provider for subsequent status updates for the order and it's fulfillments. Often this is the same as the order_id.
50
51
  requestBody:
51
52
  content:
52
53
  application/json:
@@ -305,9 +306,9 @@ paths:
305
306
  in: header
306
307
  name: tenant-id
307
308
  parameters: []
308
- /get_fulfillment:
309
+ /get_fulfillments:
309
310
  post:
310
- summary: Get Fulfillment
311
+ summary: Get Fulfillments
311
312
  operationId: post-fulfillment-status
312
313
  responses:
313
314
  '200':
@@ -317,18 +318,121 @@ paths:
317
318
  schema:
318
319
  type: object
319
320
  properties:
320
- fulfillment:
321
- $ref: '#/components/schemas/SalesOrderStatusChange'
321
+ fulfillment_provider_order_id:
322
+ type: string
323
+ status:
324
+ type: string
325
+ fulfillments:
326
+ type: array
327
+ items:
328
+ $ref: '#/components/schemas/SalesOrderFulfillment'
329
+ shipments:
330
+ type: array
331
+ items:
332
+ $ref: '#/components/schemas/ShipmentNotification'
322
333
  polling:
323
334
  type: object
324
335
  properties:
325
336
  is_final_update_state:
326
337
  type: boolean
327
- enum:
328
- - once
329
- - changes_since
330
338
  max_age_seconds:
331
339
  type: number
340
+ required:
341
+ - fulfillment_provider_order_id
342
+ examples:
343
+ example-1:
344
+ value:
345
+ fulfillment_provider_order_id: string
346
+ status: string
347
+ fulfillments:
348
+ - status: Processing
349
+ reason: string
350
+ explanation: string
351
+ line_items:
352
+ - line_item_id: string
353
+ sku: string
354
+ quantity: 0
355
+ shipments:
356
+ - carrier_code: string
357
+ carrier_service_code: string
358
+ currency: 'USD,EUR,NZD'
359
+ ext_location_id: string
360
+ fulfillment_cost: 0
361
+ insurance_cost: 0
362
+ integration_context: {}
363
+ items:
364
+ - description: string
365
+ line_item_id: string
366
+ product_id: string
367
+ quantity: 0
368
+ sku: string
369
+ notes:
370
+ - text: string
371
+ type: BackOrderMessage
372
+ notification_id: string
373
+ notify_buyer: true
374
+ order_id: string
375
+ order_number: string
376
+ return_address:
377
+ address_line_1: string
378
+ address_line_2: string
379
+ address_line_3: string
380
+ city: string
381
+ company: string
382
+ country_code: 'US,MX,CA'
383
+ is_verified: true
384
+ name: string
385
+ first_name: string
386
+ last_name: string
387
+ phone: string
388
+ pickup_location:
389
+ carrier_id: string
390
+ relay_id: string
391
+ postal_code: string
392
+ residential_indicator: R
393
+ state_province: string
394
+ ship_date: '2021-03-31T18:21:14.858Z'
395
+ ship_from:
396
+ address_line_1: string
397
+ address_line_2: string
398
+ address_line_3: string
399
+ city: string
400
+ company: string
401
+ country_code: 'US,MX,CA'
402
+ is_verified: true
403
+ name: string
404
+ first_name: string
405
+ last_name: string
406
+ phone: string
407
+ pickup_location:
408
+ carrier_id: string
409
+ relay_id: string
410
+ postal_code: string
411
+ residential_indicator: R
412
+ state_province: string
413
+ ship_to:
414
+ address_line_1: string
415
+ address_line_2: string
416
+ address_line_3: string
417
+ city: string
418
+ company: string
419
+ country_code: 'US,MX,CA'
420
+ is_verified: true
421
+ name: string
422
+ first_name: string
423
+ last_name: string
424
+ phone: string
425
+ pickup_location:
426
+ carrier_id: string
427
+ relay_id: string
428
+ postal_code: string
429
+ residential_indicator: R
430
+ state_province: string
431
+ tracking_number: string
432
+ tracking_url: string
433
+ polling:
434
+ is_final_update_state: true
435
+ max_age_seconds: 0
332
436
  requestBody:
333
437
  content:
334
438
  application/json:
@@ -343,25 +447,13 @@ paths:
343
447
  - auth
344
448
  - fulfillment_provider_order_id
345
449
  description: |-
346
- Receives an single fulfillment provider order id that was returned from the /delegate_fulfillment resource.
347
- It should return matching fulfillment quantity updates for all line items of the original fulfillment delegations.
348
- It should return quantities for rejected, cancelled, and shipped per line item.
349
- Rejected means the fulfillment provider cannot fulfill that item.
350
- Cancelled means the client has requested an item not be fulfilled and the fulfillment provider was able to stop fulfillment.
351
- Shipped means the item has left for delivery.
352
-
353
- The original fulfillment will be marked shipped when all line items are either rejected/cancelled/shipped and at least one is shipped.
450
+ Returns a list of fulfillments that the fulfillment provider has decided to use to fulfill an order. It may return only a root level status, which indicates a single status for all line items on an order. It may also return a list of fulfillments, their status, and the line items included in that fulfillment. Fulfillments may or may not match a list of shipments, this is completely up to the fulfillment provider.
354
451
 
355
- This resource is requested after the first time /fulfillment/status returns a polling method of "Batch".
356
- The polling interval is once every 30 minutes.
357
- The maximum number of ids per request is 50.
358
- When there are more than 50 ids to request they are sequentially sent in batches of 50.
452
+ To communicate that the results for an order will no longer change the polling fields is_final_update_state should be set to true.
359
453
 
360
- Polling can be controlled by returning the polling.max_age_seconds or polling.per_request_limit property.
361
- The polling.max_age_seconds property overrides the 30 minute interval.
362
- The polling.per_request_limit property overrides the 50 ids sent per request.
454
+ The polling fields max_age_seconds refers to the expected cachable time of this result.
363
455
 
364
- Individual fulfillments can be removed from the batch polling method by returning "once" or "cursor" in the polling.method property.
456
+ To instead return a list of changes on a periodic basis, refer to the /get_recent_changes path instead.
365
457
  parameters:
366
458
  - schema:
367
459
  type: string
@@ -400,6 +492,7 @@ paths:
400
492
  - auth
401
493
  - fulfillment_provider_order_id
402
494
  - reason
495
+ description: Request the cancellation of a requested fulfillment send using the /delegate_fulfillment path. This will likely only start the cancellation process. Status updates via /get_fulfillments and /get_recent_changes will return the cancellation status when it is completed.
403
496
  parameters: []
404
497
  /get_rates:
405
498
  post:
@@ -476,7 +569,7 @@ paths:
476
569
  /get_recent_changes:
477
570
  parameters: []
478
571
  post:
479
- summary: Get Fulfillments With Changes
572
+ summary: Get Recent Changes
480
573
  operationId: post-fulfillment-get-recent-changes
481
574
  responses:
482
575
  '200':
@@ -489,24 +582,15 @@ paths:
489
582
  changes:
490
583
  type: array
491
584
  items:
492
- $ref: '#/components/schemas/SalesOrderStatusChange'
585
+ $ref: '#/components/schemas/SalesOrderFulfillment'
493
586
  next_request:
494
587
  type: string
495
- '':
496
- content:
497
- application/json:
498
- schema:
499
- type: object
500
- properties:
501
- changes:
502
- type: string
503
- next_request:
504
- type:
505
- - object
506
- - string
507
588
  description: |-
508
- Receives a timestamp and returns a list of line item changes since then.
509
- It may also return order level status changes that should be applied to all line items on the order as a whole.
589
+ Receives a timestamp of the last time requested changes was made, automatically buffered to include duplicate results to prevent skipping time.
590
+
591
+ Returns a list of changes. These changes include fulfillments that the fulfillment provider has decided to use to fulfill an order. It may return only an order level status, which indicates a single status for all line items on an order. It may also return a list of fulfillments, their status, and the line items included in that fulfillment. Fulfillments may or may not match a list of shipments, this is completely up to the fulfillment provider.
592
+
593
+ To instead return status on single orders at a time , refer to the /get_fulfillments path instead.
510
594
  requestBody:
511
595
  content:
512
596
  application/json:
@@ -521,6 +605,7 @@ paths:
521
605
  - string
522
606
  since:
523
607
  type: string
608
+ examples: {}
524
609
  parameters:
525
610
  - schema:
526
611
  type: string
@@ -528,7 +613,7 @@ paths:
528
613
  name: tenant-id
529
614
  /get_inventory:
530
615
  post:
531
- summary: Get Paged Inventory
616
+ summary: Get Inventory
532
617
  operationId: post-get-inventory
533
618
  responses:
534
619
  '200':
@@ -555,6 +640,16 @@ paths:
555
640
  type:
556
641
  - string
557
642
  - object
643
+ examples:
644
+ example-1:
645
+ value:
646
+ inventory:
647
+ sku: string
648
+ warehouse_id: string
649
+ available_quantity: string
650
+ committed_quantity: string
651
+ on_hand_quantity: string
652
+ next_request: string
558
653
  requestBody:
559
654
  content:
560
655
  application/json:
@@ -569,6 +664,7 @@ paths:
569
664
  - string
570
665
  required:
571
666
  - auth
667
+ description: Return the inventory that a fulfillment provider currently has for this merchant. Pagination is supplied via the next_request field. Pagination requests will be made until next_request is set to null. This is an optional path only for fulfillment providers who support inventory and are added as inventory provider integrations.
572
668
  parameters: []
573
669
  components:
574
670
  schemas:
@@ -1367,29 +1463,6 @@ components:
1367
1463
  type: string
1368
1464
  required:
1369
1465
  - rates
1370
- LineItemQuantityStatus:
1371
- title: LineItemQuantityStatus
1372
- type: object
1373
- properties:
1374
- line_item_id:
1375
- type: string
1376
- sku:
1377
- type: string
1378
- quantity:
1379
- type: number
1380
- shipped_quantity:
1381
- type: number
1382
- cancelled_quantity:
1383
- $ref: '#/components/schemas/QuantityWithReason'
1384
- rejected_quantity:
1385
- $ref: '#/components/schemas/QuantityWithReason'
1386
- unknown_quantity:
1387
- $ref: '#/components/schemas/QuantityWithReason'
1388
- required:
1389
- - line_item_id
1390
- - sku
1391
- - quantity
1392
- description: Sales order line item quantity fulfillment statuses
1393
1466
  Note:
1394
1467
  title: Note
1395
1468
  type: object
@@ -1756,31 +1829,29 @@ components:
1756
1829
  required:
1757
1830
  - description
1758
1831
  - quantity
1759
- SalesOrderStatus:
1832
+ SalesOrderFulfillmentStatus:
1760
1833
  type: string
1761
- title: SalesOrderStatus
1834
+ title: SalesOrderFulfillmentStatus
1762
1835
  enum:
1763
1836
  - Processing
1764
1837
  - Cancelled
1765
1838
  - Rejected
1766
- - Unknown
1767
- - PartiallyShipped
1768
1839
  - Shipped
1769
- SalesOrderStatusChange:
1770
- title: SalesOrderStatusChange
1840
+ SalesOrderFulfillment:
1841
+ title: SalesOrderFulfillment
1771
1842
  type: object
1772
1843
  description: Represents a status change update for a sales order
1773
1844
  properties:
1774
- order_id:
1775
- type: string
1776
1845
  status:
1777
- $ref: '#/components/schemas/SalesOrderStatus'
1778
- items:
1779
- $ref: '#/components/schemas/LineItemQuantityStatus'
1780
- shipments:
1846
+ $ref: '#/components/schemas/SalesOrderFulfillmentStatus'
1847
+ reason:
1848
+ type: string
1849
+ explanation:
1850
+ type: string
1851
+ line_items:
1781
1852
  type: array
1782
1853
  items:
1783
- $ref: '#/components/schemas/ShipmentNotification'
1854
+ $ref: '#/components/schemas/FulfillmentLineItem'
1784
1855
  ShipmentNotification:
1785
1856
  title: ShipmentNotification
1786
1857
  type: object
@@ -2078,4 +2149,38 @@ components:
2078
2149
  - weight_in_grams
2079
2150
  - source_weight
2080
2151
  - source_weight_unit
2152
+ FulfillmentLineItem:
2153
+ title: FulfillmentLineItem
2154
+ x-stoplight:
2155
+ id: 0wglkamy8lqi5
2156
+ type: object
2157
+ properties:
2158
+ line_item_id:
2159
+ type: string
2160
+ sku:
2161
+ type: string
2162
+ quantity:
2163
+ type: number
2164
+ required:
2165
+ - quantity
2166
+ SalesOrderFulfillments:
2167
+ title: SalesOrderFulfillments
2168
+ x-stoplight:
2169
+ id: 0mccgdffw5fq2
2170
+ type: object
2171
+ properties:
2172
+ fulfillment_provider_order_id:
2173
+ type: string
2174
+ status:
2175
+ $ref: '#/components/schemas/SalesOrderFulfillmentStatus'
2176
+ fulfillments:
2177
+ type: array
2178
+ items:
2179
+ $ref: '#/components/schemas/SalesOrderFulfillment'
2180
+ shipments:
2181
+ type: array
2182
+ items:
2183
+ $ref: '#/components/schemas/ShipmentNotification'
2184
+ required:
2185
+ - fulfillment_provider_order_id
2081
2186
  requestBodies: {}