API reference

Customer endpoints

Endpoints for looking up, registering, updating, linking, merging, and viewing customers.

status.label is always English

A customer's status arrives as { "value": "active", "label": "Active" }. There is no request locale on this API and no server-side translation, so label carries the English word whichever language your integration speaks. Map value yourself. It is one of active, deactivated or anonymized, and those three are what the Puntjes portal translates.

An external_id that holds / cannot be used in a path

Puntjes stores an external_id with a / in it, but the /customers/by-external-id/{externalId} routes (update, send-card and loyalty-cards) cannot reach that customer. The path answers 404 ROUTE_NOT_FOUND, or 405 METHOD_NOT_ALLOWED when it happens to match another route, and sending the / as %2F does not help. Find the customer with GET /customers/lookup?external_id=, then use the routes that take the customer id. There is no update by id, so such a customer cannot be updated through the API.


Look up a customer

GET /api/v1/customers/lookup

Find a customer by any of their active identifiers (their loyalty card code or their email address), or by the external_id you assigned them in your own system.

Matching is case-insensitive: a scanner with Caps Lock on resolves the same customer as one without. It is also deliberately type-agnostic. The value is compared against every active identifier of your vendor regardless of its type, so identifier values issued before Puntjes narrowed the accepted types still resolve unchanged. Nothing you ever handed a customer stops working.

Query parameters

ParameterTypeRequiredDescription
identifierstringNoThe identifier value to search for: a loyalty card code or an email address
external_idstringNoYour own identifier for this customer, as supplied when registering them. This lookup also finds one that holds /

Provide exactly one of the two. Omitting both is a VALIDATION_ERROR; external_id takes precedence if you send both.

curl https://puntjes.app/api/v1/customers/lookup?identifier=K7M2QX4P \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

When you merge two accounts of one person, one account stays and the other closes. A closed account answers with merged_into_customer_id: the id of the account that stays. Read that account for the points, the card and the email address. For any other customer the key is null. When the shop anonymizes the account that stays, both accounts answer 404 CUSTOMER_NOT_FOUND.

groups lists the customer groups the customer is a member of, in alphabetical order of name as in a phone book: Élan comes before Fans. A capital letter or an accent counts only between names that are otherwise the same. Two groups with the same name follow their external_id. A customer in no group answers [].

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "wallet_balance": 1500,
        "is_deactivated": true,
        "merged_into_customer_id": null,
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
CUSTOMER_NOT_FOUND404No customer found with the given identifier

Register a customer

POST /api/v1/customers

Create a new customer. A wallet and a loyalty card are created automatically.

Every customer ends registration holding exactly one loyalty card. You either scan a pre-printed card and Puntjes assigns it, or you send no card at all and Puntjes issues one. Either way the resulting code comes back as loyalty_card_code in the response.

Request body

FieldTypeRequiredDescription
first_namestringNoCustomer's first name
last_namestringNoCustomer's last name
emailstringNoEmail address (unique per vendor)
phonestringNoPhone number
external_idstringNoYour own identifier for this customer (unique per vendor). One that holds / cannot be used in a by-external-id path
date_of_birthstringNoDate of birth (YYYY-MM-DD)
customer_sincestringNoThe date this person became your customer (YYYY-MM-DD). Omit it and Puntjes counts from the registration date.
localestringNoPreferred language: nl or en (default: nl)
marketing_consentbooleanNoOpt-in for campaign email. Defaults to off.
marketing_consent_statement_versionstringNoThe version of the consent wording you showed the customer, kept as evidence beside the grant, max 40 characters. Omit it and the record names the wording of the platform, even if you showed other wording. Ignored unless marketing_consent is true.
identifiersarrayNoArray of identifier objects. May be omitted or empty.
groupsarrayNoThe customer groups to put the customer in: at most 50 items of {external_id, name}, both required and max 255 characters. An external_id may appear only once per request; null is refused

Send marketing_consent: true only when the person in front of you actually said yes. Puntjes stamps the moment and records api as the surface it came through, and that pair is the evidence behind every campaign email you later send them.

