Close
logo

Getting Dropship Provider Settings

Git RepositoryEdit on Github
Last update: a year ago by Francesco de LorenziReading time: 2 min

If you wish to download all the Dropship provider settings, you may do so by making a GET call to https://api.jetti.io/api/dropship-providers.json. It is recommended to use the attributes parameters as descrbied in the Connecting article, to request for specific fields therefore reducing the response time and system load.

Here is the cURL request to get a full list of dropship providers

curl --request GET \
--url https://api.jetti.io/api/dropship-providers.json \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

You may obtain settings for a specific dropship provider by calling /api/dropship-providers/:id.json

curl --request GET \
--url https://api.jetti.io/api/dropship-providers/:id.json \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

The above API may be useful to export specific settings from a large number of dropship providers, to be able to make sure shipping, commission or other settings are consistent across all the vendors.

The sample Node.js code below shows how to export the following data for any available dropship provider.

  • Dropship Provider Name
  • Commission method
  • Commission rate
  • Shipping Rate

The data will be printed as a table in the standard output.

import request from 'request-promise-native';
import flat from 'flat';
const go = async () => {
const response = await request.get('https://api.jetti.io/api/dropship-providers.json', {
headers: {
Authorization: `Bearer ${process.env.TOKEN}`,
},
json: true,
qs: {
// Only return the necessary fields
attributes: ['id', 'name','commissionMethod','commissionRate','shippingRateId'],
include: [{
model: 'ShippingRate',
attributes: ['id','name'],
}],
},
});
console.table(response.map(item => flat(item)));
};
go();
⌨️ Dropship Providers — Previous
Creating Dropship Providers
Next — ⌨️ Dropship Providers
Creating Inventory Feeds