Welcome to the OffersInc Merchant API
Complete REST API for integrating DD credit transactions, offers, and customer management into your Point-of-Sale system, e-commerce platform, or custom application. Build powerful integrations with comprehensive endpoints covering the entire transaction lifecycle.
Base URL: https://offersinc.ca/api/v1
API Monitoring & Debugging
📊 Real-Time Request Logging
Every API request is automatically logged and visible in your merchant dashboard. Access comprehensive logs to debug issues and monitor API usage.
Access Your Logs:
- Dashboard: Settings → API Keys → View Logs
- View requests by specific API key or see all requests
- Filter by date, endpoint, HTTP method, status code, or errors only
What You Can See in Logs:
🔒 Security Note: Sensitive fields (passwords, PIN codes, API keys) are automatically redacted in logs for your protection.
Error Handling
Consistent Error Format
All API errors follow a standard JSON format for easy programmatic handling:
HTTP Status Codes
🔒 Security Promise
Stack traces, SQL queries, file paths, and internal system details are NEVER exposed in API responses.
Rate Limiting
Quick Start Guide
- 1 Get Your API Key: Generate from Settings → API Keys in your dashboard
- 2 Test Authentication: Call GET /merchant to verify your key works
- 3 Review Logs: Check dashboard to see your request logged
- 4 Build Integration: Use endpoints in this documentation
- 5 Monitor Usage: Track requests in real-time via dashboard
What You Can Build
🛒 E-Commerce Integration
Accept DD credits as payment method
📱 Custom POS Systems
Build your own point-of-sale software
💼 Accounting Integration
Sync transactions to QuickBooks/Xero
📊 Analytics Dashboards
Build custom reporting tools
API Key Authentication
All API requests must include your API key in the X-API-Key header.
🔑 Generating API Keys
- Log into your merchant dashboard
- Navigate to Settings → API Keys
- Click "Create API Key"
- Copy the key immediately (shown only once)
- Store your key securely (never commit to version control)
⚠️ Security Warning: Never expose API keys in client-side code (JavaScript, mobile apps). Use server-side proxies to protect your keys.
Code Examples
Here's how to authenticate API requests in different programming languages:
cURL (Command Line)
PHP (with Laravel HTTP Client)
Python (with Requests)
Node.js (with Axios)
Ruby (with HTTParty)
Security Best Practices
Complete Transaction Flow
Step-by-step guide: Validate → Charge → Confirm
💡 Transaction Flow Overview
Every DD credit transaction follows this secure 3-step process to ensure customers have sufficient balance before charging:
Validate Customer PIN
Check balance before charging
POST /api/v1/transactions/lookup-customer
What This Does:
- Validates the customer's PIN code
- Returns customer ID, name, and current DD balance
- Allows you to verify sufficient balance before charging
- Does NOT charge or create any transaction
⚠️ Important: This is a read-only operation. No DD credits are deducted at this step.
🔒 Privacy: For customer privacy protection, this endpoint only returns customer ID, name, and DD balance. Sensitive personal information (email, phone, address) is never exposed via API.
Example Request:
Example Response:
Process Transaction
Charge DD credits and create transaction
POST /api/v1/transactions
What This Does:
- Deducts DD credits from customer's balance
- Creates a permanent transaction record
- Calculates discount based on offer rules
- Returns transaction ID for confirmation
🔒 Critical: This immediately deducts DD credits. Ensure customer has sufficient balance first (Step 1).
Example Request:
Example Response:
Get Transaction Details
Retrieve complete details for receipt
GET /api/v1/transactions/{id}
What This Does:
- Retrieves complete transaction details
- Includes customer info, offer details, amounts
- Use this to print receipts or show confirmation
- Can be called multiple times (read-only)
✅ Best Practice: Always retrieve and show transaction details to customer for confirmation.
Example Request:
Example Response:
Transaction Complete! 🎉
You've successfully processed a DD credit transaction
💡 Pro Tips
/merchant
Retrieve complete details about your merchant account including business information, contact details, and account status. Use this endpoint to verify API connectivity and display merchant information in your application.
Responses
200 Successfully retrieved merchant information
401 Unauthorized - Invalid or missing API key
Code Examples
/merchant/balance
Retrieve your current DD credit balance and comprehensive transaction statistics. This endpoint shows how many DD credits you've purchased, spent, and have available, plus detailed metrics about your transaction volume and customer reach.
Responses
200 Successfully retrieved balance and statistics
Code Examples
/merchant/statistics
Retrieve detailed transaction statistics for a specific date range, including daily breakdowns. Perfect for generating reports, analyzing trends, and tracking performance over time.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| start_date |
string
|
Optional | Start date for statistics (YYYY-MM-DD format). Defaults to 30 days ago if not specified. |
| end_date |
string
|
Optional | End date for statistics (YYYY-MM-DD format). Must be after or equal to start_date. Defaults to today if not specified. |
Responses
200 Successfully retrieved statistics
422 Validation Error - Invalid date format or end_date before start_date
Code Examples
/offers
Retrieve all DD credit offers for your merchant account with powerful filtering options. Filter by status, approval status, POS availability, and more. Essential for building offer selection interfaces in your POS or e-commerce system.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| status |
string
|
Optional | Filter by offer status: active, Loaded, paused, expired |
| approval_status |
string
|
Optional | Filter by approval status: approved, pending, rejected |
| pos_enabled |
boolean
|
Optional | Filter offers available for POS transactions (true/false) |
| active_only |
boolean
|
Optional | Return only currently active, approved offers (true/false) |
Responses
200 Successfully retrieved offers list
Code Examples
/offers/pos
Retrieve only offers that are enabled for point-of-sale transactions. This is a convenience endpoint that automatically filters for POS-enabled, active, approved offers - perfect for POS systems that need a simple list of valid offers.
Responses
200 Successfully retrieved POS offers
Code Examples
/offers/{id}
Retrieve complete details for a specific offer by ID. Returns full offer information including terms, conditions, validity periods, and all configuration details.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id |
integer
|
Required | Offer ID |
Responses
200 Successfully retrieved offer
404 Offer not found
Code Examples
/offers/calculate
Calculate the exact DD discount for a given offer and purchase amount. Use this before processing a transaction to determine how much DD credit to charge and how much discount to apply. Essential for dynamic pricing and accurate transaction processing.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| offer_id |
integer
|
Required | The offer ID to calculate |
| quantity |
integer
|
Optional | Number of items (default: 1) |
| total_amount |
number
|
Optional | Total purchase amount before discount |
Responses
200 Successfully calculated discount
400 Invalid calculation parameters
404 Offer not found
Code Examples
/transactions/lookup-customer
Step 1: Validation
STEP 1: Validate customer PIN and check DD balance before processing transaction
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_code |
string
|
Required | No description provided |
Responses
200 Customer validated
404 Invalid PIN
Code Examples
/transactions/{id}
Step 3: Confirm
STEP 3: Retrieve complete transaction details for confirmation and receipts
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id |
integer
|
Required | No description provided |
Responses
200 Transaction retrieved
404 Transaction not found
Code Examples
/transactions
Retrieve paginated transaction history with filtering
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| start_date |
string
|
Optional | No description provided |
| end_date |
string
|
Optional | No description provided |
| customer_id |
integer
|
Optional | No description provided |
| per_page |
integer
|
Optional | No description provided |
Responses
200 Success
Code Examples
/transactions
Step 2: Charge
STEP 2: Charge customer DD credits and create transaction record
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_code |
string
|
Required | No description provided |
| offer_id |
integer
|
Required | No description provided |
| total_amount |
number
|
Required | No description provided |
| dd_credits_to_use |
number
|
Required | No description provided |
| discount_amount |
number
|
Required | No description provided |
| cash_paid |
number
|
Optional | No description provided |
| reference_number |
string
|
Optional | No description provided |
Responses
201 Transaction created
400 Insufficient balance
Code Examples
/pos/employees
Retrieve all employees for your merchant account with powerful filtering. Manage your team, track active staff, and organize by role. Essential for building custom POS systems and employee management interfaces.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| active_only |
boolean
|
Optional | Filter to active employees only (true/false) |
| managers_only |
boolean
|
Optional | Filter to managers only (true/false) |
| include_deleted |
boolean
|
Optional | Include deactivated employees (true/false) |
Responses
200 Successfully retrieved employees
Code Examples
/pos/employees
Add a new employee to your team with PIN-based authentication. Assign manager role and set initial active status. PIN must be unique within your merchant account.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| name |
string
|
Required | No description provided |
| pin_code |
string
|
Required | No description provided |
| is_manager |
boolean
|
Optional | No description provided |
| is_active |
boolean
|
Optional | No description provided |