Omitting the field and sending false do the same thing here: a customer who does not exist yet has no consent to withdraw. So an integration that has never heard of this field registers everyone unsubscribed, which is the intended default. Anything other than a boolean is rejected with VALIDATION_ERROR.

Customer groups at registration

Send groups to put the new customer in the groups your own system keeps, such as your staff or a club. Each item is { "external_id": "...", "name": "..." }. An external_id that Puntjes does not know yet makes the group. A known one adds the customer to that group; send a different name and the group takes that name for every member.

{
    "first_name": "Jan",
    "external_id": "POS-4471",
    "groups": [{ "external_id": "staff", "name": "Staff" }]
}

Groups move no points, so groups needs no idempotency_key. A second registration of the same customer still answers 409, and it changes no group.

The identifiers array

Each entry is an object, not a bare string:

FieldTypeRequiredDescription
typestringYesemail or loyalty_card. No other value is accepted
valuestringYesThe identifier value (max 255 characters)

At most one loyalty_card entry may be sent per registration; a customer carries one physical card. A loyalty_card value must match a card on your card list that nobody holds yet, unless your shop lets an unknown code become a card. See Register with a scanned card.

You do not need to send an email entry to make the address searchable. When you supply email on the customer itself, Puntjes maintains the matching identifier for you and keeps it in step with every later change to the address.

Omit identifiers entirely and let Puntjes issue the card. This is the simplest integration: there is no code to invent and no stock to keep.

{
    "first_name": "Jan",
    "last_name": "De Vries",
    "email": "jan@example.com",
    "phone": "+31612345678",
    "date_of_birth": "1990-05-15",
    "locale": "nl"
}
curl -X POST https://puntjes.app/api/v1/customers \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"first_name":"Jan","last_name":"De Vries","email":"jan@example.com"}'

Register with a scanned card

Send the code printed on the physical card the customer was handed. The card must already be on your card list without a customer, unless your shop accepts unknown codes (see below). Cards are generated in the admin portal under Loyalty cards and sent to a print shop from there.

{
    "first_name": "Jan",
    "last_name": "De Vries",
    "email": "jan@example.com",
    "identifiers": [{ "type": "loyalty_card", "value": "K7M2QX4P" }]
}
curl -X POST https://puntjes.app/api/v1/customers \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"first_name":"Jan","last_name":"De Vries","identifiers":[{"type":"loyalty_card","value":"K7M2QX4P"}]}'

Codes are matched case-insensitively, so a scanner that inverts case still finds the right card. The stored identifier always carries the casing that is printed on the card, not the casing that was scanned.

Codes that are not on your card list

Your customers may already carry a card that Puntjes did not make, for example one from your old loyalty system. Its code has no row on your card list, so by default the request fails with 422 LOYALTY_CARD_NOT_FOUND. Turn on Make a card from every new code in the admin portal under Settings › Loyalty, panel New card codes from the till, and the same request returns 201: the code becomes the customer's loyalty card and comes back as loyalty_card_code, in the casing you sent. The request body does not change.

The switch changes nothing else. A blocked card still returns 422 LOYALTY_CARD_NOT_FOUND. A code that belongs to a customer, a switched-off card included, still returns 409 IDENTIFIER_DUPLICATE, and so does that code in other casing. When two requests send the same new code at once, one gets 201 and the other 409 IDENTIFIER_DUPLICATE.

With the switch on, Puntjes cannot tell a mistyped code from a new one: both become a card.

Response (201 Created)

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

loyalty_card_code is the customer's card code hoisted to the top level so you do not have to filter the identifiers array to find it. Persist it as the customer's scannable value the moment registration returns. It is what a later lookup will match on.

It is a nullable string. In practice it is only null for customers created before loyalty cards existed and for customers whose identifiers have been erased by anonymization; a successful registration always returns a code.

