Headless checkout

Build a storefront in your own brand with Lifepeaks as the commerce backend. Your application manages the customer experience. Lifepeaks provides the authoritative catalog and authoritative quote, and manages commission, hosted QuickPay checkout, canonical order state, and fulfillment.

Checkout workflow

  1. Read GET /v2/products from your backend. Each product includes prices, delivery_methods, personalization, and terms. Follow pagination to retrieve the full catalog.
  2. Send the buyer's selection and delivery choice to POST /v2/quotes. Lifepeaks returns the total, including fees and postage.
  3. After the buyer confirms, create an unpaid order with POST /v2/orders, including the greeting and delivery choice.
  4. Create a checkout session at POST /v2/orders/{order_id}/checkout-sessions and redirect the browser to the returned QuickPay URL.
  5. QuickPay returns the browser to your return_url. A browser return never proves payment.
  6. Read GET /v2/orders/{order_id} from your backend to confirm payment and fulfillment state. Verify signed webhooks against the raw request body before processing notifications.
  7. Lifepeaks starts fulfillment after confirmed payment. Show fulfillment as complete only when fulfillment.status is fulfilled.
  8. After fulfillment, download each line's document from pdf.url through your backend. For an item code, use GET /v2/items/{code}/document.pdf.
Headless checkout workflow

Loading diagram. Its source is available below.

Diagram source
sequenceDiagram
    accTitle: Headless checkout workflow
    accDescr: The browser uses the partner backend for API calls and Lifepeaks-hosted QuickPay for payment. Browser returns and verified webhooks prompt a canonical order read; neither alone proves payment or fulfillment.
    participant Browser as Buyer's browser
    participant Partner as Partner backend
    participant Lifepeaks as Lifepeaks

    Note over Browser,Lifepeaks: 1. Prepare checkout (API key stays on the partner backend)
    Browser->>Partner: Browse and confirm selection
    Partner->>Lifepeaks: Read catalog, quote, create unpaid order
    Partner->>Lifepeaks: Create checkout session
    Lifepeaks-->>Partner: Checkout URL
    Partner-->>Browser: Redirect to checkout URL

    Note over Browser,Lifepeaks: 2. Pay on Lifepeaks-hosted QuickPay
    Browser->>Lifepeaks: Complete hosted payment

    Note over Browser,Lifepeaks: 3. Reconcile (return and webhooks can arrive in either order)
    Lifepeaks-->>Browser: Redirect to partner return URL
    Browser->>Partner: Request order status
    Lifepeaks-->>Partner: Signed webhook (verify and deduplicate)
    Partner->>Lifepeaks: GET /v2/orders/{order_id}
    Lifepeaks-->>Partner: Canonical payment and fulfillment state
    Partner-->>Browser: Show verified order status
    Note over Browser,Lifepeaks: Show delivery as complete only when fulfillment.status is fulfilled

Approve your return URL

Lifepeaks sends the buyer back only to a return_url it has approved for the company. Any other address answers 422 on return_url at POST /v2/orders and at checkout.

  • The company website. A return_url on the domain of the company website, or on any subdomain of it, is approved. A leading www. is ignored, so https://www.example.com approves example.com, www.example.com and staging.example.com. Set the website in the Lifepeaks company settings or with PATCH /v2/companies/{slug}/settings.
  • Other domains. When the storefront runs on a different domain, register its origin with POST /v2/return-origins. List origins with GET /v2/return-origins and remove one with DELETE /v2/return-origins/{return_origin_id}.

Both need the companies:write scope. The return URL must use HTTPS.

bash
curl -sS -X PATCH https://api.lifepeaks.dk/v2/companies/acme-spa/settings \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"website":"https://www.acme-spa.example"}'

curl -sS -X POST https://api.lifepeaks.dk/v2/return-origins \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin":"https://gifts.acme-partner.example"}'

1. Read the catalog

GET /v2/products returns the products available for API checkout. Read current limits and fees from the response.

bash
curl -sS https://api.lifepeaks.dk/v2/products \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY"

