Migrating from v1

This guide covers the authentication, endpoint, and behavior changes involved in moving a v1 integration to v2. The v2 API supports item operations, reporting, order-page configuration, and direct issuance under a negotiated contract. For a customer storefront, use the headless checkout workflow: catalog, quote, unpaid order, hosted QuickPay payment, and fulfillment.

Direct issuance and headless checkout use different order models. The direct-issuance capture operation activates an invoice-settled order; it does not confirm that a buyer paid. Confirm the appropriate payment model with Lifepeaks before changing an existing integration.

You can update read, redemption, and reporting operations independently of your payment workflow.

What changes

v1v2
CredentialOAuth2 access token from POST /tokenAPI key, Authorization: Bearer lp_live_…
Token lifetime24 h, refreshed with a refresh tokenNo expiry unless you set one at creation
PermissionsOAuth client scope (admin) plus per-user rightsLeast-privilege resource scopes on the key; settlement also needs an entitlement
Companycompany parameter on some calls; agencies act for manyUnchanged — optional company parameter, defaulting to the key's own company
Success body{"status": "OK", "response": …}The payload itself, unwrapped
Errorsstatus field plus a message{"error": {"code", "message", "fields"}} with non-2xx HTTP status codes
Read callsMostly POST with a JSON bodyGET with query parameters
LanguagePath prefix (/en/, /se/, /de/)Unchanged — the same prefixes apply
MoneyDecimal kroner everywhereUnchanged on compatibility and item routes; whole øre on the headless path
What you can sellGift cards only, one at a timeGift cards, experiences, event tickets and special offers, through one catalog and one order route

What v2 sells that v1 did not

v1 issues gift cards. v2's headless path sells four product families from one catalog, and all four use the quote, order, and checkout-session endpoints. Lifepeaks fulfills orders after payment confirmation:

FamilytypeProduct idOption id
Value gift cardgift_cardgift_card_value—
Experiencegift_card_variantgcv_<id>gcvo_<id>
Event ticketevent_ticketevt_<id>evto_<id>
Special offerspecial_offerso_<id>sov_<id>

Existing v1 integrations can continue using their current operations. POST /v2/items still issues gift-card value and nothing else, and the item, redemption and reporting routes read every family by code exactly as they always have — the type filter on GET /v2/items already accepts TICKET, SPECIALOFFER and BENEFITDEAL.

Three things a Lifepeaks operator issues by hand are deliberately outside the public API: ticket coupons, Saved Special Vouchers and New Special Vouchers. Benefit deals are read and redeemed by code, never bought. All four still appear at GET /v2/items and redeem at POST /v2/items/{code}/claim, and any of them prints at GET /v2/items/{code}/document.pdf.

Authentication

v1 uses an OAuth2 password grant: your client_id / client_secret plus a Lifepeaks username and password are exchanged at POST /token for a 24-hour access token, refreshed with a refresh token.

v2 uses an API key without a token-refresh step. Set an expiry when issuing the key, and rotate it by issuing a replacement and revoking the old key.

bash
curl -X POST https://api.lifepeaks.dk/v2/api-keys \
  -H "Authorization: Bearer lp_live_<an-existing-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Booking system",
    "scopes": ["items:read", "items:write", "orders:create"],
    "expires_in_days": 365
  }'

expires_in_days is optional — an integer from 1 to 365, counted from creation. Omit it and the key never expires; the response's expires_at is then null. There is no refresh flow: rotate by creating a new key and revoking the old one with DELETE /v2/api-keys/{id}.

Your first key comes from the admin panel (your company’s Settings > API tab); a key can only create keys whose scopes it already holds. See Authentication for the full lifecycle.

Scope mapping

Most v1 operations require the OAuth client scope admin and apply the authenticated user’s permissions. v2 uses separate resource scopes on the API key. User-level permissions do not apply to API keys; review the scope mapping and company-level settings below.

