Send every completed order to ShopMy for commission attribution.
POST https://api.shopmy.us/api/order_confirmation
Call this endpoint from your order confirmation page (or server) every time an order completes. ShopMy records every event you send and attributes a commission when the order matches a ShopMy click, code, or shopper. No API key is required — the event is matched to your brand through the page URL's domain.
Body fields
| Field | Type | Description | |
|---|---|---|---|
orderAmount | number | required | The order total, greater than 0. Send a plain number — no currency symbols or HTML. |
orderId | string | required | Your unique identifier for the order. Also used to match later updates and cancellations. |
currency | string | required | ISO currency code (USD, EUR, GBP, …). |
page_url | string | required | The URL of the page sending the event — ShopMy resolves your registered domain from it. |
clickId | string | recommended | The ShopMy click id stored in the shopper's sms_click_id cookie. The strongest attribution signal. |
code | string | optional | The discount code applied to the order, if any. |
test | boolean | optional | Marks the event as a test — counted separately, never billed. |
is_returning_customer | boolean | optional | Whether this shopper has ordered from you before. |
domain | string | optional | Explicit domain override when page_url can't carry it. |
returnWindowClosesAt | timestamp | optional | When the order's return window closes. |
Example
{
"orderAmount": 129.5,
"orderId": "1001234",
"currency": "USD",
"page_url": "https://yourstore.com/checkout/thanks",
"clickId": "<sms_click_id cookie value>",
"code": "CREATOR15"
}Responses
Every response is JSON and carries a success flag.
| Status | When | Body |
|---|---|---|
200 | The event was received and recorded — including orders ShopMy has nothing to attribute. | { "success": true, "message": "..." } |
400 | The request could not be processed as sent — the error field says why, and the matching outcome below carries the fix. | { "success": false, "error": "..." } |
Outcomes
Every request is recorded with an outcome code — the same codes shown on your Tracking Health page. Most outcomes are informational: they mean ShopMy received the order and simply found no commission to attribute. The error outcomes at the end mean something in the request needs fixing. Outcomes return HTTP 200 unless noted.
tracked
The order matched a ShopMy click, code, or shopper — a commission was created.
no_attribution
A direct order with no ShopMy attribution. Expected for most of your traffic; nothing to do.
duplicate_order
An order ID you already sent. The first event counted; this one was ignored. Returns HTTP 400.
shopify_handoff
Your Shopify integration already handles this order — the event was handed off to it.
blacklisted_code
The discount code on the order is excluded from tracking.
expired_click
A ShopMy click existed but fell outside the attribution window.
cross_brand_click
The click on the order belonged to a different brand.
property_mismatch
The order came from a different property than the click.
unregistered_property
The property sending the event is not registered with ShopMy.
click_not_found
A click id was sent but no matching click exists on file. Returns HTTP 400.
banned_user
The attributed account is inactive on ShopMy — no commission is created.
invalid_order_amount
Fix required. The orderAmount field is missing or not a usable number. Pass the order total as a number greater than 0, with no currency symbols or markup. Returns HTTP 400.
invalid_order_id
Fix required. The orderId field is missing or unusable. Pass your unique id for the completed order. Returns HTTP 400.
malformed_click_id
Fix required. The clickId sent could not be read. Pass the sms_click_id cookie value exactly as it was stored. Returns HTTP 400.
unresolved_domain
Fix required. The event arrived without a domain ShopMy could match to your account. Make sure page_url (or the domain field) matches the domain registered with ShopMy. Returns HTTP 400.
unregistered_code
Fix required. The discount code on the order is not registered to a ShopMy creator. If the code should track commissions, add it to the matching creator's account.
insert_failed
The event reached ShopMy but failed to save on our side. No change is needed from your team.
handler_error
The event hit a processing error on our side. No change is needed from your team.