Four product families share the list, and the type field says which one each entry is:

  • gift_card_value (type: gift_card) is the variable-value gift card. It has a tenant-specific minimum and maximum, quantity limits, and an order fee. How it can be delivered is a property of the company rather than of the product, and is carried on it as delivery_methods. It also carries the company's open campaigns in promotions, so you can render the offers without a second call.
  • gcv_<id> (type: gift_card_variant) is one experience the company sells. It is priced by the option the buyer picks, so each entry carries an options array of gcvo_<id> entries with their own amount, order_fee, quantity bounds, and stock.
  • evt_<id> (type: event_ticket) is one event. It carries an event block with the dates, the venue, the collection points and what the organiser asks of a buyer, and one evto_<id> option per ticket type.
  • so_<id> (type: special_offer) is one discounted offer, sold as a voucher. Each sov_<id> option publishes what it costs now, what it cost before, and what the voucher is worth when it is spent.

Read fee_basis on every product. Gift cards, experiences, and special offers use per_line; events use per_ticket. For example, a two-seat event line incurs two ticket fees.

Ticket coupons and the Saved and New Special Vouchers are issued by an operator in the Lifepeaks back office and never appear here. Benefit deals are read and redeemed through /v2/items, never bought.

Identify products by type and id, rather than their position in the list. Use limit and starting_after for pagination, and type or category to filter the catalog. Product availability and configuration may change between requests.

If a company has no configured gift-card amount limits, gift_card_value is absent from the catalog and GET /v2/products/gift_card_value returns 404 not_found. Available experiences remain accessible through the catalog, quote, and order endpoints.

Experiences with active gift-card campaigns are temporarily excluded from API checkout because campaign pricing is not supported for these products. They are absent from the catalog, return 404 on individual lookup, and cannot be quoted or ordered until the campaign ends. Direct buyers to the Lifepeaks-hosted order page for these experiences.

All four families use the same quote and order endpoints. An order carries up to twenty lines. Gift cards (variable-value and experience lines) and special offers may share one order, paid in one checkout, and each of those lines may carry its own recipient and greeting. Event tickets are ordered on their own; a request mixing them with another family returns 422.

Endpoints — The product catalog documents every field, the filters, and the 404-never-403 rule for one product by id.

2. Request authoritative pricing

bash
curl -sS -X POST https://api.lifepeaks.dk/v2/quotes \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"product_id":"gift_card_value","amount":50000,"quantity":1}]}'

An experience is quoted by naming the option the buyer picked instead of an amount, and one quote may carry up to twenty such lines:

bash
curl -sS -X POST https://api.lifepeaks.dk/v2/quotes \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":[
        {"product_id":"gcv_4821","product_option_id":"gcvo_9107","quantity":2},
        {"product_id":"gcv_4821","product_option_id":"gcvo_9108","quantity":1}
      ]}'

An event or a special offer is quoted the same way, by naming the option:

bash
curl -sS -X POST https://api.lifepeaks.dk/v2/quotes \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"product_id":"evt_412","product_option_id":"evto_9310","quantity":2}]}'

Only variable-value gift-card lines accept amount. Other families use the selected option’s price and reject a supplied amount with 422. Automatic gift-card campaigns are not applied to option-priced lines; eligible discount codes are handled separately.

Render amounts.currency, subtotal, discount, fees, shipping, tax, and total from this response, and line_items when you show a basket. total is subtotal − discount + fees + shipping, and tax is not a term in that sum. It is the VAT on the order fee and the shipping, not on the face value of the card, which is taxed when the card is spent rather than when it is bought. shipping is 0 unless the quote carried a postal delivery object, so send the buyer's delivery choice with the quote once they have made it. discount is 0 unless the quote carried a discount_code. A quote has an expires_at; refresh it after expiry. Lifepeaks also calculates the order amount server-side, so compare the new order totals with the quote before redirecting the buyer.

Fees depend on fee_basis. Gift-card, experience, and special-offer fees apply once per line, regardless of quantity. Event fees apply once per ticket.

Bound your quantity control by the option's quantity.maximum. It is the number the quote and the order enforce, not a display hint, and availability is checked again when the order is created. An order also issues at most 1000 items across all of its lines.

A quote does not reserve stock. Lifepeaks checks quantity limits, stock, and capacity again when creating the order. A special-offer line that sells out after quoting returns 409 insufficient_stock. A quantity outside its option’s bounds returns 422 with below_minimum or above_maximum. Handle these responses before opening checkout. Quote and order lines lists the rules for each family.

3. Create one unpaid order

Create and durably store the order's Idempotency-Key before the first request. Reuse that exact key only when retrying the identical operation and body.