v1 actionv1 requirementv2 endpointv2 scope
POST /action/listscope adminGET /v2/itemsitems:read
GET /item/{code}scope adminGET /v2/items/{code}items:read
POST /item/{code}/claimscope admin, blocked for agency_userPOST /v2/items/{code}/claimitems:write
POST /item/{code}/refundscope admin, blocked for agency_userPOST /v2/items/{code}/refunditems:write
POST /item/{code}/cancelscope admin, needs agency_user or cancel_userPOST /v2/items/{code}/cancelitems:write
POST /item/{code}/activatescope adminPOST /v2/items/{code}/activateitems:write
POST /item/{code}/resendscope adminPOST /v2/items/{code}/resenditems:write
POST /action/create-gcscope admin, needs agency_userPOST /v2/items compatibility routeorders:create + orders:settle + active contract
POST /order/{order_id}/captureauthenticated userPOST /v2/orders/{order_id}/capture compatibility routeorders:settle + active contract
POST /order/{order_id}/claimscope adminPOST /v2/orders/{order_id}/claimitems:write
POST /event/listscope admin, blocked for agency_userGET /v2/eventsitems:read
POST /event/{slug}/participantsscope admin, blocked for agency_userGET /v2/events/{slug}/participantsreports:read
GET /list/gc-value-modificationsscope adminGET /v2/promotionsitems:read
POST /action/analyticsscope adminGET /v2/reports/analyticsreports:read
POST /action/claimed-itemsscope adminGET /v2/reports/claimed-itemsreports:read
GET /action/subscribersauthenticated user; no additional scope checkGET /v2/subscribersreports:read
GET /action/pingscope adminGET /v2/healthauthenticated API key

Account for these permission differences:

  • Cancel is no longer creator-restricted. v1 additionally narrows cancel to items the calling user created, unless the user holds cancel_user. A key has no creator, so authorization is scoped to the acting company: a key with items:write can cancel any of that company's cancellable items.
  • GET /v2/subscribers is now gated. In v1 the endpoint is ungated and any authenticated caller can read it. v2 requires reports:read, because the rows are names and email addresses.
  • Credential management is separate. Listing keys needs credentials:read; issuing or revoking them needs credentials:write.

Use GET /v2/promotions for gift-card campaigns. Its campaign IDs are accepted as promotion_id by POST /v2/items.

Company selection

In v1 an agency account passes company (a slug) to act for one of its assigned companies. v2 keeps that exactly as it was: pass company and the request acts on that company.

  • Omit it and the request acts on the API key's own company. That is the default and covers every single-company integration.
  • Pass it as the company query parameter and the request acts on that company, provided the slug is your own company or one Lifepeaks has assigned to yours. A POST or a PATCH may carry the same slug as a company field in its JSON body instead, and the query string wins when both carry it. The one exception is POST /v2/quotes, whose body does not accept company — name the company in its query string there.

One key can therefore serve an agency across all of its assigned companies, just as one v1 account did. A key per company remains equally valid. Only the API-key endpoints and GET /v2/health take no company parameter; they always act on the key's own company.

Anything outside that boundary is 404 not_found, never 403 — an unknown slug, an inactive company, and a company that belongs to someone else all answer the same way. v2 deliberately does not distinguish "does not exist" from "belongs to someone else".

Idempotent replays follow the same boundary. Compatibility operations record X-Request-Guid against the acting company. New durable headless operations require Idempotency-Key, also within the acting-company boundary.

Redemption of expired items

v2 follows the company-level claim_expired setting exactly:

  • claim_expired >= 0 — expired items stay redeemable for that many months after expiry, on every channel including v2. Past the grace period the claim fails with the company's grace-period message.
  • claim_expired = -1 — the company allows expired items to be redeemed, and v2 allows it.

The per-user claim_expired setting never applies to an API key, because a key is not a user and has no per-user settings to read. In v1 the user setting only takes effect when the company setting is -1, and it defaults to -1 itself, so for most companies the two behave identically and nothing changes on migration.

Creating gift cards

POST /v2/items is a negotiated compatibility operation for invoice-settled integrations. It preserves the familiar v1 field names, validation, campaign range rules, and response shape, but requires orders:create, orders:settle, and an active invoice-settlement contract. Send company in the query string or in the JSON body; the query string wins when both carry it.

amount here keeps v1's unit: a decimal in the company's currency, so 500 is a DKK 500.00 card. Existing v1 amounts move across unchanged. The headless routes are the ones that differ — see the callout at the top of this page.

For a new buyer-facing frontend, do not use this route. Use POST /v2/quotes, create an unpaid POST /v2/orders, and redirect through Lifepeaks-hosted QuickPay. Lifepeaks then controls payment, commission, and fulfillment. Those two calls take amount in whole øre, so multiply a v1 amount by 100.

The POS/PMS path stays on v1

v1 settles differently for a caller registered as a POS/PMS OAuth client: pay-on-location commission and payment type instead of invoice settlement. That behaviour is selected from the OAuth client id, which an API key does not have. The v2 compatibility create route is invoice-settled only and contract-gated.

If your integration is registered as a POS/PMS client, keep its create path on v1 until Lifepeaks agrees a v2 contract. Reading, redeeming, refunding, and reporting can move independently. Agency/marketplace, POS/PMS, pay-on-location, external-processor, and non-Lifepeaks settlement designs are negotiated and entitlement-gated; an API scope alone does not enable them.

