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

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 (35) hide show
  1. package/lib/app/fulfillment-provider-app-definition.d.ts +3 -3
  2. package/lib/app/fulfillment-provider-app-metadata.d.ts +8 -6
  3. package/lib/app/fulfillment-provider-app-metadata.js.map +1 -1
  4. package/lib/app/fulfillment-provider-app.js +2 -2
  5. package/lib/app/fulfillment-provider-app.js.map +1 -1
  6. package/lib/models/index.d.ts +1 -1
  7. package/lib/models/index.js +1 -1
  8. package/lib/models/index.js.map +1 -1
  9. package/lib/models/order-source/sales-order.d.ts +2 -0
  10. package/lib/models/sales-order-fulfillments.d.ts +19 -0
  11. package/lib/{requests/get-fulfillment-request.js → models/sales-order-fulfillments.js} +1 -1
  12. package/lib/models/sales-order-fulfillments.js.map +1 -0
  13. package/lib/requests/{get-fulfillment-request.d.ts → get-fulfillments-request.d.ts} +1 -1
  14. package/lib/{responses/get-fulfillment-response.js → requests/get-fulfillments-request.js} +1 -1
  15. package/lib/requests/get-fulfillments-request.js.map +1 -0
  16. package/lib/requests/index.d.ts +1 -1
  17. package/lib/requests/index.js +1 -1
  18. package/lib/requests/index.js.map +1 -1
  19. package/lib/responses/get-fulfillments-response.d.ts +14 -0
  20. package/lib/responses/get-fulfillments-response.js +8 -0
  21. package/lib/responses/get-fulfillments-response.js.map +1 -0
  22. package/lib/responses/get-recent-changes-response.d.ts +2 -2
  23. package/lib/responses/index.d.ts +1 -1
  24. package/lib/responses/index.js +1 -1
  25. package/lib/responses/index.js.map +1 -1
  26. package/package.json +1 -1
  27. package/spec.json +2831 -2659
  28. package/spec.yaml +199 -77
  29. package/tsconfig.tsbuildinfo +1 -1
  30. package/lib/models/sales-order-status-change.d.ts +0 -22
  31. package/lib/models/sales-order-status-change.js +0 -3
  32. package/lib/models/sales-order-status-change.js.map +0 -1
  33. package/lib/requests/get-fulfillment-request.js.map +0 -1
  34. package/lib/responses/get-fulfillment-response.d.ts +0 -8
  35. 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,123 @@ 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'
333
+ error:
334
+ $ref: '#/components/schemas/GetFulfillmentsError'
322
335
  polling:
323
336
  type: object
324
337
  properties:
325
338
  is_final_update_state:
326
339
  type: boolean
327
- enum:
328
- - once
329
- - changes_since
330
340
  max_age_seconds:
331
341
  type: number
342
+ required:
343
+ - fulfillment_provider_order_id
344
+ examples:
345
+ example-1:
346
+ value:
347
+ fulfillment_provider_order_id: string
348
+ status: string
349
+ fulfillments:
350
+ - status: Processing
351
+ reason: string
352
+ explanation: string
353
+ line_items:
354
+ - line_item_id: string
355
+ sku: string
356
+ quantity: 0
357
+ shipments:
358
+ - carrier_code: string
359
+ carrier_service_code: string
360
+ currency: 'USD,EUR,NZD'
361
+ ext_location_id: string
362
+ fulfillment_cost: 0
363
+ insurance_cost: 0
364
+ integration_context: {}
365
+ items:
366
+ - description: string
367
+ line_item_id: string
368
+ product_id: string
369
+ quantity: 0
370
+ sku: string
371
+ notes:
372
+ - text: string
373
+ type: BackOrderMessage
374
+ notification_id: string
375
+ notify_buyer: true
376
+ order_id: string
377
+ order_number: string
378
+ return_address:
379
+ address_line_1: string
380
+ address_line_2: string
381
+ address_line_3: string
382
+ city: string
383
+ company: string
384
+ country_code: 'US,MX,CA'
385
+ is_verified: true
386
+ name: string
387
+ first_name: string
388
+ last_name: string
389
+ phone: string
390
+ pickup_location:
391
+ carrier_id: string
392
+ relay_id: string
393
+ postal_code: string
394
+ residential_indicator: R
395
+ state_province: string
396
+ ship_date: '2021-03-31T18:21:14.858Z'
397
+ ship_from:
398
+ address_line_1: string
399
+ address_line_2: string
400
+ address_line_3: string
401
+ city: string
402
+ company: string
403
+ country_code: 'US,MX,CA'
404
+ is_verified: true
405
+ name: string
406
+ first_name: string
407
+ last_name: string
408
+ phone: string
409
+ pickup_location:
410
+ carrier_id: string
411
+ relay_id: string
412
+ postal_code: string
413
+ residential_indicator: R
414
+ state_province: string
415
+ ship_to:
416
+ address_line_1: string
417
+ address_line_2: string
418
+ address_line_3: string
419
+ city: string
420
+ company: string
421
+ country_code: 'US,MX,CA'
422
+ is_verified: true
423
+ name: string
424
+ first_name: string
425
+ last_name: string
426
+ phone: string
427
+ pickup_location:
428
+ carrier_id: string
429
+ relay_id: string
430
+ postal_code: string
431
+ residential_indicator: R
432
+ state_province: string
433
+ tracking_number: string
434
+ tracking_url: string
435
+ polling:
436
+ is_final_update_state: true
437
+ max_age_seconds: 0
332
438
  requestBody:
