Inventory

Resolve discrepancy

Closes a stock discrepancy with one of three actions.

POST
/v1/inventory-discrepancies/{id}/resolve

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 the publicationJobId. The discrepancy closes as republished.
  • accept_observed: accepts the marketplace number. Records an adjustment movement of difference units so the balance matches, and closes as accepted_observed. It adjusts the measured Variant (the discrepancy's variantId), even if the line now sells another. Only for a Variant with inventoryAuthority: marketapi. The warehouse that gets the adjustment is one of those mapped to the location: send warehouseId when 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 the manual policy.
  • dismiss: just closes it, as dismissed, 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: warehouseId missing (several warehouses on the location) or outside the location's map.
  • 409 discrepancy_not_open: already closed, by an earlier call or because the numbers matched again.
  • 409 inventory_authority: accept_observed on a Variant that is not marketapi.
  • 409 location_unmapped: accept_observed on a location with no warehouse in the map.
  • 409 publication_in_flight: accept_observed while 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. republish and dismiss are not affected.
  • 409 inventory_target_empty: republish found nothing to publish.
  • 409 inventory_underflow: the adjustment would leave the warehouse short.

Full list in Errors.

Authorization

api_key
headerAuthorizationBearer <token>

API key (mk_...)

Path Parameters

id*string

Identifier of the resource, as returned by the API.

Match^([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)$
Formatuuid

Header Parameters

Idempotency-Key?string

Optional. 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.

Length1 <= length <= 255

Request Body

application/json
  1. 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.

Value in"republish"

Response Body

The discrepancy, now resolved, with the movement and the publication job the action recorded (null when it recorded none).

application/json
  1. 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.

Match^([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)$
Formatuuid
curl -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}