API Reference
Complete REST API documentation for building powerful e-commerce integrations
On This Page
Introduction
Welcome to the DiSeller API documentation. Our RESTful API allows you to manage your e-commerce operations programmatically, including products, orders, customers, and payments.
The API is organized around REST principles with predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
RESTful
Standard HTTP methods (GET, POST, PUT, DELETE) for all operations
Secure
OAuth 2.0 and API key authentication with HTTPS encryption
Well Documented
Comprehensive guides with examples in multiple programming languages
Authentication
The DiSeller API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure!
Security Warning: Do not share your API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
API Key Authentication
Include your API key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY
Example Request
curl https://api.diseller.com/v1/products \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
const axios = require('axios');
const api = axios.create({
baseURL: 'https://api.diseller.com/v1',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
// Make a request
const products = await api.get('/products');import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.diseller.com/v1/products',
headers=headers
)
products = response.json()Base URL
All API requests should be made to the following base URL:
https://api.diseller.com/v1Note: All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Making Requests
The DiSeller API accepts JSON-encoded request bodies and returns JSON-encoded responses. All requests should include the Content-Type: application/json header.
HTTP Methods
Retrieve resources
Create new resources
Update existing resources
Remove resources
Products API
The Products API allows you to create, retrieve, update, and delete products in your catalog.
List All Products
/productscurl https://api.diseller.com/v1/products \ -H "Authorization: Bearer YOUR_API_KEY"
Response
{
"data": [
{
"id": "prod_123",
"name": "Premium T-Shirt",
"description": "High-quality cotton t-shirt",
"price": 2999,
"currency": "usd",
"inventory": 150,
"status": "active",
"created_at": "2025-01-15T10:30:00Z"
}
],
"has_more": false,
"total": 1
}Create a Product
/productscurl https://api.diseller.com/v1/products \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Premium T-Shirt",
"description": "High-quality cotton t-shirt",
"price": 2999,
"currency": "usd",
"inventory": 150
}'Retrieve a Product
/products/:idcurl https://api.diseller.com/v1/products/prod_123 \ -H "Authorization: Bearer YOUR_API_KEY"
Update a Product
/products/:idcurl -X PUT https://api.diseller.com/v1/products/prod_123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"price": 2499,
"inventory": 200
}'Delete a Product
/products/:idcurl -X DELETE https://api.diseller.com/v1/products/prod_123 \ -H "Authorization: Bearer YOUR_API_KEY"
Orders API
Manage customer orders, including creation, retrieval, updates, and cancellations.
List All Orders
/orderscurl https://api.diseller.com/v1/orders \ -H "Authorization: Bearer YOUR_API_KEY"
Response
{
"data": [
{
"id": "ord_456",
"customer_id": "cust_789",
"status": "completed",
"total": 5998,
"currency": "usd",
"items": [
{
"product_id": "prod_123",
"quantity": 2,
"price": 2999
}
],
"created_at": "2025-01-15T14:20:00Z"
}
],
"has_more": false,
"total": 1
}Create an Order
/orderscurl https://api.diseller.com/v1/orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "cust_789",
"items": [
{
"product_id": "prod_123",
"quantity": 2
}
],
"shipping_address": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zip": "94102",
"country": "US"
}
}'Customers API
Manage customer information and profiles.
List All Customers
/customerscurl https://api.diseller.com/v1/customers \ -H "Authorization: Bearer YOUR_API_KEY"
Create a Customer
/customerscurl https://api.diseller.com/v1/customers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "customer@example.com",
"name": "John Doe",
"phone": "+1234567890"
}'Payments API
Process and manage payments for orders.
Create a Payment
/paymentscurl https://api.diseller.com/v1/payments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ord_456",
"amount": 5998,
"currency": "usd",
"payment_method": "card",
"card": {
"number": "4242424242424242",
"exp_month": 12,
"exp_year": 2026,
"cvc": "123"
}
}'Webhooks
Webhooks allow you to receive real-time notifications when events occur in your DiSeller account. Configure webhook endpoints to receive POST requests whenever specific events happen.
Available Events
order.createdorder.updatedorder.completedorder.cancelledpayment.succeededpayment.failedproduct.createdproduct.updatedcustomer.createdrefund.processedWebhook Payload Example
{
"id": "evt_123",
"type": "order.completed",
"created": 1642245600,
"data": {
"object": {
"id": "ord_456",
"status": "completed",
"total": 5998,
"customer_id": "cust_789"
}
}
}Security: Verify webhook signatures to ensure requests are coming from DiSeller. Check the X-DiSeller-Signature header on each webhook request.
Error Handling
The DiSeller API uses conventional HTTP response codes to indicate the success or failure of an API request.
HTTP Status Codes
Everything worked as expected.
The request was unacceptable, often due to missing a required parameter.
No valid API key provided.
The requested resource doesn't exist.
Too many requests hit the API too quickly.
Something went wrong on DiSeller's end.
Error Response Format
{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: name",
"param": "name",
"code": "parameter_missing"
}
}Rate Limiting
The DiSeller API implements rate limiting to ensure fair usage and system stability. Rate limits vary based on your plan.
Rate Limit Headers
Starter
1,000
requests per hour
Professional
10,000
requests per hour
Enterprise
Custom
Contact sales
SDKs & Libraries
We provide official SDKs and libraries to make integration easier in your preferred programming language.
Need help getting started?
Our developer documentation includes comprehensive guides, tutorials, and example projects to help you integrate DiSeller into your application.