Order Routing Pipe
When finalizing orders, Onport allows you to dynamically route them based on an initial Dropship Provider and a list of sale items along with their quantity. The API endpoint will need to respond with one dropshipProviderId.
The Order Routing API pipeline configuration is available in the channel configuration page under Integrations -> platform icon -> store name -> Order Processing.
After ticking the Custom order routing API, you will be able to enter the Order routing endpoint URL.
Onport will send a JSON payload which corresponds to the following JSON schema:
{"type": "object","required": ["batches"],"properties": {"batches": {"type": "array","items": {"type": "object","required": ["dropshipProviderId","saleItemIds"],"properties": {"saleItemIds": {"type": "array","items": {"type": "object","required": ["saleItemId","quantity"],"properties": {"quantity": {"type": "integer"},"saleItemId": {"type": "integer"}}}},"dropshipProviderId": {"type": "integer"}}}}},"additionalProperties": false}
Here is an example JSON payload that Onport will send:
{"batches": [{"dropshipProviderId": 44830166,"saleItemIds": [{"saleItemId": 75863028,"quantity": 3}]},{"dropshipProviderId": 3589889,"saleItemIds": [{"saleItemId": 40989775,"quantity": 4}]}]}
Onport will expect a response which needs to be valid according to the following JSON schema:
{"type": "object","properties": {"dropshipProviderId": {"type": "integer"}},"required": ["dropshipProviderId"]}
Below is an example JSON response that Onport considers valid:
{"dropshipProviderId": 12352}