Outstanding Amount Sync
Use this API to keep each shop's outstanding balance in Mulltiply equal to the
balance in your accounting or ERP system. Send only the shop's syncId and its
current balance — no other customer data is needed.
At A Glance
/v2/retailers/sync-outstanding| Area | Detail |
|---|---|
| Base URL | https://api.mulltiply.com |
| Content type | application/json |
| Authentication | x-api-key request header |
| Request body | Single object or array of objects, up to 5000 per request |
| Match key | Shop syncId |
| Processing mode | Asynchronous background processing |
Headers
Content-Type: application/json
x-api-key: YOUR_API_KEY
Which syncId To Send
Outstanding amount is maintained per shop. Send the shop syncId — the value
sent as shops[].syncId in Customer Sync.
If no shop has that syncId, the value is tried as a retailer syncId, and
is accepted only when that retailer has exactly one shop in your store. This
covers retailers that were synced without shops.
| What you send | Result |
|---|---|
Shop syncId, e.g. "RET-1001/SHOP-001" | That shop is updated. Always preferred. |
Retailer syncId of a retailer with one shop, e.g. "RET-2001" | That retailer's only shop is updated. |
Retailer syncId of a retailer with several shops | Rejected as ambiguous. Send each shop's own syncId instead. |
A syncId that matches neither | Rejected: no shop found. |
A retailer with several shops can only be updated shop by shop. The API does not split or copy a retailer-level balance across its shops.
If one request contains both a shop's own syncId and its retailer's syncId,
the shop syncId row is used and the retailer row is reported as skipped.
Request Fields
| Field | Required | Type | Meaning |
|---|---|---|---|
syncId | Yes | string or number | Shop syncId from Customer Sync, or the retailer syncId of a single-shop retailer. |
outstandingAmount | Yes | number or numeric string | The shop's new total balance. outStandingAmount is accepted as an alias. |
outstandingAmount is the new balance, not an amount to add or subtract:
| Value sent | Result |
|---|---|
15400.50 | Balance becomes 15400.50 |
"1,250.00" | Commas are removed; balance becomes 1250 |
0 | Balance is cleared (shop has paid in full) |
-500 | Balance becomes -500 (advance / credit balance) |
Request Body
- Batch
- Single
- cURL
[
{ "syncId": "RET-1001/SHOP-001", "outstandingAmount": 15400.50 },
{ "syncId": "RET-1001/SHOP-002", "outstandingAmount": 0 },
{ "syncId": "RET-1002/SHOP-001", "outstandingAmount": "1,250.00" },
{ "syncId": "RET-1003/SHOP-001", "outstandingAmount": -500 }
]
{ "syncId": "RET-1001/SHOP-001", "outstandingAmount": 15400.50 }
curl --request POST \
--url 'https://api.mulltiply.com/v2/retailers/sync-outstanding' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[{"syncId":"RET-1001/SHOP-001","outstandingAmount":15400.50},{"syncId":"RET-1001/SHOP-002","outstandingAmount":0}]'
Processing Rules
- Each row is validated on its own. An invalid row is rejected; the other rows still sync.
- If the same
syncIdappears more than once in one request, the last row is used. - Valid rows are queued and the response returns immediately.
- In the background, each
syncIdis matched to a shop in your store: by shopsyncIdfirst, then by retailersyncIdif that retailer has exactly one shop. - A shop whose balance already equals the sent value is skipped.
- A
syncIdthat matches no shop is recorded as an error in the bulk upload log. Nothing is created. - Every changed balance is recorded in the shop's outstanding history.
Response
The response is returned immediately after validation. Processing continues in the background.
All Rows Valid
{
"bulkUploadLogId": 8421,
"totalRows": 4,
"queuedRows": 4,
"failed": 0,
"failedRows": [],
"message": "Rows are being synced. Rows whose syncId matches no shop will be listed on the bulk upload log."
}
Some Rows Invalid
{
"bulkUploadLogId": 8422,
"totalRows": 3,
"queuedRows": 1,
"failed": 2,
"failedRows": [
{ "row": 2, "itemName": "syncId missing", "errors": ["syncId is required"] },
{ "row": 3, "itemName": "syncId RET-1002/SHOP-001", "errors": ["outstandingAmount must be a number"] }
],
"message": "Rows are being synced. Rows whose syncId matches no shop will be listed on the bulk upload log."
}
All Rows Invalid
Nothing is queued.
{
"bulkUploadLogId": 8423,
"totalRows": 1,
"queuedRows": 0,
"failed": 1,
"failedRows": [
{ "row": 1, "itemName": "syncId RET-1001/SHOP-001", "errors": ["outstandingAmount is required"] }
],
"message": "No valid rows to sync. Please check failedRows."
}
| Field | Meaning |
|---|---|
bulkUploadLogId | ID of the bulk upload log for this request. The final result, including unmatched syncIds, is recorded there. |
totalRows | Total number of rows received. |
queuedRows | Rows that passed validation and were queued. |
failed | Number of rows rejected during validation. |
failedRows | Rejected rows: row (1-based position in the request), itemName, and errors. |
message | Human-readable status. |
Validation Errors
| Message | Cause |
|---|---|
syncId is required | Row has no syncId, or it is empty. |
outstandingAmount is required | Row has no outstandingAmount (or outStandingAmount). |
outstandingAmount must be a number | Value cannot be read as a number. |
No shop found for syncId <syncId> | Reported in the bulk upload log after processing: no shop in your store has this syncId. |
syncId <syncId> is a retailer with N shops; send the shop syncId instead | Reported in the bulk upload log: the retailer has more than one shop. |
Skipped: the same shop was already updated by its shop syncId <syncId> in this request | Reported in the bulk upload log: the request also contained the shop's own syncId, which was used instead. |
Request-level errors (the whole request is rejected):
| Message | Cause |
|---|---|
Request body must be a row or an array of rows | Body is empty, an empty array, or not an object. |
At most 5000 rows can be synced per request | Split the payload into smaller requests. |
Behavior Notes
| Behavior | Detail |
|---|---|
| Idempotency | Values are absolute. Re-sending the same balance changes nothing. |
| Full resend | Safe. Sending every shop on every run only updates shops whose balance changed. |
| Partial success | Invalid rows are skipped and reported; valid rows still sync. |
| Large payloads | Up to 5000 rows per request, processed in the background. |
| Order | Requests for the same store are processed in the order they were received. |
Implementation Checklist
- Sync customers and shops through Customer Sync first, with a
syncIdon every shop. - Send the shop
syncId. Use the retailersyncIdonly for retailers that have a single shop. - Send the shop's current total balance, not a delta.
- Send
0for shops that have fully paid, so their balance is cleared. - Keep each request to 5000 rows or fewer.
- Check the bulk upload log for
syncIds that matched no shop.