API Reference

Complete REST API documentation for building powerful e-commerce integrations

RESTful API
OAuth 2.0
Real-time Webhooks

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:

HTTP
Authorization: Bearer YOUR_API_KEY

Example Request

cURL
curl https://api.diseller.com/v1/products \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
JavaScript
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');
Python
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/v1

Note: 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

GET

Retrieve resources

POST

Create new resources

PUT

Update existing resources

DELETE

Remove resources

Products API

The Products API allows you to create, retrieve, update, and delete products in your catalog.

List All Products

GET/products
cURL
curl https://api.diseller.com/v1/products \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

JSON
{
  "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

POST/products
cURL
curl 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

GET/products/:id
cURL
curl https://api.diseller.com/v1/products/prod_123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Update a Product

PUT/products/:id
cURL
curl -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

DELETE/products/:id
cURL
curl -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

GET/orders
cURL
curl https://api.diseller.com/v1/orders \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

JSON
{
  "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

POST/orders
cURL
curl 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

GET/customers
cURL
curl https://api.diseller.com/v1/customers \
  -H "Authorization: Bearer YOUR_API_KEY"

Create a Customer

POST/customers
cURL
curl 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

POST/payments
cURL
curl 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.created
order.updated
order.completed
order.cancelled
payment.succeeded
payment.failed
product.created
product.updated
customer.created
refund.processed

Webhook Payload Example

JSON
{
  "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

200OK

Everything worked as expected.

400Bad Request

The request was unacceptable, often due to missing a required parameter.

401Unauthorized

No valid API key provided.

404Not Found

The requested resource doesn't exist.

429Too Many Requests

Too many requests hit the API too quickly.

500Server Error

Something went wrong on DiSeller's end.

Error Response Format

JSON
{
  "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

X-RateLimit-Limit:1000
X-RateLimit-Remaining:999
X-RateLimit-Reset:1642245600

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.

Node.js

Official
bash
npm install diseller
View Documentation

Python

Official
bash
pip install diseller
View Documentation

PHP

Official
bash
composer require diseller/diseller-php
View Documentation

Ruby

Official
bash
gem install diseller
View Documentation

Need help getting started?

Our developer documentation includes comprehensive guides, tutorials, and example projects to help you integrate DiSeller into your application.