bash
curl -sS -X POST https://api.lifepeaks.dk/v2/orders \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Idempotency-Key: order_checkout_018f4f37b949" \
  -H "Content-Type: application/json" \
  -d '{
    "items":[{"product_id":"gift_card_value","amount":50000,"quantity":1}],
    "sender":{"name":"Alex Sender","email":"alex@example.com"},
    "recipient":{"name":"Sam Recipient","email":"sam@example.com"},
    "client_reference":"cart_018f4f37b949",
    "locale":"da-DK",
    "return_url":"https://partner.example/checkout/return"
  }'

The 201 response is an unpaid po_… order. Creating it does not confirm payment and does not authorize fulfillment.

An experience order sends the same body with experience lines, and the response echoes them as line_items:

bash
curl -sS -X POST https://api.lifepeaks.dk/v2/orders \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Idempotency-Key: order_experience_018f4f37b949" \
  -H "Content-Type: application/json" \
  -d '{
    "items":[
      {"product_id":"gcv_4821","product_option_id":"gcvo_9107","quantity":2},
      {"product_id":"gcv_4821","product_option_id":"gcvo_9108","quantity":1}
    ],
    "sender":{"name":"Alex Sender","email":"alex@example.com"},
    "recipient":{"name":"Sam Recipient","email":"sam@example.com"},
    "client_reference":"cart_018f4f37b949",
    "locale":"da-DK",
    "return_url":"https://partner.example/checkout/return"
  }'

For event or special-offer orders, use the corresponding product and option IDs. Event lines may also require a ticket object, as described below.

Besides items, sender, recipient, return_url, client_reference and locale, the body accepts greeting, delivery, marketing_consent, discount_code and gift_cards, each covered below. These fields are optional. The object fields have closed schemas: unknown properties return 422 with the field name. discount_code is a string.

Each order has one payable total and one payment workflow. Order creation is atomic: if any line fails, no order is created and no stock is reserved. The idempotency key is released so the identical request can be retried after the issue is resolved.

Order totals support up to six significant digits. For example, DKK 9,000.70 and DKK 100,050.00 are supported; DKK 10,024.95 is not. Unsupported totals return 422 amount_precision_unsupported before order creation or stock reservation, and release the idempotency key. Quotes do not enforce this limit. If necessary, split the basket into separate orders and obtain buyer approval for the revised checkout.

What an event line asks for

Event lines accept a ticket object. Its required fields depend on the event and selected option.

json
{
  "items": [{
    "product_id": "evt_412",
    "product_option_id": "evto_9310",
    "quantity": 2,
    "ticket": {
      "comment": "Two vegetarians",
      "code": "STAFF-2026",
      "collection_point_id": "epp_31"
    }
  }]
}

Use event.comment.available and event.comment.label to configure the comment field. Each option’s requires object specifies requirements for code, address, and collection_point_id. Event collection points use epp_<id> IDs from event.collection_points; courier pickup points for postal gift cards are separate.

address requires name, street, and city. Send either an address or a collection point. All lines for the same event must use the same comment.

Unknown properties in ticket return 422 with field-level validation details.

Buying as a company

When the buyer is a business rather than a person, send their company inside sender.

json
{
  "sender": {
    "name": "Alex Sender",
    "email": "alex@example.com",
    "company": {
      "name": "Acme ApS",
      "vat_number": "DK12345678",
      "street": "Example Street 12",
      "postcode": "1123",
      "city": "København K",
      "country": "DK"
    }
  }
}
FieldRequiredNotes
nameyesThe company's name, at most 255 characters
vat_numberyesIts VAT registration number, at most 50 characters. Required whenever the object is present, matching what the Lifepeaks order form asks every company buyer
street, postcode, city, countryall four or noneThe address is optional as a set. Send all four or send none; three of them answers 422 naming the one you left out. country is a two-letter ISO 3166-1 code

Some products may only be bought by a company. An experience or a special offer with company_required of true, and an event with event.requires.company of true, refuse an order with no sender.company — and refuse one that carries a company without its address — with 422 and an error.code of sender_company_required. Read the flag off the product and show the company fields before the buyer reaches payment.

A company buyer may see extra text on the document. Where the selling partner has configured business-buyer wording, an order marked as bought by a company prints it on the gift card. This wording applies when the order includes sender.company.

POST /v2/quotes accepts but does not validate sender. Company details do not affect pricing. POST /v2/orders validates these details, so a successful quote does not guarantee that order creation will succeed.

Authenticated order responses include sender.company, with country represented as an alpha-2 code. Webhook payloads omit these buyer details.

A discount code

