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

Create a barcode

POST
/customers/{id}/barcodes

A barcode that identifies the customer and carries the rewards they want to use. Show it as a Code 128 barcode at a till, or pass it as the barcode of Create an order: the order's discounts use the rewards it carries. With no rewards it is the customer's plain barcode.

Whether a reward is still valid (not used, not expired) is checked when the order is priced, not here. See the Barcodes guide.

Path parameters

  • idintegerRequired

    The customer id.

Headers

  • Idempotency-Keystring · uuid

    A UUID (any version; UUIDv7 recommended) that makes a retry of this request safe. See the Idempotency guide.

Request body

application/json RequiredCreateCustomerBarcode

The rewards the barcode carries.

1 field
  • rewardsarray of object

    Rewards of the customer to use with this barcode, ids as in Get a customer's rewards. Empty or left out: the customer's plain barcode, which identifies the customer and carries no reward.

    2 fields
    • typeBarcodeRewardTypeRequired

      A kind of reward a barcode can carry.

      One of "voucher""stamp_voucher""time_limited_voucher"

    • idintegerRequired

      min 1

Responses

Success
  • 201 CreatedBarcode

    The barcode.

    1 field
    • codestring

      The value to show as a Code 128 barcode.

Errors
  • 401 UnauthorizedError

    The API key is missing, invalid or revoked.

    3 fields
    • messagestring

      What went wrong. The text may change; use error_code in your code.

    • error_codestring

      Machine-readable code of the problem, for example api_key_invalid; it does not change within v1. Every error has one: internal_server_error on a 500, undefined when the error has no specific code yet. See Errors for the list.

    • error_uidstring

      Identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

  • 403 ForbiddenError

    The Public API is disabled for this business.

    3 fields
    • messagestring

      What went wrong. The text may change; use error_code in your code.

    • error_codestring

      Machine-readable code of the problem, for example api_key_invalid; it does not change within v1. Every error has one: internal_server_error on a 500, undefined when the error has no specific code yet. See Errors for the list.

    • error_uidstring

      Identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

  • 404 Not FoundError

    The resource does not exist or does not belong to this business.

    3 fields
    • messagestring

      What went wrong. The text may change; use error_code in your code.

    • error_codestring

      Machine-readable code of the problem, for example api_key_invalid; it does not change within v1. Every error has one: internal_server_error on a 500, undefined when the error has no specific code yet. See Errors for the list.

    • error_uidstring

      Identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

  • 422 Unprocessable EntityError

    The request is invalid (the body has errors), or a reward is not the customer's at this business (reward_not_found).

    3 fields
    • messagestring

      What went wrong. The text may change; use error_code in your code.

    • error_codestring

      Machine-readable code of the problem, for example api_key_invalid; it does not change within v1. Every error has one: internal_server_error on a 500, undefined when the error has no specific code yet. See Errors for the list.

    • error_uidstring

      Identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

  • 429 Too Many RequestsRateLimitError

    More than 120 requests per minute for this business.

    Headers
    • Retry-Afterinteger

      Seconds to wait before the next request.

    4 fields
    • messagestring

      What went wrong. The text may change; use error_code in your code.

    • error_codestring

      Machine-readable code of the problem, for example api_key_invalid; it does not change within v1. Every error has one: internal_server_error on a 500, undefined when the error has no specific code yet. See Errors for the list.

    • error_uidstring

      Identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

    • retry_afterinteger

      Seconds to wait before the next request; the same value as the Retry-After header.

  • 500 Internal Server ErrorError

    Something failed on Lynked's side. Retry later; if it persists, contact Lynked support with the error_uid.

    3 fields
    • messagestring

      What went wrong. The text may change; use error_code in your code.

    • error_codestring

      Machine-readable code of the problem, for example api_key_invalid; it does not change within v1. Every error has one: internal_server_error on a 500, undefined when the error has no specific code yet. See Errors for the list.

    • error_uidstring

      Identifier of this error in Lynked's logs. Quote it when you contact Lynked support.

Request
curl -X POST 'https://api.lynked.ie/api/public/v1/customers/{id}/barcodes' \
  -H 'Authorization: Bearer lk_live_...' \
  -H 'Idempotency-Key: <unique-key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "rewards": [
    {
      "type": "voucher",
      "id": 812
    },
    {
      "type": "stamp_voucher",
      "id": 455
    }
  ]
}'
Request body · JSON
{
  "rewards": [
    {
      "type": "voucher",
      "id": 812
    },
    {
      "type": "stamp_voucher",
      "id": 455
    }
  ]
}
Response 201 Created
HTTP/3 201 Created
Content-Type: application/json
Body
{
  "code": "lynked_aB3dE9xYz"
}