333
439
  content:
334
440
  application/json:
@@ -343,25 +449,13 @@ paths:
343
449
  - auth
344
450
  - fulfillment_provider_order_id
345
451
  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.
452
+ 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.
352
453
 
353
- The original fulfillment will be marked shipped when all line items are either rejected/cancelled/shipped and at least one is shipped.
454
+ To communicate that the results for an order will no longer change the polling fields is_final_update_state should be set to true.
354
455
 
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.
456
+ The polling fields max_age_seconds refers to the expected cachable time of this result.
359
457
 
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.
363
-
364
- Individual fulfillments can be removed from the batch polling method by returning "once" or "cursor" in the polling.method property.
458
+ To instead return a list of changes on a periodic basis, refer to the /get_recent_changes path instead.
365
459
  parameters:
366
460
  - schema:
367
461
  type: string
@@ -400,6 +494,7 @@ paths:
400
494
  - auth
401
495
  - fulfillment_provider_order_id
402
496
  - reason
497
+ 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
498
  parameters: []
404
499
  /get_rates:
405
500
  post:
@@ -476,7 +571,7 @@ paths:
476
571
  /get_recent_changes:
477
572
  parameters: []
478
573
  post:
479
- summary: Get Fulfillments With Changes
574
+ summary: Get Recent Changes
480
575
  operationId: post-fulfillment-get-recent-changes
481
576
  responses:
482
577
  '200':
@@ -489,24 +584,15 @@ paths:
489
584
  changes:
490
585
  type: array
491
586
  items:
492
- $ref: '#/components/schemas/SalesOrderStatusChange'
587
+ $ref: '#/components/schemas/SalesOrderFulfillment'
493
588
  next_request:
494
589
  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
590
  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.
591
+ Receives a timestamp of the last time requested changes was made, automatically buffered to include duplicate results to prevent skipping time.
592
+
593
+ 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.
594
+
595
+ To instead return status on single orders at a time , refer to the /get_fulfillments path instead.
510
596
  requestBody:
511
597
  content:
512
598
  application/json:
@@ -521,6 +607,7 @@ paths:
521
607
  - string
522
608
  since:
523
609
  type: string
610
+ examples: {}
524
611
  parameters:
525
612
  - schema:
526
613
  type: string
@@ -528,7 +615,7 @@ paths:
528
615
  name: tenant-id
529
616
  /get_inventory:
530
617
  post:
531
- summary: Get Paged Inventory
618
+ summary: Get Inventory
532
619
  operationId: post-get-inventory
533
620
  responses:
534
621
  '200':
@@ -555,6 +642,16 @@ paths:
555
642
  type:
556
643
  - string
557
644
  - object
645
+ examples:
646
+ example-1:
647
+ value:
648
+ inventory:
649
+ sku: string
650
+ warehouse_id: string
651
+ available_quantity: string
652
+ committed_quantity: string
653
+ on_hand_quantity: string
654
+ next_request: string
558
655
  requestBody:
559
656
  content:
560
657
  application/json:
@@ -569,6 +666,7 @@ paths:
569
666
  - string
570
667
  required:
571
668
  - auth
669
+ 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
670
  parameters: []
573
671
  components:
574
672
  schemas:
@@ -1367,29 +1465,6 @@ components:
1367
1465
  type: string
1368
1466
  required:
1369
1467
  - 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
1468
  Note:
1394
1469
  title: Note
1395
1470
  type: object
@@ -1756,31 +1831,29 @@ components:
1756
1831
  required:
1757
1832
  - description
1758
1833
  - quantity
1759
- SalesOrderStatus:
1834
+ SalesOrderFulfillmentStatus:
1760
1835
  type: string
1761
- title: SalesOrderStatus
1836
+ title: SalesOrderFulfillmentStatus
1762
1837
  enum:
1763
1838
  - Processing
1764
1839
  - Cancelled
1765
1840
  - Rejected
1766
- - Unknown
1767
- - PartiallyShipped
1768
1841
  - Shipped
1769
- SalesOrderStatusChange:
1770
- title: SalesOrderStatusChange
1842
+ SalesOrderFulfillment:
1843
+ title: SalesOrderFulfillment
1771
1844
  type: object
1772
1845
  description: Represents a status change update for a sales order
1773
1846
  properties:
1774
- order_id:
1775
- type: string
1776
1847
  status:
1777
- $ref: '#/components/schemas/SalesOrderStatus'
1778
- items:
1779
- $ref: '#/components/schemas/LineItemQuantityStatus'
1780
- shipments:
1848
+ $ref: '#/components/schemas/SalesOrderFulfillmentStatus'
1849
+ reason:
1850
+ type: string
1851
+ explanation:
1852
+ type: string
1853
+ line_items:
1781
1854
  type: array
1782
1855
  items:
1783
- $ref: '#/components/schemas/ShipmentNotification'
1856
+ $ref: '#/components/schemas/FulfillmentLineItem'
1784
1857
  ShipmentNotification:
1785
1858
  title: ShipmentNotification
1786
1859
  type: object
@@ -2078,4 +2151,53 @@ components:
2078
2151
  - weight_in_grams
2079
2152
  - source_weight
2080
2153
  - source_weight_unit
2154
+ FulfillmentLineItem:
2155
+ title: FulfillmentLineItem
2156
+ x-stoplight:
2157
+ id: 0wglkamy8lqi5
2158
+ type: object
2159
+ properties:
2160
+ line_item_id:
2161
+ type: string
2162
+ sku:
2163
+ type: string
2164
+ quantity:
2165
+ type: number
2166
+ required:
2167
+ - quantity
2168
+ SalesOrderFulfillments:
2169
+ title: SalesOrderFulfillments
2170
+ x-stoplight:
2171
+ id: 0mccgdffw5fq2
2172
+ type: object
2173
+ properties:
2174
+ fulfillment_provider_order_id:
2175
+ type: string
2176
+ status:
2177
+ $ref: '#/components/schemas/SalesOrderFulfillmentStatus'
2178
+ fulfillments:
2179
+ type: array
2180
+ items:
2181
+ $ref: '#/components/schemas/SalesOrderFulfillment'
2182
+ shipments:
2183
+ type: array
2184
+ items:
2185
+ $ref: '#/components/schemas/ShipmentNotification'
2186
+ required:
2187
+ - fulfillment_provider_order_id
2188
+ GetFulfillmentsError:
2189
+ title: GetFulfillmentsError
2190
+ x-stoplight:
2191
+ id: 8mnh6631wyx16
2192
+ type: object
2193
+ properties:
2194
+ code:
2195
+ $ref: '#/components/schemas/GetFulfillmentsErrorCode'
2196
+ GetFulfillmentsErrorCode:
2197
+ type: string
2198
+ title: GetFulfillmentsErrorCode
2199
+ x-stoplight:
2200
+ id: dzb4hofw881kj
2201
+ enum:
2202
+ - order_not_found
2081
2203
  requestBodies: {}