Send the buyer’s discount code as entered. Matching is case-insensitive. Lifepeaks validates the code and calculates the discount.

json
{
  "discount_code": "BLACKFRIDAY"
}

Discount codes contain 5 to 25 characters and are managed in the Lifepeaks admin interface. The API does not create codes or accept client-supplied discount values.

Response fields. Quote and order responses include the top-level discount object, line_items[].discount, and amounts.discount. Without a discount code, the object is null and the amounts are 0:

json
{
  "discount": { "code": "BLACKFRIDAY", "percent": 20 },
  "line_items": [
    { "product_id": "gcv_4821", "product_option_id": "gcvo_9107", "amount": 100050,
      "quantity": 2, "fees": 2500, "subtotal": 200100, "discount": 40020 }
  ],
  "amounts": { "currency": "DKK", "subtotal": 200100, "discount": 40020,
               "fees": 2500, "shipping": 0, "tax": 500, "total": 162580 }
}
  • amounts.discount is a positive magnitude that is subtracted. It is a whole number in the smallest unit of the currency, like every other figure here.
  • total is subtotal − discount + fees + shipping. subtotal stays gross, so a partner still has the list price it sold at as well as the money it took. Use this formula when displaying a breakdown.
  • line_items[].discount is that line's share, and is 0 on every line of an order with no code.
  • The top-level discount object names what caused it: {code, percent}, or null. The code is kept as it was sent, so renaming or deleting the campaign later cannot rewrite a finished order.

What a code can and cannot reduce.

  • Value gift-card lines and experience lines, when the campaign is configured for them.
  • Postage, when the campaign is a shipping one. That comes off amounts.shipping itself rather than off amounts.discount, exactly as the Lifepeaks order page reduces the postage line. So a shipping-only code leaves amounts.discount at 0 while amounts.shipping and total both fall.
  • Never fees. amounts.fees is untouched by any code.
  • Never an event ticket or a special offer. An order made only of those answers 422 with discount_code_not_applicable.

The card is still worth its full face value. A discounted gift card is redeemed for the amount printed on it; the buyer simply paid less for it. The selling partner absorbs that gap, which is also why the Lifepeaks commission is calculated on the discounted subtotal.

Discount errors. discount_code_not_found covers unknown, disabled, scheduled, expired, and exhausted codes. discount_code_not_applicable means the code is active but does not apply to the order.

A code is consumed when the order is written, not when it is quoted. A limited-use code that runs out between the quote and the order is refused at order time. Quote with the code the moment the buyer applies it, and quote again before you send them to payment.

Paying with a gift card

A buyer can pay for event tickets with an existing gift card of the same company. Send its code as entered, on both the quote and the order:

json
{
  "gift_cards": [{ "code": "K7Q2M9XA4B" }]
}

The rules are those of the Lifepeaks order page:

  • Only where the company takes gift cards. The event product says so in accepts_gift_cards; show the field only when it is true. When it is false, any gift_cards value answers 422 with error.code gift_card_payment_not_enabled.
  • One card per order, and only for tickets to one event. Any other order, or tickets to two events, answers 422 on gift_cards.
  • The card must be a gift card or ticket coupon of the acting company that still holds value and was not itself bought with a discount code. An expired card — expired by status, or past its validity date — answers 422 on gift_cards.0.code with error.code gift_card_expired. Any other code that cannot pay answers 422 on gift_cards.0.code, with the same message whatever the reason.
  • A card that covers the tickets without their fee waives the ticket fee, so amounts.fees becomes 0. A smaller card is used up and the fee stays.

Response fields. amounts.gift_card is what the card pays, a positive magnitude that is subtracted, and gift_cards names the card by the last four characters of its code. total is what is left for the hosted checkout:

json
{
  "gift_cards": [{ "last4": "XA4B", "amount": 10000, "balance": 10000 }],
  "amounts": { "currency": "DKK", "subtotal": 30000, "discount": 0, "fees": 2500,
               "shipping": 0, "gift_card": 10000, "tax": 0, "total": 22500 }
}

total is subtotal − discount + fees + shipping − gift_card. balance appears on quotes only.

