Credit Days Sync
Use this API to keep each shop's credit period in Mulltiply equal to the credit period in your accounting or ERP system. The credit period decides the payment due date of the shop's future orders.
At A Glance
/v2/retailers/sync-credit-days| 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
Credit days are 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 credit days 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. |
creditDays | Yes (the key must be present) | integer, numeric string, or null | Number of days after an order is placed before payment is due. |
| Value sent | Result |
|---|---|
30 or "30" | Orders placed from now on are due 30 days after they are placed. |
null or "" | The shop's credit terms are removed; new orders have no payment due date. |
0, 12.5, 400 | Rejected — must be a whole number from 1 to 365. |
Request Body
- Batch
- Single
- cURL
[
{ "syncId": "RET-1001/SHOP-001", "creditDays": 30 },
{ "syncId": "RET-1001/SHOP-002", "creditDays": 45 },
{ "syncId": "RET-1002/SHOP-001", "creditDays": null }
]
{ "syncId": "RET-1001/SHOP-001", "creditDays": 30 }
curl --request POST \
--url 'https://api.mulltiply.com/v2/retailers/sync-credit-days' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[{"syncId":"RET-1001/SHOP-001","creditDays":30},{"syncId":"RET-1002/SHOP-001","creditDays":null}]'
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 credit days already equal the sent value is skipped.
- A
syncIdthat matches no shop is recorded as an error in the bulk upload log. Nothing is created. - Every change is recorded in the shop's credit terms history and audit log.
Effect On Orders
- New credit days apply only to orders placed after the sync.
- Payment due dates on existing orders do not change.
- A shop can have either credit days or a fixed payment due date, not both. If a shop had a fixed due date set in Mulltiply, syncing credit days replaces it.
Response
The response is returned immediately after validation. Processing continues in the background.
All Rows Valid
{
"bulkUploadLogId": 8431,
"totalRows": 3,
"queuedRows": 3,
"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": 8432,
"totalRows": 3,
"queuedRows": 1,
"failed": 2,
"failedRows": [
{ "row": 2, "itemName": "syncId RET-1001/SHOP-002", "errors": ["creditDays must be a whole number between 1 and 365"] },
{ "row": 3, "itemName": "syncId RET-1002/SHOP-001", "errors": ["creditDays is required"] }
],
"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": 8433,
"totalRows": 1,
"queuedRows": 0,
"failed": 1,
"failedRows": [
{ "row": 1, "itemName": "syncId missing", "errors": ["syncId 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. |
creditDays is required | Row has no creditDays key. Send null to remove credit terms. |
creditDays must be a whole number between 1 and 365 | Value is 0, negative, a decimal, above 365, or not 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 credit days changes nothing. |
| Full resend | Safe. Sending every shop on every run only updates shops whose credit days 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. - Always include the
creditDayskey; usenullto remove a shop's credit terms. - Send whole numbers from 1 to 365 only.
- Keep each request to 5000 rows or fewer.
- Check the bulk upload log for
syncIds that matched no shop.