Email delivery

Request attribution

API keys identify integrations rather than users. In redemption reports, claimed_by_username is null for API-key operations; staff operations retain the username. Use claim_note to associate a redemption with your own booking or transaction reference.

Compatibility capture is not payment capture

v1's capture finds the uncaptured order by the user who created it — one user cannot capture another's order, even inside the same company.

The v2 compatibility route narrows by company, but it only activates an invoice-settled gift-card order that was created with capture: false. It does not capture card funds and must not be used as evidence that a buyer paid. It requires orders:settle plus an active invoice-settlement contract.

Do not migrate the two halves of a public v1 payment workflow independently. For protected headless checkout, a browser redirect never proves payment; use the po_… order's canonical payment state and signed webhooks. An already activated compatibility order answers 404 because it is no longer in the uncaptured set.

Wonderbox and GoDream codes

The passthrough is supported on v2. v1 gates it on the logged-in user's claimable companies; v2 gates it on the company you are acting as, so a company with an enabled Wonderbox/GoDream integration can look up and redeem supported vendor codes. Other companies treat numeric codes as ordinary item codes.

One thing to keep in mind when reconciling: responses for vendor codes are synthesized from the vendor's API, exactly as in v1. Those rows are bounded by what your company's vendor account returns, not by Lifepeaks' own item filtering — so a vendor code can appear in a lookup even though no Lifepeaks item exists for it yet, and vendor rows will not necessarily line up with a GET /v2/items search over local data.

Response shape

v1 wraps the result in response:

json
{
  "status": "OK",
  "response": { "items": [], "itemsCount": 1 }
}

v2:

json
{ "object": "list", "data": [], "has_more": false, "next_cursor": null }

Item responses retain the field names reciever_name and reciever_email. Use these exact spellings when reading responses; request fields use receiver_name and receiver_email.

Response changes:

  • Cursor-paginated lists use a common envelope. Rows appear under data, with has_more and next_cursor. Analytics and claimed-item reports retain items and itemsCount; PDF-template and order-page revision responses have their own schemas. Check the response schema for each operation.
  • Subscribers were a bare array in v1’s response. v2 returns the cursor-paginated list envelope.
  • filter may appear in development responses. Production responses omit this diagnostic field.

v2 errors use non-2xx HTTP status codes. Check the HTTP status, then error.code: unauthorized (401), insufficient_scope (403), not_found (404), validation_failed (422). Field-level details may appear in error.fields, including on 422 and 409 insufficient_stock responses.

Idempotency

v1 and the v2 compatibility operations use the X-Request-Guid replay header. Every successful response to a compatibility mutation (POST /v2/items, compatibility capture, order claim, and the five item write operations) carries that response header. Send it back when retrying the identical request to replay the recorded response.

New durable headless operations use a required Idempotency-Key instead: order creation, order refund, checkout-session creation, negotiated settlement, greeting-image finalize, every PDF-template write (upload intent, finalize, publish, revert-to-default), webhook registration/rotation/replay and ping, and order-page draft create/publish/restore. Generate and persist a stable key before the first call. Use independent keys for independent operations, and never generate a new key inside a retry loop.

Two differences from v1 worth knowing:

  • v2 replays only for the company the original request acted on, and only after authentication — a GUID is not a bearer credential on v2.
  • v2 compatibility operations have no silent time-window replay (v1 replays an identical request from the same client within a few seconds even without the header). On a compatibility operation, no header means the request executes. Headless durable operations reject a missing Idempotency-Key.
  • v2 also covers the retry that arrives before the original has answered: it gets 409 request_in_progress with Retry-After rather than executing a second time. v1 has no such answer, so a v1 retry-on-timeout could act twice.

Migration checklist

  1. Issue a key with items:read only and re-point your read calls (GET /v2/items, GET /v2/items/{code}).
  2. Add reports:read and move analytics, claimed items and subscribers.
  3. Add items:write and move redemption, refund, cancel, activate and resend.
  4. Keep v1 creation in place until Lifepeaks confirms whether your existing invoice/POS/PMS contract is eligible for a v2 compatibility route.
  5. Design any new customer storefront as a separate protected headless integration with products:read, pickup_points:read, greeting_images:write, quotes:create, orders:create, orders:read, checkout:create, and the webhook scopes it needs.

After each step, verify permissions, company selection, response parsing, and retries in the demo environment. Test the complete payment and fulfillment workflow before changing production checkout.