When the card is spent. A quote reserves nothing. The order spends the card when it is created, so another order cannot spend the same value while this one is open. A card whose balance changed since the quote answers 409 gift_card_balance_changed: quote again and show the buyer the new total.

  • Part of the order: create the checkout session as usual. It charges total, the remainder.
  • The whole order: the order is created paid (status fulfilled, payment captured) and no checkout session is needed. Send the buyer straight to your return page.
  • Never paid: when the order expires, the card's value goes back onto the card.
  • Refunded: a refund returns any paying gift-card contribution to that card first and sends the rest back through the original payment gateway. refundable and refunded count both parts. An order refund can return 202 with status: "pending"; track its rf_ ID through GET /v2/refunds/{id} or the refund webhooks before showing completion. See Refunding an order.

A greeting on the card

Send greeting with the order to print a message on its own page of the gift card and show it in the delivery e-mail. Omit it and the card carries no greeting, exactly as if the buyer had skipped the step.

json
{
  "greeting": {
    "message": "Tillykke med dagen!",
    "image": { "source": "design", "design_id": "gid_4711" }
  }
}

A greeting may include a message, an image, or both. Set the message limit from personalization.greeting.max_length. Images can come from either source below:

  • The company's own pictures. They are on the product, as personalization.designs. Name the one the buyer chose as design_id. An empty list means this company offers none, so do not show the chooser.
  • The buyer's own photograph. Upload it first, then name the id it produced as upload_id with "source": "upload". See A buyer's own picture.

"source": "none" says the buyer chose no picture, which is the same as leaving image out.

The greeting applies to every card the order produces. An order for five cards prints the same message on all five.

One recipient per card

To send each card to its own person, send recipients instead of recipient: a list with one {name, email} per card the order issues. The first line's cards take the first entries, the next line's cards the entries after those.

json
{
  "recipients": [
    {"name": "Anna Jensen", "email": "anna@example.com"},
    {"name": "Bo Hansen", "email": "bo@example.com"}
  ]
}

The list must match the number of cards exactly. It works on gift-card orders (value and experience lines) with recipient_email delivery; anything else answers 422 on recipients. GET /v2/orders/{order_id} returns each card's recipient in recipients.

To take the list from a spreadsheet, post the file's bytes to POST /v2/recipients/import?filename=list.xlsx (CSV, XLS, XLSX or ODS; name in the first column, e-mail in the second). The answer holds the usable recipients and a row_errors list with the file row number and the reason for each refused row. Nothing is stored. Show the rows to the buyer, then send them on the order.

How and when it is delivered

Send delivery to say how the card reaches its recipient, and when.

json
{
  "delivery": {
    "method": "recipient_email",
    "send_at": "2026-12-24T09:00:00+01:00"
  }
}

Offer only delivery methods marked available in the product’s delivery_methods. Use their published prices and validate the selection when requesting the quote. Unavailable methods are rejected.

Display price as a starting price when price_varies is true. Request a quote with the buyer’s postal address and delivery selection to obtain the exact charge.

method is recipient_email to e-mail the card straight to the recipient, sender_email to e-mail it to the buyer, who passes it on, or postal to post a printed card. Leave delivery out entirely and Lifepeaks uses the recipient’s email address when it differs from the buyer’s, and the buyer’s email address otherwise.

send_at schedules the card. It is an RFC 3339 timestamp with an offset — 2026-12-24T09:00:00+01:00, never 2026-12-24T09:00:00. A timestamp without an offset is rejected. It must be in the future and at most 24 months ahead.

Scheduling is supported only when the delivery method has supports_send_at: true. Delivery to the sender is included with the payment receipt and cannot be scheduled.

If send_at is provided without method, the order uses scheduled recipient-email delivery.

Sending the card yourself. If you render and send the card from your own system, ask Lifepeaks to enable Partner delivers the card on your company. Lifepeaks then sends nothing to the buyer or the recipient for your orders: no payment receipt, no card e-mail, no scheduled delivery, no voucher e-mail. Payment, order status, webhooks and redemption at the till are unchanged. If your Lifepeaks order form stays open while you move over, Lifepeaks can limit this to orders created through the API, so order-form orders keep their e-mails. Read the issued items after order.fulfilled with GET /v2/items?order_id=…; each carries code, claim_url (the value to encode in your own QR code), amount, validity and the recipient details.

A postal order carries the address too, and pays for the postage:

json
{
  "delivery": {
    "method": "postal",
    "pickup_point_id": "gls-DK-1234",
    "address": {
      "kind": "private",
      "name": "Bo Hansen",
      "street": "Example Street 12",
      "postcode": "1123",
      "city": "København K",
      "country": "DK",
      "email": "bo@example.com"
    }
  }
}

country must be a two-letter ISO 3166-1 code supported by the selected postal delivery option. Unsupported destinations are rejected before checkout.

