Resolve discrepancy
Closes a stock discrepancy with one of three actions.
Publish inventory
- MockDevelopment only
- Mercado LivreNot supported
- MagaluPlanned
- AmazonPlanned
- TikTok ShopPlanned
- ShopeePlanned
Closes an open discrepancy. Pick the action in action:
republish: publishes marketapi's number again. Creates a stock job; the response has thepublicationJobId. The discrepancy closes asrepublished.accept_observed: accepts the marketplace number. Records anadjustmentmovement ofdifferenceunits so the balance matches, and closes asaccepted_observed. It adjusts the measured Variant (the discrepancy'svariantId), even if the line now sells another. Only for a Variant withinventoryAuthority: marketapi. The warehouse that gets the adjustment is one of those mapped to the location: sendwarehouseIdwhen there is more than one. The marketplace number (available + reserved) becomes the published number: a new read of the same number opens no discrepancy, and the next difference is measured against it, also under themanualpolicy.dismiss: just closes it, asdismissed, without touching stock. If the number is still different on the next read, a new discrepancy opens.
curl -X POST "$BACKEND_URL/v1/inventory-discrepancies/<id>/resolve" \
-H "Authorization: Bearer mk_your_api_key" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "action": "dismiss" }'warehouseId only works with accept_observed. Every resolution emits inventory.discrepancy_resolved.
Errors
404: the discrepancy does not exist in this account.400:warehouseIdmissing (several warehouses on the location) or outside the location's map.409discrepancy_not_open: already closed, by an earlier call or because the numbers matched again.409inventory_authority:accept_observedon a Variant that is notmarketapi.409location_unmapped:accept_observedon a location with no warehouse in the map.409publication_in_flight:accept_observedwhile a stock publication of the target is in flight, or the published number changed since the measurement. Nothing is written. A publication in flight ends in seconds: retry shortly. A changed number is measured again by the next read, which updates or closes the discrepancy: retry after it.republishanddismissare not affected.409inventory_target_empty:republishfound nothing to publish.409inventory_underflow: the adjustment would leave the warehouse short.
Full list in Errors.
api_keyAuthorizationBearer <token>API key (mk_...)
id*stringIdentifier of the resource, as returned by the API.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidIdempotency-Key?stringOptional. A unique value (for example a UUID), 1 to 255 characters, that makes the request safe to retry: repeating it with the same body within 24h returns the original response with Idempotency-Replayed: true instead of running the operation again. Scoped to your account. Reusing it with a different body returns 409.
1 <= length <= 255application/json- body
How to close an open discrepancy. republish creates the publication job of the target and closes it as republished. accept_observed records an adjustment of difference units, with the reference { type: "inventory_discrepancy", id }, only for a Variant managed by marketapi, and closes it as accepted_observed; warehouseId is accepted only with it. dismiss closes it as dismissed and changes nothing else.
action*"republish"Publish the current stock of the target again.
"republish"The discrepancy, now resolved, with the movement and the publication job the action recorded (null when it recorded none).
application/json- response
The discrepancy closed by the action and what it recorded.
discrepancy*The discrepancy after the action, status: resolved.
movement*|The adjustment recorded by accept_observed. null for the other actions.
publicationJobId*|Job that publishes the stock, created by republish or by the accept_observed movement. null when nothing is published.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidcurl -X POST "https://example.com/v1/inventory-discrepancies/3d1c8a52-7f0e-4b0a-8a65-9c1b2f6d7e01/resolve" \ -H "Content-Type: application/json" \ -d '{ "action": "dismiss" }'{ "discrepancy": { "id": "8e5c2a9f-61b3-4f07-a4d8-0b9c7e3d1f52", "sellerId": "3d1c8a52-7f0e-4b0a-8a65-9c1b2f6d7e01", "connectionId": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d", "marketplace": "mock", "locationId": "5d0c8e2a-7b41-4f36-9a58-1c2e3f4a5b6c", "variantId": "47c9f819-fcf6-4478-b21a-678ecc594a11", "listingId": "0e2ce906-a6ab-4101-9461-4168c8b6b902", "bindingId": "cb064b64-2f63-4c3e-aa42-f11ea0f82b17", "marketplaceProductVariantId": null, "publishedQuantity": 7, "observedAvailable": 5, "observedReserved": 0, "difference": -2, "status": "resolved", "resolution": "dismissed", "movementId": null, "publicationJobId": null, "detectedAt": "2026-10-12T06:05:00.000Z", "resolvedAt": "2026-10-12T07:00:00.000Z", "updatedAt": "2026-10-12T07:00:00.000Z" }, "movement": null, "publicationJobId": null}