Order Splitting Pipe
When finalizing orders and assigning them to dropship providers, Onport usually groups items them together into one single order per vendor. However, it may be necessary to split the purchase orders into smaller ones, according to some internal rules or agreements with the vendors.
Other than splitting by tag or creating a separate dropship purchase per quantity, Onport makes it possible to use an API Pipeline.
In other words, Onport is able to submit a request to an endpoint at the time of the order routing and receive directions on how to split the order.
The endpoint configuration is available from Onport's app under Contacts -> Dropship Providers -> provider name -> Routing -> Order Splitting.
Onport will send a payload containing the dropshipProvider object as well as an array of saleItems.
{"dropshipProvider": {"name": 123123,"authenticationToken": null,"authenticationSecret": null,"taxJarToken": null,"shippoToken": null,"id": 123123,"companyId": 123123,"userId": null,"companyReferralId": null,"shippingRateId": 123123,"paymentMethodId": null,"taxRateId": null,"platformCurrencyId": null,"commissionTaxRateId": null,"platformTaxRateId": null,"taxNumber": null,"shipmentRouting": "customer","externalPaymentStatus": "ignore","paymentModule": "enabled","syncOrderTax": true,"externalId": null,"externalPaymentId": null,"labelName": null,"status": "accepted","orderSetupStatus": "pending","orderSetupStatusMessage": null,"inventorySetup": "feed","inventoryRouting": null,"importAdjustments": null,"inventorySetupStatus": "complete","inventorySetupStatusMessage": null,"shippingSetupStatus": "pending","shippingSetupStatusMessage": null,"paymentSetupStatus": "pending","paymentSetupStatusMessage": null,"useChannelShippingRate": false,"shippingRates": null,"timezone": null,"websiteUrl": null,"xeroId": null,"quickbooksId": null,"zohoId": null,"transferwiseRecipientId": null,"stripeId": null,"stripePayout": "retailer","stripePayoutSource": "balance","stripeManagedId": null,"stripeManaged": false,"stripeManagedEnabled": false,"ostUser": null,"payAutomatically": null,"paymentSchedule": "daily","paymentDayMonthly": "firstDay","paymentDay": "monday","paymentDays": 0,"anyVendor": false,"requireInventoryFeedVariant": false,"emailCopy": false,"paypalEmail": null,"paymentNotes": null,"w9Form": null,"isValid": true,"validationMessage": null,"silenceAlerts": null,"defaultShippingCode": null,"purchaseNotes": null,"orderPlatform": "phone","orderFormat": "csv","orderTemplateType": "none","orderFlattenSeperator": null,"internalNotes": null,"orderEndpointUrl": null,"shippingEndpoint": null,"shippingEndpointFormat": "none","shippingEndpointPurpose": "all","shippingEndpointMapping": "default","shippingEndpointGrouping": "order","ftpShipmentImportType": "single","ftpShipmentImportDelimiter": null,"automaticallyPickup": null,"magentoStoreId": null,"orderLanguageCode": null,"orderCurrencyCode": null,"orderCarrierCode": null,"prestashopShopGroupId": null,"orderStatusCode": null,"paymentCode": null,"paymentMessage": null,"orderEndpointPath": null,"orderUseProxy": null,"orderTemplateId": null,"invoiceTemplateId": null,"invoiceTerms": null,"sendingSchedule": "immediate","sendingScheduleHour": "9","sendingScheduleMinute": "0","sendOrderNotification": false,"sendReminder": false,"reminderDays": null,"includeOrderSummary": true,"includeCustomerEmail": "none","includeCustomerPhone": false,"combineRates": false,"shippingPhone": "company","shippingEmail": "company","returnInHouse": false,"returnLabels": null,"returnShipmentTrigger": "any","returnLabelType": "paid","syncExternalReturns": false,"platformExportReturns": "none","saleReturnCustomerStatus": "default","saleReturnRefundTrigger": "none","countries": null,"countryFilter": "all","skus": null,"skuFilter": "all","productTypes": null,"productTypeFilter": "all","tags": null,"tagFilter": "all","phone": null,"returnsPolicy": null,"terms": null,"firstName": null,"lastName": null,"minimumOrderRequirements": null,"receiverRequired": null,"orderMinimum": null,"orderMinimumAmount": null,"internalTags": null,"addressLineOne": null,"addressLineTwo": null,"city": null,"state": null,"country": null,"zip": null,"generateShippingLabels": false,"shippingType": "generateShippingLabels","purchaseShippingLabelAutomatically": false,"automaticallySendLabel": false,"labelRouting": "bestMatch","labelScope": "all","labelCountries": null,"labelError": "prevent","includeLabelInPackingSlip": false,"includePackingSlip": true,"includeCustomerInvoice": "none","includeInvoice": false,"labelFormat": "pdf","requiresShippingApproval": false,"invoicingStage": "afterShipping","invoiceNotification": "none","invoiceShipping": false,"invoiceShippingType": "addition","invoiceShippingSource": "shippingRate","invoiceShippingEligibility": "all","calculateCostPrices": true,"commissionMethod": "retained","commissionRate": null,"commissionRateType": "percentage","commissionRateFixedType": "deduct_by","useCommissionRateEndpoint": false,"commissionRateEndpoint": null,"commissionRateDiscount": null,"commissionRateDiscountSplit": "100.00","commissionRateDiscountScope": "all","commissionRateDiscountCodes": null,"ignoreCostPriceAlerts": false,"enablePublishing": false,"taxCalculation": "disabled","commissionTaxCalculation": "disabled","taxShipping": true,"taxIncluded": true,"setMerchantReference": null,"platformNotification": "default","platformTrackingRequirement": "disabled","platformTags": null,"platformCustomerExternalId": null,"platformProducts": "connected","platformShippingCost": false,"platformShippingPrice": true,"platformShippingMapping": "default","platformShippingMappingFallback": "default","platformShippingProvider": null,"platformShippingServiceLevel": null,"platformShippingCode": null,"platformTax": "default","platformPrice": "purchase","platformProperties": "default","platformInvoiceAddress": "company","defaultWeight": 0,"defaultWeightUnit": "g","applyDiscountCode": false,"discountCode": null,"trackingScope": null,"orderSplitting": "endpoint","orderSplittingEndpoint": "https://custom.api/split.json","tagSplitting": [],"addressRouting": "default","taxId": null,"useInternalReferenceTemplate": false,"internalReferenceTemplate": null,"internalReferenceTemplateDateFormat": null,"createdAt": "2021-08-04T10:09:40.688Z","updatedAt": "2021-08-04T10:09:40.688Z","muteError": false,"adminNotes": null,"intercomMessageId": null,"vendor_dropship_providers": [{"vendorId": 123123}],"shipping_rate": {"displayName": "fixed","price": 10,"handlingFee": 0,"freeShippingThreshold": 0,"priceIncrease": 0,"parcelHeight": 0,"parcelWidth": 0,"parcelDepth": 0,"id": 24669,"companyId": 17649,"name": "fixed","code": "fixed","status": "active","days": null,"cacheInternalRates": false,"source": "Jetti","provider": null,"serviceLevel": null,"label": null,"providerCode": null,"providerId": null,"serviceLevelToken": null,"serviceLevelTerms": null,"signatureRequired": null,"priceType": "fixed","maximumOrderValue": null,"freeShippingOverride": null,"freeShippingOverrideScope": "value","freeShippingTags": [],"domesticBandType": "price","restOfWorldBandType": "price","ratePreference": "cheapest","defaultWeight": 0,"distanceUnit": "in","weightMultiplication": "per_item","maxPriceUnit": "fixed","maxPrice": null,"enableDiscountedUspsRates": true,"enableDiscountedDhlExpressRates": true,"enableDiscountedParcelforceRates": true,"uspsServiceLevels": [],"dhlExpressServiceLevels": [],"parcelforceServiceLevels": [],"customCarriers": "all","useFallbackRate": "always","pushFallbackRate": "never","useIntegrationFilteringEndpoint": null,"integrationFilteringEndpoint": null,"useServiceFilteringEndpoint": null,"serviceFilteringEndpoint": null,"createdAt": "2021-08-04T10:09:40.673Z","updatedAt": "2021-08-04T10:09:40.673Z"},"inventory_feeds": []},"saleItems": [{"allocation": 0,"commercialInvoicePrice": null,"tax": 0,"price": 10,"subtotal": 100,"id": 123123,"saleId": 123123,"dropshipProviderId": null,"warehouseId": null,"bundleSaleItemId": null,"cloneSaleItemId": null,"externalId": null,"externalVariantId": null,"orderRouting": "automated","manualRouting": null,"quantityCancelled": 0,"quantityRefunded": 0,"discounts": null,"discount": null,"channelPrice": null,"channelCompareAtPrice": null,"costPrice": null,"location": null,"preventDuplicates": false,"unallocated": false,"companyId": 17649,"variantId": 27266,"locked": false,"name": "HACK","notes": null,"quantity": 10,"taxable": false,"taxRate": null,"inventoryProcessed": 0,"quantityInvoiced": 0,"quantityReturned": 0,"bundleQuantity": 0,"isBundle": false,"properties": null,"createdAt": "2021-08-04T10:09:40.595Z","updatedAt": "2021-08-04T10:09:40.595Z","variant": {"imagesMapped": [],"images": [],"displayName": "wfehl52cmyb","costPrice": 0,"commissionRate": 0,"commissionRateRouting": "dropship_provider","commissionRateType": "percentage","companyId": 123123,"dropshipProviderId": null,"dropshipProviderAddressId": null,"dropshipProviderMapping": "brand_name","fulfillmentPolicy": "vendor_default","grams": 1000,"id": 27266,"inventoryQuantity": 0,"noInventoryPolicy": "replenish","orderSplitting": "default","productType": null,"sku": "wfehl52cmyb","tags": null,"vendorId": 123123,"vendor": {"email": "15888@test.com","id": 22555,"warehouseId": null,"dropshipProcessing": "dropship_provider","specifyDropshipProviders": true,"orderEmail": null,"fulfillmentPolicy": "dropship","warehouseRouting": "select"},"inventory_feed_variants": []}}, {"allocation": 0,"commercialInvoicePrice": null,"tax": 0,"price": 0,"subtotal": 0,"id": 123123,"saleId": 123123,"dropshipProviderId": null,"warehouseId": null,"bundleSaleItemId": null,"cloneSaleItemId": null,"externalId": null,"externalVariantId": null,"orderRouting": "automated","manualRouting": null,"quantityCancelled": 0,"quantityRefunded": 0,"discounts": null,"discount": null,"channelPrice": null,"channelCompareAtPrice": null,"costPrice": null,"location": null,"preventDuplicates": false,"unallocated": false,"companyId": 123123,"variantId": 123123,"locked": false,"name": "My item 1odo6qfdfij","notes": null,"quantity": 5,"taxable": false,"taxRate": null,"inventoryProcessed": 0,"quantityInvoiced": 0,"quantityReturned": 0,"bundleQuantity": 0,"isBundle": false,"properties": null,"createdAt": "2021-08-04T10:09:40.630Z","updatedAt": "2021-08-04T10:09:40.630Z","variant": {"imagesMapped": [],"images": [],"displayName": "wfehl52cmyb","costPrice": 0,"commissionRate": 0,"commissionRateRouting": "dropship_provider","commissionRateType": "percentage","companyId": 123123,"dropshipProviderId": null,"dropshipProviderAddressId": null,"dropshipProviderMapping": "brand_name","fulfillmentPolicy": "vendor_default","grams": 1000,"id": 27266,"inventoryQuantity": 0,"noInventoryPolicy": "replenish","orderSplitting": "default","productType": null,"sku": "wfehl52cmyb","tags": null,"vendorId": 123123,"vendor": {"email": "15888@test.com","id": 123123,"warehouseId": null,"dropshipProcessing": "dropship_provider","specifyDropshipProviders": true,"orderEmail": null,"fulfillmentPolicy": "dropship","warehouseRouting": "select"},"inventory_feed_variants": []}}]}
Onport will expect a JSON response that will be valid according to the following schema:
{"type": "object","additionalProperties": false,"required": ["batches"],"properties": {"batches": {"type": "array","items": {"type": "object","required": ["saleItems"],"properties": {"saleItems": {"type": "array","items": {"type": "object","required": ["saleItemId","quantity"],"properties": {"saleItemId": {"type": "integer"},"quantity": {"type": "integer"}}}}}}}}}
Here is an example JSON response:
{"batches": [{"saleItems": [{"saleItemId": 22216507,"quantity": 9}]},{"saleItems": [{"saleItemId": 52146834,"quantity": 1},{"saleItemId": 68734525,"quantity": 3}]}]}