5-Minute Quickstart
Get from zero to a live order in under 5 minutes using your preferred language.
1
Get your API key
In your Dark Obsidian dashboard: Settings → Developer → API Keys → Create Key
Your key will look like: do_live_abc123xyz456def789ghi012
Never share your API key. It has access to your entire business data. Treat it like a password.
2
Install the SDK or copy the file
# Copy dark-obsidian.js to your project, then:
const DarkObsidian = require('./dark-obsidian')import DarkObsidian from './dark-obsidian'pip install requests
# Copy dark_obsidian.py to your project// Copy DarkObsidian.php to your project
require_once 'DarkObsidian.php';# No install needed - use curl directly3
Connect to your account
const client = new DarkObsidian({ apiKey: 'do_live_YOUR_KEY' })from dark_obsidian import DarkObsidian
client = DarkObsidian(api_key='do_live_YOUR_KEY')$client = new DarkObsidian('do_live_YOUR_KEY');4
List your products
const products = await client.products.list({ in_stock: true })
console.log(`${products.length} products available`)products = client.products.list(in_stock=True)
print(f"{len(products)} products available")curl https://qatxonlxvtgxvqjgfxpl.supabase.co/functions/v1/api/products?in_stock=true \
-H "Authorization: Bearer do_live_YOUR_KEY"5
Create an order - the killer feature
One API call handles the entire sale lifecycle. Dark Obsidian automatically:
- Finds or creates the customer record
- Deducts stock from your warehouse
- Awards 1 loyalty point per currency unit spent
- Creates and attaches an invoice (if requested)
- Updates your financial reports with the income
- Fires the
sale.completedwebhook to your integrations
const order = await client.orders.create({
customer: {
name: 'John Doe',
email: '[email protected]',
},
items: [
{ product_id: products[0].id, quantity: 2 }
],
payment_method: 'card',
send_invoice: true,
})
console.log('Order:', order.order_number) // S-0042
console.log('Total:', order.total) // 199.98
console.log('Points earned:', order.loyalty_points_earned) // 199
console.log('Invoice:', order.invoice_id) // uuidorder = client.orders.create(
items=[{'product_id': products[0]['id'], 'quantity': 2}],
customer={'name': 'John Doe', 'email': '[email protected]'},
payment_method='card',
send_invoice=True,
)
print(f"Order: {order['order_number']}")
print(f"Total: {order['total']}")
print(f"Points: {order['loyalty_points_earned']}")$order = $client->orders->create(
[['product_id' => $products[0]['id'], 'quantity' => 2]],
[
'customer' => ['name' => 'John Doe', 'email' => '[email protected]'],
'payment_method' => 'card',
'send_invoice' => true,
]
);
echo "Order: " . $order['order_number'];curl -X POST \
https://qatxonlxvtgxvqjgfxpl.supabase.co/functions/v1/api/orders \
-H "Authorization: Bearer do_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer": {"name": "John Doe", "email": "[email protected]"},
"items": [{"product_id": "YOUR_PRODUCT_ID", "quantity": 2}],
"payment_method": "card",
"send_invoice": true
}'You're live! The order is saved, stock is deducted, loyalty points are awarded, and the invoice is created - all in a single API call.