This workflow demonstrates the API calls required to isolate specific shipments into a designated stack. By creating shipments, creating a target stack, and using the PATCH endpoint with the correct identifiers (ShpTag
, StackCSID
), you can effectively manage shipment grouping before further processing like EDI generation.
Prerequisites:
- Access to the Ship API with valid credentials (Client ID/Secret or Username/Password).
- The "Ship API - 2.0 Examples" Postman collection.
- A configured environment. See the article about postman on how to setup the environment:
https://helpcenter.nshift.com/hc/en-us/articles/18787401968156-Postman-Collection - Successful authentication (run the appropriate request in the "Authorization" folder).
Workflow Steps:
-
Create Test Shipments (Requests:
1. Create Test Shipment 1
,2. Create Test Shipment 2
):-
Action: Submit new shipments using the
POST /shipServer/{{ID}}/shipments
endpoint. - Why: You need existing shipments to move. When created, they typically land in a default stack associated with the chosen product/subcarrier.
-
Key Output: Note the
ShpTag
(unique shipment identifier) returned for each shipment.
-
Action: Submit new shipments using the
-
(Optional) Get Available Stacks (Request:
3. Get Available Stacks (Optional Check)
):-
Action: Retrieve a list of all existing stacks using
GET /shipServer/{{ID}}/stacks
. -
Why: To see current stacks and their
StackCSID
s before creating a new one or deciding on an existing target stack.
-
Action: Retrieve a list of all existing stacks using
-
Create New Target Stack (Request:
4. Create New Target Stack
):-
Action: Create a new, empty stack using
POST /shipServer/{{ID}}/stacks
. You need to provide theSubcarrierConceptID
(found in the shipment creation response or Get Stacks response) and a desiredStackName
. - Why: To create a specific destination for the shipments you want to move.
-
Key Output: Note the
StackCSID
(unique stack identifier) of the newly created stack.
-
Action: Create a new, empty stack using
-
Move Shipments (Request:
5. Move Test Shipments to New Target Stack
):-
Action: Update the stack assignment for specific shipments using
PATCH /shipServer/{{ID}}/stacks/shipments
. - Why: This is the core step where shipments are moved.
-
Key Inputs: Provide the target
StackCSID
(from step 3) and an array ofShipmentTags
(from step 1) for the shipments you want to move.
-
Action: Update the stack assignment for specific shipments using
-
Cleanup (Requests:
6. Cleanup...
,7. Cleanup...
,8. Cleanup...
):-
Action: Delete the test shipments (
DELETE /shipServer/{{ID}}/shipments/:shipmentTag
) and the newly created stack (DELETE /shipServer/{{ID}}/stacks/:stackCSID
). - Why: To remove temporary test data from the system after verifying the move operation.
-
Action: Delete the test shipments (