Bankok925.com Drop Shipping API

Bangkok925.com uses a RESTful API system. The system use HTTP POST and JSON POST for the client to make a request to Bangkok925.com’s server. The Bangkok925.com API server responds in XML.

We will refer to the drop shipper as “client” and the end customer as “customer” in this document.

Client Id

The client Id is a unique identifier that corresponds to the drop shipper’s account with Bangkok925.com. The client ID is referenced in a POST variable as “rId”.

Private Key

The private key is a string of characters that act like a password for the API system. The private key is referenced in a POST variable as “key”.

The combination of client id and private key is how each client authenticates in the API system.

Category Request

Clients can retrieve all available categories by id and name in XML format.

Clients need to send a standard HTTP POST request to http://bangkok925.com/resell/reseller_xml.php including the client’s user id and their private key. Example

<form action=”http://bangkok925.com/resell/reseller_xml.php” method=”post”>

<input type=”hidden” name=”rId” value=”1”> Client with ID = 1

<input type=”hidden” name=”key” value=”XXXXX”> Clients key

</form>

Bangkok925.com will respond with an appropriate XLM response, you can view an example here.

Products Request

Product information is available by category. The client can retrieve all category ids through the category xml response, at which point the client can build an appropriate request to Bangkok925.com’s server that includes the POST variable cId (the id of the category requested).

Example

<form action=”http://bangkok925.com/resell/reseller_xml.php” method=”post”>

<input type=”hidden” name=”rId” value=”1”> Client with ID = 1

<input type=”hidden” name=”key” value=”XXXXX”> Clients key

<input type=”hidden” name=”cId” value=”2”> request for category 2 products

</form>

Bangkok925.com will respond with a XML file that includes all available products in the requested category.

Products with variations such as sizes or colors include as part of the XML response information such as

<products_child>

<products_child_id>2278</products_child_id>

<variant_type>size</attribute_type>

<variant_value>7.00</attribute_value>

<products_child_quantity>2</products_child_quantity>

</products_child>

Products with no variations will have the <products_child> node empty.

(Some products have variations in ring size, necklace length, and stone colors. An example is a silver ring with sizes 5,7,8. That would result in a parent product. The parent product would have its own product id and does not represent a physical product by itself. Each size variant is considered a physical product and has its own product id and quantity. Other than product id and quantity, parent and child products share the same properties such as product price, product name, and so on. The parent product becomes out of stock as soon as all the child products are out of stock.)

See example

Sending an Order to Bangkok925.com

Clients can send orders to Bangkok925.com using a JSON post request. Once a client sends a successful order request, the order will automatically by placed in the clients bangkok925.com account on bangkok925.com’s website as a complete order, however, the client must pay bangkok925.com the total cost of the order directly to paypal.

Part of the order request sent to bangkok925.com by the client will include the customer’s price per item. Bangkok925.com will calculate the clients cost per product based on the wholesale cost and bill the client appropriately. The drop shipper bills the customer separately.

The drop shipper can put a markup on their prices to the end customer. The profit made by the drop shipper will equal the final customer price minus the clients cost. Bangkok925.com will produce two invoices, one for the drop shipper, and one for the end customer.

A successful order sent to Bangkok925.com’s API system will produce the following response in XML.

<order>

<orders_id>1000</orders_id>

<orders_cost>100</orders_cost>

<resellers_order_id>50</resellers_order_id>

<orders_result>1</orders_result>

</order>

The orders_id is the unique order id that identifies each order on bangkok925.com

The cost (orders_cost) is the cost of all the products in the order that the client must pay bangkok925.com. (It is not the end customer’s price)

resellers_order_id is an unique identifier sent by the client in the JSON request to reference their order. Bangkok925.com does not use this data, however it is returned to the client for their reference. The purpose is to facilitate API development; it is not required to process the order.

The result (orders_result) is 1 for a successful order being placed on bangkok925.com. An unsuccessful result will have 0 as a response to identify an error of some sort.

You can see an appropriate JSON request here.

{"reseller_id":3,"reseller_key":"XXXXXX","reseller_order_id":"1234","order_comments":"comments for the customer","order_info":{"delivery_name":"deliver name","delivery_company":"deliver company","delivery_telephone":"123654","delivery_street_address":"diliver address","delivery_suburb":"diliver suburb","delivery_city":"diliver city","delivery_postcode":"23456","delivery_state":"CA","delivery_country":"USA","billing_name":"billing_name","billing_company":"billing_company","billing_telephone":"123456","billing_street_address":"billing_street_address","billing_suburb":"billing_suburb","billing_city":"billing_city","billing_postcode":"12345","billing_state":"VF","billing_country":"TH","orders_comment":"a comment here"},"products_id":[1,2,23,44],"end_customers_price":{"1":"11.2","2":"215.3","23":"444.5","44":5},"quantity":{"1":"11","2":"215","23":"444","44":5},"products_name":{"1":"p1","2":"p215","23":"p444","44":"p5"}}

XML, HTTP and JSON are cross platform standards used in many API systems. Bangkok925.com has the following PHP scripts that can help integrate the API system for clients that wish to use a PHP based system. However, even if you use another platform for your shopping cart, you still can take advantage of our API system.

Sandbox

Bangkok925.com’s sandbox is available for the public to test interactions with our API.

In the sandbox, developers can test request and responses. The sandbox does not authenticate the request for client (rId) and key information.

The sandbox does not use Bangkok926.com’s live database. The sandbox does return category and product response using the proper structure, however the data is not current.

The sandbox for URL for Bangkok925.com’s category and product line is

The category and product POST request and XML responses have the same structure in the sandbox as it does in the live version.

The sandbox URL for placing orders is

The order placement JSON POST request and XML responses have the same structure in the sandbox as it does in the live version. In the sandbox, developers also have the ability to review placed orders. The review provides a recap of the end customer and product information sent by the JSON request. It does this by reading back from the database product and customer information sent. The purpose of the review is to allow developers the ability to check if their information was properly recorded in the database. The review provides the essential information that makes up the order. When a developer successfully submits the correctly formatted JSON POST, the review will accurately reflect the request information provided.

To review an order, use the following sandbox URL.

The GET variable order_id will be the order_id returned from the order placement XML response. Please be aware that at times the sandbox is reset and test orders are deleted.