> For the complete documentation index, see [llms.txt](https://docs.zwapgrid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/bjorn-lunden.md).

# Björn Lundén

Complete Björn Lundén onboarding from your client backend.

**Preview** · [What this means for your integration](https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/headless-onboarding.md#preview)

Your backend sends the public key for the company you want to connect. **Zwapgrid checks company access and completes the connection.** No customer OAuth login is required for this request.

First, complete the [shared prerequisites and example setup](https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/headless-onboarding.md#before-you-start).

## What you need

* Application access and permissions for the accounting operations you need. See the [Björn Lundén setup guide](https://docs.zwapgrid.com/client-portal/systems/setup-guides/bjorn-lunden.md).
* The public key of the company to connect, obtained through the provider setup process. The company must have enabled your integration.
* A Published Björn Lundén System Setting with valid application ID and secret, belonging to your Zwapgrid client, or a default that Zwapgrid has confirmed your client can use.

Select the published setting on your Consent for an explicit application choice. If you omit the selection, confirm the configured default with Zwapgrid first. An invalid selected setting is rejected.

## 1. Prepare the connection

1. Use the [Consent created in the shared workflow](https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/headless-onboarding.md#1-create-a-consent). If selecting settings explicitly, set `systemsSettings.bjornlunden` to their published ID.
2. Obtain the public key for the exact company to connect. Your backend does not exchange a customer OAuth code.
3. Submit the key once. Zwapgrid checks access to the company identified by the key and confirms that the integration is enabled. No separate company-selection request is needed.

## 2. Send the request

```json
{
  "source": "bjornlunden",
  "credentials": {
    "companyPublicKey": "<company-public-key>"
  }
}
```

`companyPublicKey` is required and must contain 1–256 ASCII letters, digits, hyphens or underscores. Do not send application credentials, codes, redirect URIs, tokens or tenant/environment/company fields. Treat the public key as a credential.

Replace the placeholders and save this body as a protected `connection.json` on your backend. Set the [example variables](https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/headless-onboarding.md#set-up-the-examples), including a new UUID in `CORRELATION_ID`, then send the request once:

```sh
curl --request POST \
  "$CONSENTS_API_BASE_URL/api/v1/consents/$CONSENT_ID/connection" \
  --header "x-api-key: $ZWAPGRID_API_KEY" \
  --header "x-correlation-id: $CORRELATION_ID" \
  --header 'Content-Type: application/json' \
  --data-binary @connection.json
```

## 3. Check the result

Expect HTTP 201 with `source: bjornlunden` and `state: completed`. [Optionally verify the connection](https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/headless-onboarding.md#optional-verify-the-connection) for that company.

Do not automatically replay a credential submission after an uncertain outcome. Use GET first and contact support if you cannot confirm the result. For rejected access, confirm the company's integration activation and the application's vendor permissions before a new attempt. Zwapgrid manages application authentication; your backend does not need a customer refresh token.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zwapgrid.com/onboarding-flow/headless-onboarding/bjorn-lunden.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
