Developers
Merchant API overview
Connect your ecommerce store to Influencemart. Sync products and campaigns, report conversions and order-status updates, and receive performance-based affiliate sales — over a signed REST API, webhooks, or a CSV fallback.
Base URL: {API_BASE_URL} · versioned endpoints live under /api/v1. Every merchant request is authenticated with an API key and an HMAC signature — see Authentication.
How it works
- 1An affiliate shares a tracking link for your product or campaign.
- 2A buyer clicks it and is redirected to your store carrying affiliate_click_id.
- 3You store the click_id (cookie/session/cart/order).
- 4On purchase you report a conversion (with the click_id) via the API, webhook, or CSV.
- 5You send order-status updates so commissions settle correctly.
- 6Verified orders earn the affiliate commission; cancelled/returned/refunded reverse it.
Ways to integrate
API — most accurate, real-time. Webhooks — push events as they happen. CSV — upload products, orders and status updates if you can’t integrate the API yet. All three run through the same validation, deduplication and commission rules.
Test mode vs live mode
Test keys are prefixed ak_test_ and live keys ak_live_.
- •Test keys can be created as soon as you have an account; they exercise the full pipeline safely.
- •Live keys can only be created by an APPROVED merchant.
- •Both environments use identical signing, validation, dedup and commission rules.
- •The signing secret is shown only once, at key creation — store it securely.
Quick example
Sign `${timestamp}.${rawBody}` with HMAC-SHA256 and POST a conversion:
TS=$(date +%s)
BODY='{"clickId":"CLK_example123","externalOrderId":"ORD-1001","orderAmount":"2999.00","currency":"NPR"}'
SIG=$(printf '%s' "$TS.$BODY" | openssl dgst -sha256 -hmac "$AFF_API_SECRET" | sed 's/^.* //')
curl -X POST "$AFF_BASE_URL/v1/conversions" \
-H "X-API-Key: $AFF_API_KEY" -H "X-Timestamp: $TS" -H "X-Signature: $SIG" \
-H "X-Idempotency-Key: ORD-1001-conversion" \
-H "Content-Type: application/json" --data "$BODY"Downloads
Spec, Postman collection, and ready-to-run SDK samples (all use fake test credentials):
OpenAPI spec
OpenAPI 3.0 spec for the merchant v1 API.
Postman collection
Signed requests with an HMAC pre-request script.
Node.js SDK sample
Signing helper + product / conversion / webhook examples.
PHP SDK sample
Signing helper + import / conversion examples.
Python SDK sample
Signing helper + import / webhook examples.
cURL examples
Shell + openssl signing examples.
Merchant integration checklist
- 01Create a merchant account
- 02Complete your business profile
- 03Get admin approval
- 04Generate a test API key
- 05Implement HMAC signing
- 06Sync your product feed
- 07Create a campaign
- 08Receive click_id from the affiliate redirect
- 09Store click_id in session / cart / order
- 10Send a conversion API request
- 11Send order-status updates
- 12Test cancellation / refund / return
- 13Test duplicate-request handling
- 14Review your dashboard logs
- 15Request live API access