Sending a pickup_point_id makes it a collection delivery; leaving it out sends the card to the address itself. The two are priced differently, and the product's postal method publishes both figures per country, in destinations. Find the points themselves at GET /v2/pickup-points?country=DK&postcode=2200, once the buyer has given a postcode. kind of company needs a company_name and is priced differently again. A phone number is required only when the method's phone_required is true.

Quote the postal order before you show a total. Send the same delivery object to POST /v2/quotes and read amounts.shipping — it is 0 on every e-mail order, and on a postal one it carries the postage plus the surcharge for each card after the first. Quoting without it shows the buyer a total that is not what they will be charged.

Courier delivery does not accept send_at. Companies that post their own cards may support scheduling; send this field only when the postal method reports supports_send_at: true.

Some companies offer postal delivery priorities. When the postal method includes priorities, display those options and send the selected ID as delivery.shipping_priority. If the array is absent, omit the field.

json
{
  "delivery": {
    "method": "postal",
    "shipping_priority": "spri_2",
    "address": { "kind": "private", "name": "Bo Hansen", "street": "Example Street 12",
                 "postcode": "1123", "city": "København K", "country": "DK", "email": "bo@example.com" }
  }
}

Omitting it charges the default, which is always the cheapest entry and is the price destinations[].*_price already publishes. Send the same value to POST /v2/quotes to see the faster price before the buyer commits. A priority sent to a company that ships with a courier answers 422 with shipping_priority_unsupported; one the company does not publish answers 422 with shipping_priority_unavailable.

Neither an event ticket nor a special offer can be posted. Both are delivered electronically, so method of postal on such an order answers 422 on delivery.method and their amounts.shipping is always 0.

Scheduled orders remain pending fulfillment until the scheduled time. After payment, the order stays paid with fulfillment.status: processing. The order.fulfilled event is emitted when fulfillment completes.

Validity

A value gift-card line or an experience line may say how long its cards stay valid. Leave it out and the card inherits the default: the company's card_validity_months on a value card, the experience's own months or fixed date on an experience.

json
{
  "items": [
    { "product_id": "gift_card_value", "amount": 50000, "quantity": 1, "validity": { "months": 12 } }
  ]
}

validity carries exactly one of two keys. months (1 to 120) is counted from the moment the card is issued, which is the order's creation. until is the last valid day as YYYY-MM-DD; it must be after today and at most 120 months ahead. Sending both, neither, a malformed date or a month outside the range answers 422 on items.<n>.validity.

Send the same object to POST /v2/quotes; the quote line echoes it. The order line on GET /v2/orders/{order_id} echoes it as sent, and only on a line that sent one. The resolved date is on each issued item's validity at GET /v2/items, and the till honours it.

Event tickets and special offers do not accept validity: their validity is the event's.

A buyer's own picture

Upload buyer-supplied greeting images before creating an order. The process uses upload intents, byte transfer, and finalization, similar to PDF-template uploads, with image-specific endpoints and validation.

1. Create an upload intent. Declare the file’s SHA-256 checksum, byte size, and MIME type.

bash
curl -sS -X POST https://api.lifepeaks.dk/v2/greeting-images/upload-intents \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Idempotency-Key: greeting_upload_018f4f37b949" \
  -H "Content-Type: application/json" \
  -d '{"sha256":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
       "byte_size":248130,"content_type":"image/jpeg"}'

Greeting images support image/jpeg, image/png, and image/webp, up to 10 MB. Read the current limits from personalization.greeting.image.accepted_content_types and .max_bytes. Upload intents expire after 15 minutes.

2. Send the bytes. Use upload.url, upload.method and upload.headers from the response exactly as given. In a deployed environment the URL is a signed storage URL and the headers carry its signature, so altering one makes the upload fail.

3. Finalize the upload. Lifepeaks validates the uploaded file.

bash
curl -sS -X POST \
  https://api.lifepeaks.dk/v2/greeting-images/upload-intents/gimg_5a3c81e0d74b426f90ac17b5e2d8630f/finalize \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Idempotency-Key: greeting_finalize_018f4f37b949"

The checksum, the size and the file's own leading bytes must all agree with what you declared. A file declared as image/png must have a valid PNG signature.

Retry 503 image_store_unavailable responses. Wait for the delay in Retry-After, then finalize again with the same Idempotency-Key. The uploaded file remains available for the retry.

The 201 carries the picture's id. Name it on the order:

