Skip to main content

Quick Start Guide

Get started with the SASOM Partners API in minutes.

Prerequisites

Before you begin, you'll need:

  • API Credentials - Contact support@sasom.co.th to request access
  • HTTP Client - cURL, Postman, or your programming language's HTTP library

Step 1: Verify Your Credentials

Test your API credentials by fetching your processing orders:

curl -X GET https://partners.sasomapi.com/partner/processing/orders \
-u "YOUR_API_KEY:YOUR_API_SECRET"

Expected Response:

{
"success": true,
"data": [],
"cursor": null,
"has_more": false
}

If you get an authentication error, check your credentials.

Step 2: Create Your First Listing

Create an Ask listing to sell a product:

curl -X POST https://partners.sasomapi.com/partner/list/ask \
-u "YOUR_API_KEY:YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"sku": "AIR-JORDAN-1-HIGH-OG",
"size": "10",
"price": 5000,
"quantity": 1
}'

Success Response:

{
"success": true,
"message": "Listing created successfully",
"data": {
"listing_id": "abc123",
"sku": "AIR-JORDAN-1-HIGH-OG",
"size": "10",
"price": 5000,
"quantity": 1,
"status": "active"
}
}

Step 3: Check Your Listings

View your active listings:

curl -X GET https://partners.sasomapi.com/partner/live/listings/ask \
-u "YOUR_API_KEY:YOUR_API_SECRET"

Step 4: Handle Orders

When a buyer purchases your listing, you'll need to:

1. Check Processing Orders

curl -X GET https://partners.sasomapi.com/partner/processing/orders \
-u "YOUR_API_KEY:YOUR_API_SECRET"

2. Confirm the Order

curl -X PUT https://partners.sasomapi.com/partner/confirm/order \
-u "YOUR_API_KEY:YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"order_id": "ORDER_ID_HERE"}'

3. Update Tracking

curl -X PUT https://partners.sasomapi.com/partner/update/tracking \
-u "YOUR_API_KEY:YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDER_ID_HERE",
"tracking_number": "TH12345678",
"logistics_provider": "Kerry Express"
}'

What's Next?

Sample Integration

Here's a simple Node.js example to get you started:

const SASOM_API = 'https://partners.sasomapi.com';
const API_KEY = process.env.SASOM_API_KEY;
const API_SECRET = process.env.SASOM_API_SECRET;

async function sasomRequest(method, path, body = null) {
const credentials = Buffer.from(`${API_KEY}:${API_SECRET}`).toString('base64');

const options = {
method,
headers: {
'Authorization': `Basic ${credentials}`,
'Content-Type': 'application/json'
}
};

if (body) {
options.body = JSON.stringify(body);
}

const response = await fetch(`${SASOM_API}${path}`, options);
return response.json();
}

// Example: Get processing orders
async function getProcessingOrders() {
const result = await sasomRequest('GET', '/partner/processing/orders');
console.log('Orders:', result.data);
return result.data;
}

// Example: Create a listing
async function createListing(sku, size, price, quantity) {
const result = await sasomRequest('POST', '/partner/list/ask', {
sku,
size,
price,
quantity
});

if (!result.success) {
throw new Error(result.message);
}

return result.data;
}

// Run
getProcessingOrders();

Need Help?