The Lynked Public API is in development. Endpoints will appear here as they go live.

Errors and rate limits

Errors#

The HTTP status code tells you whether a request succeeded: 2xx is success, 4xx and 5xx are failures. Every error response has the same body:

json
{
  "message": "Invalid API key",
  "error_code": "api_key_invalid",
  "error_uid": "3f9c2a1"
}
  • message — what went wrong. The text may change, so do not compare it in your code.
  • error_code — the code of the problem. Every error has one. Use it in your code to tell errors apart. A code does not change within v1; a new API version may change or drop it. See Error codes.
  • error_uid — the identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

A 422 Unprocessable Entity also lists the problems per request field in errors:

json
{
  "message": "email: This value is not a valid email address.",
  "errors": {
    "email": [{ "message": "This value is not a valid email address." }]
  },
  "error_code": "undefined",
  "error_uid": "3f9c2a1"
}
StatusMeaning
401 UnauthorizedThe API key is missing, invalid or revoked.
403 ForbiddenThe Public API is disabled, or a feature the request needs is turned off (for example customer notes).
404 Not FoundThe resource does not exist.
409 ConflictThe request conflicts with the current state: a request with the same Idempotency-Key is still running (see Idempotency), the order is no longer in progress, and so on. error_code says which.
422 Unprocessable EntityThe request is invalid: errors lists the fields and why, or error_code names a value Lynked cannot use (an unknown seller, barcode or reward).
429 Too Many RequestsThe rate limit is exceeded, see below.
500 Internal Server ErrorSomething failed on Lynked's side. Retry later; if it persists, contact support with the error_uid.

Rate limits#

The limit is 120 requests per minute, shared by all API keys.

Over the limit, requests get 429 Too Many Requests. How many seconds to wait before trying again is in the body as retry_after and in the Retry-After header (the same value):

json
{
  "message": "Too many requests",
  "error_code": "rate_limit_exceeded",
  "retry_after": 30,
  "error_uid": "3f9c2a1"
}

Error codes#

error_codeStatusMeaning
api_key_missing401The Authorization: Bearer lk_live_… header is missing.
api_key_invalid401The API key is unknown or revoked.
public_api_disabled403The Public API is disabled.
idempotency_key_invalid422Idempotency-Key is not a UUID.
idempotency_key_reused422The Idempotency-Key was already used with a different request.
idempotency_key_in_progress409A request with the same Idempotency-Key is still running.
rate_limit_exceeded429The rate limit is exceeded.
invalid_cursor422The cursor of a list request is not one Lynked gave.
customer_not_found404No such customer.
customer_lookup_invalid422Find a customer with exactly one of email, phone or barcode.
customer_identity_conflict409The phone and the email belong to different Lynked accounts.
customer_notes_disabled403Customer notes are turned off.
customer_note_not_found404No such note about this customer.
customer_group_not_found404No such customer group.
customer_not_deletable409The customer cannot be deleted; only customers you created through the API can be.
reward_not_found422The customer has no such reward at this business.
seller_not_found422No such seller.
barcode_not_found422No customer or staff member has this barcode.
order_not_found404No such order.
order_not_from_api409Only orders created through the API can be completed or canceled through it.
order_not_in_progress409The order is already completed or canceled.
staff_not_found404No such staff member.
staff_lookup_invalid422Find a staff member with exactly one of email or barcode.
staff_barcode_not_found422The staff member has no such barcode.
staff_cash_not_allowed422The business does not allow staff cash.
insufficient_cash_balance422The staff member's cash balance is lower than the cash to use.
webhook_subscription_not_found404No such webhook subscription.
webhook_subscription_duplicate409The URL is already subscribed to one of these event types.
webhook_subscription_limit_reached422An event type already has 5 subscriptions.
internal_server_error500Something failed on Lynked's side. Retry later; if it persists, contact support with the error_uid.
undefinedanyThe error has no specific code yet (for example a validation error); go by the HTTP status and message.

New codes are added as the API grows. Treat an unknown code by its HTTP status.