json
{
  "greeting": { "image": { "source": "upload", "upload_id": "gimg_5a3c81e0d74b426f90ac17b5e2d8630f" } }
}

An uploaded image can be used by one order only. A second order referencing the image returns 422 greeting_image_not_found, as does an unknown image ID. Create a separate upload for each order. Unused images are deleted after seven days.

If you ask the buyer for permission to send them marketing, record what they answered on the order. Send the object with the exact sentence they were shown.

json
{
  "marketing_consent": {
    "granted": true,
    "source": "partner_checkout",
    "consent_text": "Ja tak, send mig nyheder og tilbud på e-mail. Du kan afmelde når som helst.",
    "consent_text_version": "2026-09-01"
  }
}
FieldRequiredWhat it means
grantedyestrue when the buyer opted in, false when they were asked and declined
sourceyesstorefront_checkout, partner_checkout or partner_import — where the consent was taken
consent_textwhen granted is trueThe exact wording shown to the buyer, at most 500 characters
consent_text_versionnoYour own label for that wording, at most 40 characters

Omit marketing_consent when no response was collected. Send granted: false to record that the buyer was asked and declined. Omitting the object records neither consent nor a refusal.

consent_text must match the displayed wording. Send the exact sentence shown to the buyer, without paraphrasing it. Keep the stored value consistent with the consent control on your page.

A consent becomes a subscriber only when the payment is captured. Until then it is recorded but invisible to GET /v2/subscribers, so a buyer who ticks the box and abandons checkout never reaches your list.

Unknown properties in marketing_consent return 422. Check the field-level errors before retrying.

The API records the submitted consent and does not perform double opt-in. If your integration requires a confirmation step, implement it separately.

Idempotency rules

  • Use stable, independent Idempotency-Key values for order creation and checkout-session creation. Never reuse the order key for the checkout call.
  • Persist each key with the operation name, exact request body, and resulting resource ID.
  • A network timeout is an unknown result. Retry the same operation with the same key and body. The replay returns the original response, whatever the line count; no second card is issued and no stock is deducted twice.
  • Reusing a key with different input returns 409 idempotency_conflict; generate a new key only for a genuinely new operation.
  • A duplicate that arrives while the first request is still running returns 409 request_in_progress with a Retry-After header. Wait that long and retry the same key and body rather than starting a second order.
  • Do not generate a new key inside a retry loop. That can create duplicate orders or other changes.

4. Create Lifepeaks-hosted QuickPay checkout

Use a second persisted idempotency key. This call has no body because Lifepeaks takes the payable amount, currency, approved return URL, and payment configuration from the order and tenant configuration.

bash
curl -sS -X POST \
  https://api.lifepeaks.dk/v2/orders/po_0123456789abcdef0123456789abcdef/checkout-sessions \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY" \
  -H "Idempotency-Key: checkout_session_018f4f37b949"

Redirect the browser to the returned url. It is a short-lived QuickPay URL hosted under Lifepeaks' payment configuration. Partners cannot replace the merchant, payable amount, commission, callback, or capture decision.

An order that a gift card paid in full has nothing left to pay, so creating a session for it answers 409 order_not_payable.

An identical replay may return 200; a newly created session returns 201. Both are success. If the session expires, create a new checkout session for the same unpaid order with a new operation key. Do not create a duplicate order.

Confirm payment on the return page

The return page should know only your own stable checkout reference. Resolve that reference to the stored po_… ID on your backend, then read the order:

bash
curl -sS \
  https://api.lifepeaks.dk/v2/orders/po_0123456789abcdef0123456789abcdef \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY"

Use canonical fields, not the redirect:

StatePartner experience
status: pending_paymentKeep polling with backoff and offer the active checkout again.
payment.status: failed or cancelledExplain that no gift card was issued and allow a safe retry.
payment.status: authorized or capturedPayment is confirmed; continue waiting for fulfillment if needed.
fulfillment.status: fulfilledShow the order as complete. Delivery is by e-mail unless the order was posted.
fulfillment.status: failedKeep the order paid and escalate fulfillment; never ask the buyer to pay again automatically.

Checkout-session responses include an order snapshot. The embedded order has the same fields as GET /v2/orders/{order_id}, including reference, sender, recipient, greeting, and delivery. Read the order again after checkout to obtain its current payment and fulfillment state.