A customer can hold several cards (up to five), for example after losing one and being handed a replacement at the counter. loyalty_card_code then reports the one card that is marked as theirs to scan, which is also what their wallet pass shows. Assigning a card in the admin portal makes that card the one to scan, so in practice it is the most recently assigned one; a customer migrated from another loyalty system instead keeps whichever card that system marked as their default.

Every other card stays active and keeps resolving at GET /customers/lookup, so a code you persisted earlier never stops working. Re-read loyalty_card_code when you want to display the card the customer is currently carrying.

Errors

CodeStatusDescription
EXTERNAL_ID_DUPLICATE409The external_id is already registered for this vendor
IDENTIFIER_DUPLICATE409The email or an identifier already belongs to another of your customers, a deactivated one included, or another customer claimed the card first. For a taken email, details.field is email
LOYALTY_CARD_NOT_FOUND422The loyalty_card value is not a card without a customer on your card list: blocked, or unknown while Make a card from every new code is off
MARKETING_CONSENT_UNDER_AGE422The date_of_birth makes this customer younger than 13, so marketing_consent cannot be recorded. Register them without it

Handling LOYALTY_CARD_NOT_FOUND at the counter

With Make a card from every new code off (the default), a submitted loyalty_card value must match a card on your card list that nobody holds yet and that the shop has not blocked. A code that was never generated, one that belongs to a different vendor, a mistyped code and a blocked card all return the same 422. The API deliberately does not reveal which. With the switch on, only a blocked card returns it: every code that is not on your list becomes a card.

The remedy is to rescan, or to retry without the identifiers array and let Puntjes issue a card. No customer, wallet or card is created when this error is returned, so the retry is clean.

Uniqueness

Email addresses and external_id values must be unique within a vendor, as must every identifier value. Registering a duplicate returns a 409 rather than a validation error, so your client can tell "this customer already exists" apart from "this request is malformed".


Update a customer

PUT /api/v1/customers/by-external-id/{externalId}

Update an existing customer, resolved by the external_id you assigned them. This is the write side of the POS sync: a change made at the register (a corrected email, a new phone number) reaches Puntjes without you having to store our customer ID.

Both PUT and PATCH behave identically, and both are partial updates: only the fields present in the body are changed. Omitting a field leaves it untouched. Sending null explicitly clears it.

The external_id lives in the URL, so it cannot be changed here: use PUT /customers/{customer}/external-id. Loyalty cards are not touched by this endpoint either. Cards are managed on their own routes. The customer must be live: soft-deleted, deactivated and anonymized customers are not found, and yield EXTERNAL_ID_NOT_FOUND rather than being silently recreated.

Path parameters

ParameterTypeDescription
externalIdstringThe external_id you assigned this customer in your own system. One that holds / cannot be used here

Every field is optional; send only what changed.

Request body

FieldTypeRequiredDescription
first_namestringNoMax 255 characters
last_namestringNoMax 255 characters
emailstringNoValid email address, max 255 characters
phonestringNoMax 50 characters
date_of_birthstringNoYYYY-MM-DD
customer_sincestringNoYYYY-MM-DD. Send null to clear it and fall back to the registration date.
localestringNonl or en
marketing_consentbooleanNotrue grants campaign-email consent, false withdraws it. Omit to leave the stored decision alone.
marketing_consent_statement_versionstringNoThe version of the consent wording you showed the customer, max 40 characters. Omit it and the record names the wording of the platform, even if you showed other wording. Ignored unless marketing_consent is true.
groupsarrayNoReplaces the customer groups: at most 50 items of {external_id, name}, both required and max 255 characters, each external_id once. Omit it to keep the groups; [] removes them all; null is refused

Changing email also updates the customer's email identifier, which Puntjes manages for you. You never add or remove that one by hand.

Omitting the field leaves the stored decision exactly as it is. Sending false withdraws it. That difference is the entire reason the field behaves the way it does: a POS that pushes a corrected phone number every evening must not unsubscribe every customer it touches, and neither you nor the customer would have any way to notice that it had.

{
    "email": "jan.devries@example.com",
    "phone": "+31698765432"
}
curl -X PATCH https://puntjes.app/api/v1/customers/by-external-id/POS-4471 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"jan.devries@example.com","phone":"+31698765432"}'

