MMelo Developers

Errors

Handle Melo API failures consistently and decide when requests are safe to retry.

All API errors use the same JSON envelope:

{
  "type": "WAREHOUSE_NOT_FOUND",
  "message": "Warehouse not found",
  "code": 404
}
FieldDescription
typeStable machine-readable error identifier when provided by the API.
messageHuman-readable description intended for developers.
codeHTTP status code repeated in the response body.

Status codes

CodeMeaningClient behavior
400Invalid input or invalid resource stateCorrect the request; do not retry unchanged.
401Missing, invalid, expired, or revoked credentialsRefresh the token when expired; otherwise stop and inspect credentials.
403The merchant cannot access the resourceDo not retry without changing credentials or resource ownership.
404The requested resource does not existVerify the identifier and environment.
409The request conflicts with the resource's current stateRead the resource's current state; do not retry unchanged.
429Rate limit exceededBack off and retry later. See Rate limits.
500Unexpected server failureRetry with exponential backoff when the operation is safe to repeat.

Malformed requests are rejected with a 400 rather than a server error: an identifier in the URL that is not a UUID returns INVALID_PARAMETER, and a missing or malformed body returns VALIDATION_ERROR with the offending field named in message.

Rate limits

Limits are applied per client, and exceeding one returns 429 with type RATE_LIMIT_EXCEEDED.

ScopeLimit
All authenticated endpoints300 requests per minute
POST /options60 requests per minute
POST /auth/token, per client10 requests per 15 minutes

Access tokens are valid for one hour, so a healthy integration needs very few token requests. Cache the token until it expires rather than requesting one per call.

Common business errors

TypeEndpointMeaning
WAREHOUSE_NOT_FOUNDWarehouse operations, options, create transferThe pickup or destination warehouse ID does not exist.
WAREHOUSE_NOT_ACTIVEOptionsThe pickup or destination warehouse is disabled.
WAREHOUSE_LOCATION_MISSINGOptionsThe pickup or destination warehouse has no location set.
WAREHOUSE_HAS_TRANSFERS_ASSOCIATEDDelete warehouseHistorical transfers, as pickup or destination, prevent deletion.
PICKUP_OUT_OF_SERVICE_AREAOptionsThe pickup location, or the pickup warehouse's location, is outside the area we collect parcels from. Returned with 400.
DESTINATION_OUT_OF_SERVICE_AREAOptionsThe destination, or the destination warehouse's location, is outside the area we deliver to. Returned with 400.
NO_PRODUCTS_FOUNDOptionsNo delivery product is available for the request.
MATCHMAKING_NOT_FOUNDCreate transferThe quote ID does not exist.
PICKUP_CONTACT_REQUIREDCreate transferThe quote starts from a custom pickup location and the request has no pickupContact. Returned with 400; the quote stays usable.
PICKUP_CONTACT_NOT_ALLOWEDCreate transferThe quote starts from a warehouse, which supplies its own contact, and the request has a pickupContact. Returned with 400; the quote stays usable.
MATCHMAKING_INCORRECT_STATUSCreate transferThe quote has already been consumed or is not pending.
QUOTE_EXPIREDCreate transferThe quote is older than 10 minutes. Request a new one.
PRODUCT_NOT_FOUNDCreate transferThe product key was not returned by that quote.
DELIVERY_OPTION_PRICE_NOT_FOUNDCreate transferThe selected product has no payable price.
TRANSFER_NOT_FOUNDGet transfer, cancel transferThe transfer does not exist or is not an API-created transfer.
UNAUTHORIZEDOptions, create transfer, get transfer, cancel transferA warehouse or the transfer belongs to another merchant.
TRANSFER_NOT_CANCELLABLECancel transferShipping has started, or the transfer is already failed or cancelled. Returned with 409.
INVALID_PARAMETERAny endpoint with an ID in the pathThe identifier is not a valid UUID.
VALIDATION_ERRORAny endpoint with a bodyThe request body failed validation.
RATE_LIMIT_EXCEEDEDAny endpointToo many requests. See Rate limits.

Retry safety

GET requests are safe to retry. Token and quote requests may be retried after transient network failures. Transfer creation changes state and charges the merchant balance, so treat a timeout as an unknown result and avoid automatic retries until you can establish whether the transfer was created. Cancelling a transfer is safe to retry: if the first attempt succeeded, the retry returns 409 TRANSFER_NOT_CANCELLABLE and GET /transfer/{transferId} shows state: failed.

On this page