BTSWholesaler
Documents
BTSWholesaler API Integration
List of contents
Introduction.................................................................................................... 2
Environments................................................................................................. 2
Features......................................................................................................... 2
Considerations................................................................................................ 3
Available functions......................................................................................... 3
GET /v1/api/getProducts............................................................................. 3
GET /v1/api/getListProducts.......................................................................5
GET /v1/api/getListCategories....................................................................5
GET /v1/api/getShippingPrices....................................................................6
POST /v1/api/setCreateOrder......................................................................7
GET /v1/api/getTrackings........................................................................... 8
POST /v1/api/setCancelOrder.....................................................................8
GET /v1/api/getOrder.................................................................................. 9
GET /v1/api/getPointRelais.......................................................................10
GET /v1/api/getCountries..........................................................................11
GET /v1/api/getStatesByCountryCode......................................................11
Introduction
This document details a number of features available on the BTSWholesaler webpage
integrated in API format.
Environments
The API has two different environments, each one with their corresponding base
address:
• Production:
◦ [Link]
• Sandbox:
◦ [Link]
Features
There are various features divided in three different blocks, each one responding to a
sole http method that appears right before the name of each one:
Features linked to the products:
o GET /v1/api/getProducts
o GET /v1/api/getListProducts
o GET /v1/api/getListCategories
Features linked to the orders:
o POST /v1/api/setCreateOrder
o POST /v1/api/setCancelOrder
o GET /v1/api/getOrder
o GET /v1/api/getTrackings
Features linked to countries and shipping rates (needed for posting orders)
o GET /v1/api/getShippingPrices
o GET /v1/api/getPointRelais
o GET /v1/api/getCountries
o GET /v1/api/getStatesByCountryCode
2
Considerations
The terms SKU and EAN refer to the exact product reference and therefore are
the same.
For each and every request it is necessary that you identify yourself. To do so, you are
required to go to [Link] and, under the section API, create a
new password. If you believe that your password has been compromised, you can
generate a new one, automatically deactivating the old one. For each request to the API
BTSWholesaler, the following information must be inserted in the http header as a
parameter:
Header Type Required Description
Authorization: String YES Password provided by
Bearer BTSWholesaler
The POST requests must be encoded as application/x-www-form-urlencoded
The output values format for the API BTSWholesaler is JSON, except for the feature of
returning all the products and categories from the catalogue, in which case the output
format can be chosen from a parameter.
3
Available functions
GET /v1/api/getProducts
?product_sku[i]=<product_sku>
&product_sku[i+1]=<product_sku >
It returns an array of products, depending on the product references entered as input
parameters:
Parameter name Type Required Description
Input values
product_sku[i] Integer YES Product reference number
Output values
id Integer - BTSWholesaler internal ID
ean Integer - Product reference
categories String - Product category ID
separated by “/”
manufacturer String - Product brand
name String - Product name
description String - Product description
recommended_price Float - Recommended or slashed
price
price Float - Product price
stock Integer - Available stock
image String - URL for the product’s
image
delivery Integer - Leadtime to ship: 24/48 or
48/72 hours
gender String - Product genre: male,
female or unisex
* Where i is the array index, from 0 to n.
4
GET /v1/api/getListProducts
It returns an array with all the available products on BTSWholesaler.
Parameter name Type Required Description
Input values
format_file String NO Output data format
Output values
id Integer - BTSWholesaler internal ID
ean Integer - Product reference
categories String - Product category ID
separated by “/”
manufacturer String - Product brand
name String - Product name
description String - Product description
recommended_price Float - Recommended or slashed
price
price Float - Product price
stock Integer - Available stock
image String - URL for the product’s
image
delivery Integer - Leadtime to ship: 24/48 or
48/72 hours
gender String - Product genre: male,
female or unisex
GET /v1/api/getListCategories
It returns an array with the different category tree available at BTSWholesaler.
Parameter name Type Required Description
Input values
format_file String NO Output data format
Output values
id Integer - BTSWholesaler category ID
name Integer - Category name
parent_id String - Parent category ID
5
GET /v1/api/getShippingPrices
?address[country_code]=<country_code>
&address[postal_code]=<postal_code>
&products[i][sku]=<product_reference>
&products[i][quantity]=<product_quantity>
For each order that you are going to place you must check the shipping costs that you
can assign to the order. This function gives you information regarding the shipping
methods and costs available for the order that you are placing.
Parameter name Type Required Description
Input values
address[country_cod String YES Delivery country code
e]
address[postal_code] String YES Delivery post code
products[i][sku] String YES Product reference
products[i][quantity] Integer YES Product quantity
Output values
id String - Shipping Cost Id
to use when placing the
order
delivery_time String - Expected delivery time
company_name String - Shipping company
shipping_cost Float - Shipping rate, excluding
taxes
free_shipping Float - Minimum order to be
entitled to free shipping
* Where i is the array index, from 0 to n.
6
POST /v1/api/setCreateOrder
Feature that enables you to create an order on BTSWholesaler. If successful, the order
number will be shown. If not, an exception message will appear.
The POST body must be encoded as application/x-www-form-urlencoded
Parameter name Type Required Description
Input values
payment_method String YES Payment method chosen:
wallet
bank transfer
products[i][sku] Integer YES Product reference
products[i][quantity] Integer Product units
shipping_cost_id Integer YES ID chosen from those
available in the
corresponding
getShippingPrices call
client_name String YES Customer’s name
address String * Conditional Customer’s address
postal_code String * Conditional Customer’s post code
city String * Conditional Customer’s city
country_code String * Conditional Customer’s country code
state_code String * Conditional Customer’s state code
point_relay_id String * Conditional Mondial Relay ID
telephone String YES Customer’s telephone
dropshipping Integer Drop-shipping order
0 - NO
1 - YES
comments String NO Customer’s comments
regarding order
Output values
- String - Order number given by
BTSWholesaler
* state_code: If the order’s delivery address is the United States or Canada, this field is
Required. If the delivery address is any other country then it is not.
* point_relay_id: If the shipping method is Mondial Relay it is a Required parameter, if
not then it is not necessary.
* address, postal_code, city, country_code: these fields are not Required if the shipping
method chosen is Mondial Relay.
7
GET /v1/api/getTrackings
?order_number[i]=<order_number>
&order_number[i+1]=< order_number >
Feature that gives you the tracking numbers for one or various orders, after entering an
input array.
Parameter name Type Required Description
Input values
order_number[i] String YES Order number
Output values
order_number String - Order number
tracking String - Tracking number for order
* Where i is the array index, from 0 to n.
POST /v1/api/setCancelOrder
Feature that enables you to cancel a previously placed order, as long as it is yet to be
processed.
Parameter name Type Required Description
Input values
order_number String YES Order number
Output values
- String - It returns “true” if the order
has been cancelled
correctly, if not an
exception message will be
shown.
8
GET /v1/api/getOrder
?order_number=<order_number>
It returns the relevant information for an order, which you request via an input
parameter.
Parameter name Type Required Description
Input values
order_number String YES Order number
Output values
order_number String - Order number
order_status String - Order status
tracking String - Tracking number for
order
order_total Float - Total cost
client_name String - Customer’s name
client_email String - Customer’s email
address
address String - Customer’s address
postal_code String - Customer’s post code
city String - Customer’s city
state_code String - State code
country_code String - Delivery country code
shipping_company String - Shipping company
shipping_cost Float - Shipping cost
telephone String - Customer’s telephone
comments String - Customer’s comments
expected_delivery_date String - Earliest estimated
delivery date
expected_delivery_date_ String - Latest estimated delivery
2 date
expected_dispatch_date String - Earliest estimated
dispatch date
expected_dispatch_date_ String - Latest estimated
2 dispatch date
dropshipping Integer - Drop-shipping order
0 - NO
1 - YES
entry_date String - Order date
products Array - Array of the order’s
sku String products. Each one has
quantity Integer the properties SKU,
price Float quantity and price
9
GET /v1/api/getPointRelais
?address[city]=<delivery_city>
&address[postal_code]=<postal_code>
&address[country_code]=<country_code>
When placing an order with Mondial Relay as the shipping method for certain countries,
you are required to enter the code for the delivery point chosen. This is what makes
this feature useful, as it enables you to choose the correct delivery point depending on
the address given.
Parameter name Type Required Description
Input values
address[city] String YES Delivery city
address[postal_code] String YES Delivery post code
address[country_cod String YES Delivery country code
e]
Output values
id String - Delivery point ID
name String - Delivery point name
address String - Delivery point address
city String - Delivery point city
postal_code String - Delivery point post code
10
GET /v1/api/getCountries
This feature enables us to know the format of the country codes on BTSWholesaler.
Parameter name Type Required Description
Output values
code String - Country code
name String - Country name
GET /v1/api/getStatesByCountryCode
It returns the states that make up a country, once the country code has passed through
the parameter.
Parameter name Type Required Description
Input values
country_code String YES Country code
Datos de Salida
code String - State code
name String - State name
11