Customer groups

groups replaces the whole list

Sending groups replaces the customer's groups. Leave it out to keep them; send [] to remove them all.

An external_id that Puntjes does not know yet makes the group, and a known one with a new name renames that group for every member. Unlike the other fields, groups refuses null with VALIDATION_ERROR: send [] to empty the list. The call moves no points, so it needs no idempotency_key. Sending the same list twice leaves the same groups.

curl -X PATCH https://puntjes.app/api/v1/customers/by-external-id/POS-4471 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"groups":[{"external_id":"staff","name":"Staff"},{"external_id":"vip","name":"VIP"}]}'

Returns the full updated customer, in the same shape as GET /customers/{customer}.

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
EXTERNAL_ID_NOT_FOUND404No live customer of yours has this external_id
IDENTIFIER_DUPLICATE409Another of your customers, a deactivated one included, already uses this email, so nothing in the request is saved. details.field is email
MARKETING_CONSENT_UNDER_AGE422The stored or supplied date_of_birth makes this customer younger than 13, so marketing_consent: true is refused and nothing in the request is saved

Update a customer (PATCH)

PATCH /api/v1/customers/by-external-id/{externalId}

The same partial update as PUT /customers/by-external-id/{externalId} above, sent with PATCH. Only the fields in the body change, and the answer is the same.

Path parameters

ParameterTypeDescription
externalIdstringThe external_id you assigned this customer in your own system. One that holds / cannot be used here

Request body

FieldTypeRequiredDescription
first_namestringNoMax 255 characters
last_namestringNoMax 255 characters
emailstringNoValid email address, max 255 characters
phonestringNoMax 50 characters
date_of_birthstringNoYYYY-MM-DD
customer_sincestringNoYYYY-MM-DD. Send null to clear it and fall back to the registration date.
localestringNonl or en
marketing_consentbooleanNotrue grants campaign-email consent, false withdraws it. Omit to leave the stored decision alone.
marketing_consent_statement_versionstringNoThe version of the consent wording you showed the customer, max 40 characters. Omit it and the record names the wording of the platform, even if you showed other wording. Ignored unless marketing_consent is true.
groupsarrayNoReplaces the customer groups: at most 50 items of {external_id, name}, both required and max 255 characters, each external_id once. Omit it to keep the groups; [] removes them all; null is refused

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
EXTERNAL_ID_NOT_FOUND404No live customer of yours has this external_id
IDENTIFIER_DUPLICATE409Another of your customers, a deactivated one included, already uses this email, so nothing in the request is saved. details.field is email
MARKETING_CONSENT_UNDER_AGE422The stored or supplied date_of_birth makes this customer younger than 13, so marketing_consent: true is refused and nothing in the request is saved

POST /api/v1/customers/link-external-id

Attach your own external_id to a customer who does not have one yet, found by an identifier they already carry: their loyalty card code or their email address.

This is the backfill route. Customers who registered before you integrated your POS have no external_id, so PUT|PATCH /customers/by-external-id/{external_id} cannot address them and re-registering them would collide on their identifiers. Link them once, and every later update can be keyed on your own ID.

Request body

FieldTypeRequiredDescription
identifierstringYesA loyalty card code or email address the customer already has
external_idstringYesYour own key for this customer, unique per vendor. One that holds / cannot be used in a by-external-id path
curl -X POST https://puntjes.app/api/v1/customers/link-external-id \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"identifier":"K7M2QX4P","external_id":"POS-4471"}'

Linking is one-way

Sending the same external_id again succeeds, so retries and repeated backfill runs are safe. Sending a different one to a customer who is already linked returns CUSTOMER_ALREADY_LINKED rather than overwriting. Silently re-keying would break whatever system owns the existing ID, whose updates would start failing with no signal at the point of change. To change a key that is already set, use PUT /customers/{customer}/external-id.

