Update a tracked order's amount after returns or edits.
POST https://api.shopmy.us/api/Affiliates/update
Call this endpoint whenever an order's total changes — a partial return, an edited line item, an adjusted discount. ShopMy finds the commission created for the original order and updates its amount.
Authentication
Authenticate with your brand's developer API key:
Authorization: Bearer <your developer key>
Your brand is identified from the key. If you don't know your key, reach out to your ShopMy account manager.
Body fields
| Field | Type | Description | |
|---|---|---|---|
order_id | string | required | The same order id you sent on the original order confirmation. |
new_order_amount | number | required | The order's new total, as a parseable number. |
currency | string | required | ISO currency code (USD, EUR, GBP, …). |
domain | string | optional | The storefront domain the order belongs to, when you operate several. |
test | boolean | optional | Marks the event as a test — counted separately, never billed. |
Example
{
"order_id": "1001234",
"new_order_amount": 89.0,
"currency": "USD"
}Responses
Every response is JSON and carries a success flag.
| Status | When | Body |
|---|---|---|
200 | The event was received and recorded — including updates for orders ShopMy never tracked. | { "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": "..." } |
401 | The Authorization header is missing or carries an invalid key. | { "success": false, "error": "..." } |
Outcomes
Every request is recorded with an outcome code — the same codes shown on your Tracking Health page. Outcomes return HTTP 200 unless noted.
tracked
The commission was found and its amount updated.
order_not_found
No ShopMy commission exists for this order_id — usually the original order had no ShopMy attribution. Returned as a success; nothing to do.
invalid_params
Fix required. The request is missing required fields. Every update must carry the order_id, currency, and new_order_amount. Returns HTTP 400.
invalid_order_amount
Fix required. The new_order_amount field could not be parsed as a number. Send the new total as a plain number. Returns HTTP 400.
unresolved_domain
Fix required. Your brand could not be resolved from the request. Check that your Authorization header carries your developer key. Returns HTTP 400.
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.
