Close
logo

Dropshipment Pipe

Git RepositoryEdit on Github
Last update: 2 years ago by luigi mangaReading time: 2 min

When generating shipping labels from the vendor portal or the default-label.json endpoint, it is possible to instruct Onport to split dropshipments via an API pipeline. Specifically, Onport will contact an API endpoint configured from Onport's UI which will receive an array of Purchase Items and will be in charge of splitting them into dropshipments.

Below is a sample payload being sent by Onport:

{
"items": [{
"quantity": 10,
"name": "HACK",
"price": 10,
"commercialInvoicePrice": null,
"variant": {
"imagesMapped": [],
"images": [],
"displayName": "jbg8c4dp9m",
"costPrice": 0,
"commissionRate": 0,
"id": 29580,
"vendorId": 23597,
"dropshipProviderId": null,
"dropshipProviderAddressId": null,
"productId": 16800,
"sku": "jbg8c4dp9m",
"name": "Default name",
"grams": 1000,
"vendorSku": null,
"tags": null,
"taxable": true,
"barcode": null,
"hsCode": null,
"countryOfOrigin": null,
"product": {
"id": 16800,
"name": "My item 123"
},
"vendor": {
"name": "16800",
"id": 23597
},
"option_values": [],
"inventory_feed_variants": []
},
"id": 22878
}]
}

The items array contains the Purchase Items, identified by the id property.

Onport will expect a JSON response that is valid according to the following JSON Schema:

{
"type": "object",
"required": [
"batches"
],
"properties": {
"batches": {
"type": "array",
"items": {
"type": "object",
"required": [
"purchaseItems"
],
"properties": {
"purchaseItems": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"quantity"
],
"properties": {
"id": {
"type": "integer"
},
"quantity": {
"type": "integer"
}
}
}
},
"customFields": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
}
}
}
},
"additionalProperties": false
}

An example JSON response that Onport accept is shown below:

{
"batches": [
{
"purchaseItems": [
{
"id": 777666555,
"quantity": 1
}
]
},
{
"purchaseItems": [
{
"id": 54770645,
"quantity": 3
},
{
"id": 153229,
"quantity": 3
}
],
"customFields": [
{
"name": "gift_note",
"value": "Greetings from UK!"
}
]
}
]
}
๐Ÿ” API Pipeline โ€” Previous
Commission Pipe
Next โ€” ๐Ÿ” API Pipeline
Inventory Allocation Pipe