Returns the full customer, in the same shape as GET /customers/{customer}.

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
CUSTOMER_ALREADY_LINKED409The customer is already linked to a different external_id
CUSTOMER_NOT_FOUND404No customer of yours carries that identifier
EXTERNAL_ID_DUPLICATE409Another of your customers already uses this external_id

Change an external ID

PUT /api/v1/customers/{customer}/external-id

Change the external_id of a customer, found by their numeric ID. Use it when your own system changes its key for the customer, for example after it merged two of its records.

The customer then answers to the new key only. PUT|PATCH /customers/by-external-id/{externalId} and GET /customers/lookup?external_id= no longer find them by the old one.

Path parameters

ParameterTypeDescription
customerstringThe customer ID

Request body

FieldTypeRequiredDescription
external_idstringYesYour new key for this customer, unique per vendor. One that holds / cannot be used in a by-external-id path
curl -X PUT https://puntjes.app/api/v1/customers/42/external-id \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"external_id":"ERP-20931"}'

A key is never shared, not even with a closed account

Another account of yours that holds the key blocks it with EXTERNAL_ID_DUPLICATE. That includes a deactivated customer, an account a merge closed and an anonymized customer: an account keeps its key, and one key belongs to one account only. Sending the key the customer already has succeeds and changes nothing, so a retry is safe.

A deactivated customer can get a new key. An account a merge closed, an anonymized customer and a customer of another vendor answer CUSTOMER_NOT_FOUND. The audit log records every change.

Returns the full customer, in the same shape as GET /customers/{customer}.

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "is_deactivated": true,
        "merged_into_customer_id": null,
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
CUSTOMER_NOT_FOUND404No customer of yours has this ID, or a merge closed the account, or the customer is anonymized
EXTERNAL_ID_DUPLICATE409Another account of yours holds this external_id, a deactivated, closed or anonymized one included

Get customer details

GET /api/v1/customers/{customer}

Retrieve a specific customer by their numeric ID.

A customer you deactivated is still shown. The answer then carries is_deactivated: true, and status.value is deactivated. For any other customer the is_deactivated key is absent, so the example below shows the one value it can have. An anonymized customer answers 404 CUSTOMER_NOT_FOUND.

When you merge two accounts of one person, one account stays and the other closes. A closed account answers with merged_into_customer_id: the id of the account that stays. Read that account for the points, the card and the email address. For any other customer the key is null. When the shop anonymizes the account that stays, both accounts answer 404 CUSTOMER_NOT_FOUND.

groups lists the customer groups the customer is a member of, in alphabetical order of name as in a phone book: Élan comes before Fans. A capital letter or an accent counts only between names that are otherwise the same. Two groups with the same name follow their external_id. A customer in no group answers [].

Path parameters

ParameterTypeDescription
customerstringThe customer ID

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "is_deactivated": true,
        "merged_into_customer_id": null,
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
CUSTOMER_NOT_FOUND404No customer of yours has this ID, or the customer was anonymized

Give a customer a card from the card list

POST /api/v1/customers/{customer}/loyalty-cards

Link a card from your card list to a customer that already exists, found by their numeric ID. Use it when a customer who already collects points takes a new card at the till. A new customer gets a card through identifiers on POST /customers instead.

The card becomes the primary card, so loyalty_card_code in every answer shows it. The points, the points history and the other cards of the customer stay. code must be a card without a customer on your card list. Make a card from every new code does not apply here: a wrong scan or a typo answers LOYALTY_CARD_NOT_FOUND and never becomes a card.

Send the code of the card the customer gives back in replaces. Puntjes switches it off in the same step, before it adds the new card, so a customer with 5 active cards (the maximum) can swap one. Only an active card of this customer is switched off. Any other value is ignored, and the new card is still added: an unknown code, a card that is already switched off, a barcode from another system, a card of another customer, or the value of code. Without replaces, every card stays active.

Path parameters

ParameterTypeDescription
customerstringThe customer ID

Request body