Use reference as the customer-facing order number. Display delivery information according to delivery.method: sender_email uses the sender’s email address, recipient_email uses the recipient’s address, and postal uses the delivery address. Include delivery.send_at when scheduled. Read these values from the authenticated order response.

Polling makes the return page reliable when a webhook is delayed. Webhooks make the partner backend responsive when the buyer closes the browser. Production integrations should use both.

Hand over the gift-card document

Each line of an order has its own document. Once fulfillment.status is fulfilled, every entry in line_items carries a pdf block, and a single-line order carries a pdf at order level too:

json
{
  "id": "po_0123456789abcdef0123456789abcdef",
  "status": "fulfilled",
  "payment": { "status": "captured" },
  "fulfillment": { "status": "fulfilled" },
  "line_items": [
    {
      "id": "poli_9d41b0c7a5e34f2b8c6d0e1f2a3b4c5d",
      "object": "line_item",
      "product_id": "gcv_4821",
      "product_option_id": "gcvo_9107",
      "amount": 100050,
      "quantity": 2,
      "fees": 2500,
      "subtotal": 200100,
      "discount": 0,
      "issued_count": 2,
      "pdf": {
        "url": "/v2/orders/po_0123456789abcdef0123456789abcdef/lines/poli_9d41b0c7a5e34f2b8c6d0e1f2a3b4c5d/gift-card.pdf",
        "content_type": "application/pdf"
      }
    }
  ]
}

The key is absent until fulfillment completes, so test for its presence rather than for an empty value — and do not poll the download to detect fulfillment; read the order.

The pdf field provides the document for every fulfilled line, including gift cards, experiences, events and special offers.

issued_count is how many items the line actually produced. It equals quantity for separate gift cards and is 1 for a collective experience card. It does not for an event that groups its tickets: such a line issues one ticket carrying every seat, so a four-seat line reports 1. Use it to know how many codes to expect. The codes themselves come from GET /v2/items?order_id=<reference>, and each code's own document from GET /v2/items/{code}/document.pdf — which is the route to use for a ticket or an offer voucher you hold by code rather than by order line.

Fetch each one from your server with your API key, following the url the order gave you:

bash
curl -sS -o gift-card.pdf \
  "https://api.lifepeaks.dk/v2/orders/po_0123456789abcdef0123456789abcdef/lines/poli_9d41b0c7a5e34f2b8c6d0e1f2a3b4c5d/gift-card.pdf" \
  -H "Authorization: Bearer $LIFEPEAKS_API_KEY"

A line that bought several cards downloads all of them in one document, so there is one download per line and never one per card. A line whose cards have since been deleted answers 404 rather than an empty-looking gift card.

Use line-level document links for multi-line orders. GET /v2/orders/{order_id}/gift-card.pdf returns 409 multiple_gift_cards for these orders. Iterate line_items and follow each line’s pdf.url; this also works for single-line orders.

This is an authenticated Lifepeaks endpoint, not a public or storage link, so never hand the URL to a browser. Attach the bytes to your own confirmation email, or serve them from your account area behind your own session. Lifepeaks delivers the order using its selected delivery method; this download provides your own copy of the documents.

The artwork comes from the branded template that was in force when the order was created — see Branded gift-card PDFs. An experience that carries its own template brands its own cards, so one order's cards need not look alike, and the rest of the order uses the company's published template. Publishing a new template later never changes a document a buyer has already received.

Contract-gated settlement

POST /v2/orders/{order_id}/settle is not an alternative public payment shortcut. It requires the orders:settle scope and an active negotiated commercial entitlement for the tenant, credential, and settlement mode. It is disabled by default, audit-backed, and cannot be used after hosted checkout starts.

Agency/marketplace models, POS/PMS integrations, and non-Lifepeaks settlement require a commercial and technical review. Contact Lifepeaks before designing around them.

Start from working code

The Lifepeaks storefront starter implements this whole sequence: the partner backend, durable idempotency, webhook verification, the canonical return page, and per-industry manifests. The repository is private, so ask Lifepeaks for access first. See Starter templates for the exact commands.

Collective experience cards

Order and quote lines accept cards: "separate" (default) or cards: "collective". Collective is available only for experience lines with quantity > 1, excluding SDH companies; other uses return a 422 error on items.N.cards. It issues one code with quantity vouchers. Stock and total discount remain based on quantity; the order fee is unchanged, while postal surcharges and per-card recipients count one card. Provide exactly one recipient for a collective line. Order reads report issued_count: 1; read the issued card and its vouchers through /v2/items?order_id=<reference>.