FieldTypeRequiredDescription
codestringYesThe code of a card without a customer on your card list
replacesstringNoThe code of the card the customer gives back. Only an active card of this customer is switched off
curl -X POST https://puntjes.app/api/v1/customers/42/loyalty-cards \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"K7QM4XPD","replaces":"HPNMDJGPPP"}'

A retry is safe

When code is already an active card of this customer, the call answers 200 and does not add it again. When replaces is already switched off, that card stays switched off. So you can repeat the call after a timeout, with no idempotency key. When the customer already holds the card in code but it is not the primary card, it becomes the primary card.

An ignored replaces is not an error. Read data.identifiers to see which cards are still active. A deactivated customer, or an account a merge closed, answers CUSTOMER_DEACTIVATED. Puntjes records the swap in its audit log: the new card, your API client and the card that was switched off.

Returns the full customer, in the same shape as GET /customers/{customer}.

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "is_deactivated": true,
        "merged_into_customer_id": null,
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
CUSTOMER_DEACTIVATED422The customer is deactivated, or a merge closed the account
CUSTOMER_NOT_FOUND404No customer of yours has this ID, or the customer is anonymized
IDENTIFIER_DUPLICATE409Another customer of yours holds this card
LOYALTY_CARD_LIMIT_REACHED422The customer holds 5 active cards, and replaces switches none of them off
LOYALTY_CARD_NOT_FOUND422code is not a card without a customer on your card list: it is unknown, blocked or switched off

Give a customer a card, by external ID

POST /api/v1/customers/by-external-id/{externalId}/loyalty-cards

The same call as POST /customers/{customer}/loyalty-cards, for the customer with this external_id. The rules for code, replaces and a retry are the same.

Path parameters

ParameterTypeDescription
externalIdstringThe external_id you assigned this customer in your own system. One that holds / cannot be used here

Request body

FieldTypeRequiredDescription
codestringYesThe code of a card without a customer on your card list
replacesstringNoThe code of the card the customer gives back. Only an active card of this customer is switched off
curl -X POST https://puntjes.app/api/v1/customers/by-external-id/POS-4471/loyalty-cards \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"K7QM4XPD","replaces":"HPNMDJGPPP"}'

Returns the full customer, in the same shape as GET /customers/{customer}.

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "is_deactivated": true,
        "merged_into_customer_id": null,
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Errors

CodeStatusDescription
CUSTOMER_DEACTIVATED422The customer is deactivated, or a merge closed the account
EXTERNAL_ID_NOT_FOUND404No live customer of yours has this external_id, or the customer is anonymized
IDENTIFIER_DUPLICATE409Another customer of yours holds this card
LOYALTY_CARD_LIMIT_REACHED422The customer holds 5 active cards, and replaces switches none of them off
LOYALTY_CARD_NOT_FOUND422code is not a card without a customer on your card list: it is unknown, blocked or switched off

Merge two customers

POST /api/v1/customers/{customer}/merge

Merge two accounts of the same person into one, as the shop can do in the admin portal. The customer in the path is the account that stays. The customer in source is the account that closes: it is deactivated, and its merged_into_customer_id becomes the id of the account that stays.

The loyalty cards, transactions, redemptions and vouchers of the closed account move to the account that stays. For the first name, last name, email, phone, date of birth and language, the account that stays keeps its own value. A field it has no value for takes the value of the closed account. The admin portal lets the shop choose per field. This endpoint does not.

The account that stays also takes the external_id of the closed account when it has none, and the older customer_since of the two. When the date of birth it takes makes the customer younger than 13, its marketing consent ends.

add_points decides what happens to the points of the closed account. With true they are added to the account that stays. With false they are lost, and the balance of the account that stays does not change. Either way the closed account ends at 0.

Path parameters

ParameterTypeDescription
customerstringThe customer ID

Request body

FieldTypeRequiredDescription
sourceintegerYesThe id of the customer whose account closes. Must be another customer than the one in the path
add_pointsbooleanYestrue adds the points of the closed account to the account that stays; false drops them
idempotency_keystringYesYour own key for this merge, so a retry merges nothing again (max 255 characters)

Example request

{
    "source": 7,
    "add_points": true,
    "idempotency_key": "merge-2024-0042"
}
curl -X POST https://puntjes.app/api/v1/customers/1/merge \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"source":7,"add_points":true,"idempotency_key":"merge-2024-0042"}'

Returns the account that stays, in the same shape as GET /customers/{customer}. The example below is the same as for that endpoint and shows a deactivated customer. A first merge needs an active account that stays, so its answer has no is_deactivated key. A retry returns the account as it is at that moment.

Response

{
    "data": {
        "id": 1,
        "first_name": "Jan",
        "last_name": "De Vries",
        "email": "jan@example.com",
        "phone": "+31612345678",
        "external_id": "POS-4471",
        "date_of_birth": "1990-05-15",
        "customer_since": "2019-04-02",
        "locale": "nl",
        "status": {
            "value": "string",
            "label": "string"
        },
        "identifiers": [
            {
                "id": 1,
                "type": "loyalty_card",
                "value": "K7M2QX4P",
                "is_active": true,
                "is_primary": true,
                "created_at": "2024-03-15T12:30:00Z"
            }
        ],
        "marketingConsent": false,
        "marketingConsentGrantedAt": "string",
        "marketingConsentGrantedSource": "string",
        "marketingConsentWithdrawnAt": "string",
        "marketingConsentWithdrawnSource": "string",
        "marketingConsentStatementVersion": "2026-09-04",
        "marketingConsentRecordedBy": "Till 1",
        "marketingConsentRecordedByClientId": "9d2c0b1e-4f7a-4c3b-9a1e-6b2f8d7c5e10",
        "loyalty_card_code": "K7M2QX4P",
        "deactivated_at": null,
        "anonymized_at": null,
        "created_at": "2024-03-15T12:30:00Z",
        "updated_at": "string",
        "is_deactivated": true,
        "merged_into_customer_id": null,
        "groups": [
            {
                "external_id": "vip",
                "name": "VIP customers"
            }
        ]
    }
}

Idempotency

An idempotency_key is unique per vendor: one key names one merge. Send the same key again with the same customer in the path, the same source and the same add_points, and the answer is always 200 with the account that stays, as it is now. Nothing moves a second time, so a retry after a network failure is safe. When the account that stays was merged into another account since then, the answer shows it: is_deactivated is true and merged_into_customer_id names the other account.

The same key with another customer in the path or in source, or with the other add_points, is a different merge. It is refused with IDEMPOTENCY_KEY_CONFLICT, and nothing changes.

When the customer in source is already merged into the customer in the path, through this endpoint or in the admin portal, a new key also answers 200 with the account that stays. Nothing moves. The reverse, with the two customers swapped, answers 422 CUSTOMER_DEACTIVATED.

Order of the checks

The checks run in this order. The first one that fails gives the answer:

  1. The body is invalid: 422 VALIDATION_ERROR.
  2. No customer of yours has the ID in the path or in source, or that customer was anonymized: 404 CUSTOMER_NOT_FOUND.
  3. Merging customers is not switched on for this vendor: 403 FEATURE_NOT_ENABLED.
  4. source is the customer in the path: 422 VALIDATION_ERROR, with details.source.
  5. The key belongs to another merge: 422 IDEMPOTENCY_KEY_CONFLICT.
  6. The key already names this same merge: 200, and nothing moves.
  7. The customer in source is already merged into the customer in the path: 200, and nothing moves.
  8. One of the two customers is deactivated, or was already merged into another customer: 422 CUSTOMER_DEACTIVATED.

Errors

CodeStatusDescription
CUSTOMER_DEACTIVATED422One of the two customers is deactivated, or was already merged into another customer
CUSTOMER_NOT_FOUND404No customer of yours has the ID in the path or in source, or that customer was anonymized
FEATURE_NOT_ENABLED403Merging customers is not switched on for this vendor
IDEMPOTENCY_KEY_CONFLICT422This idempotency_key was already used with another customer in the path or in source, or with the other add_points
Previous
Overview