Skip to content

Onboard Client

A client is the business whose receivables you manage (you bill, factor, or collect on its behalf). Creating one provisions its default settings, products, and ledger accounts; the steps below customise what your integration needs.

  1. Create the client. Requires the CreateClients right.

    Terminal window
    curl -X POST "https://$HOST/clients" \
    -H "Authorization: Bearer $JWT" \
    -H "Content-Type: application/json" \
    -d '{
    "identificationNumber": "5566778899",
    "name": "Example Client AB",
    "locale": "SE",
    "contactInformation": { "name": "AR team", "email": "billing@example.com", "phone": "+46812345678" },
    "addressInformation": { "name": "Example Client AB", "address": "Storgatan 1", "zip": "11122", "city": "Stockholm", "countryCode": "SE" }
    }'

    Required fields are identificationNumber, name, and - when you send the nested objects - contactInformation.{email, phone} and addressInformation.{name, address, zip, city}. contactInformation.email becomes the client’s portal login and report recipient. An optional contactInformation.primaryContactEmail holds an address for manual contact with the client only; it is not used for sending reports and creates no client user. Creating a client auto-provisions default billing/bookkeeping settings, the standard products, and ledger accounts. The response contains the new id (prefix C.).

    To start the client from a client template, send the template’s id as templateId. The template’s price lists, credit limits, transfer texts and engine rule are then copied to the client, so a template with preset limits is how a new client gets limits at creation. See Set the global limits.

  2. Configure billing and bookkeeping settings. Requires UpdateClientBillingDetails and UpdateClientBookkeepingDetails.

    Terminal window
    curl -X PUT "https://$HOST/clients/$CLIENT_ID/settings/bookkeeping" \
    -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
    -d '{ "export": { "method": "SIE", "voucherSeries": "A" } }'
  3. Enable the products the client should use (invoice service, factoring, reminders, collection). List the auto-created products and toggle the ones you need; requires ReadClientProducts and ToggleClientProducts.

    Terminal window
    curl "https://$HOST/client-products?clientId=$CLIENT_ID" -H "Authorization: Bearer $JWT"
    curl -X PUT "https://$HOST/client-products/$PRODUCT_ID/toggle" \
    -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
    -d '{ "enabled": true }'

    For factoring products with recourse you must also send recourseDays.

  4. (Optional) Connect an ERP and enable sync so invoices and bookkeeping flow automatically. Set both invoiceErpId and bookkeepErpId via PUT /clients/$CLIENT_ID/erp-connect (ConnectErpToClient), then enable with PUT /clients/$CLIENT_ID/sync/enable.

  5. (Optional) Add client users and email recipients with POST /client-users and POST /clients/$CLIENT_ID/email-recipients.

A new client has no global limits until they are set, unless it was created from a template that has them. Limits are not part of the create-client request. Set them afterwards on the client’s global credit status with PUT /credit-status-global/{id} (requires UpdateClientCreditStatuses).

Find the id by searching on the client (requires SearchClientCreditStatusesGlobal). The same search returns the financing data the Operations Portal shows on the client’s Financing tab:

Terminal window
curl -X POST "https://$HOST/credit-status-global/search" \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{ "clientId": "'"$CLIENT_ID"'" }'

The response holds the limits and how much of each is used:

Field Meaning
limit Global financing limit. Covers financing both with and without recourse
limitWithRecourse Global recourse limit. Caps only the part financed with recourse
limitPledge Global pledge limit
limitValidToDate, limitWithRecourseValidToDate Until when the financing and recourse limits are valid
totalUsed, totalDisposable, totalPending Used, remaining and pending amounts of the financing limit
totalWithRecourseUsed, totalWithRecourseDisposable, totalWithRecoursePending The same for the recourse limit
Terminal window
curl -X PUT "https://$HOST/credit-status-global/$CREDIT_STATUS_GLOBAL_ID" \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{ "limit": 1000000, "limitWithRecourse": 500000 }'

approvalStatus cannot be set directly: create and update requests do not accept it. A new client is PENDING. It changes when the Client Approval Decision system errand for the client is resolved: APPROVED when the decision is approved (the client’s payout accounts are then enabled) and DENIED when it is denied.

Resolve the errand with PUT /errands/system/{id}/resolve and a decision of APPROVED or DENIED (requires ResolveSystemErrands). The client’s other mandatory approval errands must be resolved first, and the client must have a payout account.

A transfer text is the text on the payment slip of the client’s invoice PDF. It is stored per client (or client template), invoice type, product, language and service provider. Search for the texts with POST /client-transfer-text/search (requires ReadClientTransferText):

Terminal window
curl -X POST "https://$HOST/client-transfer-text/search?limit=100&page=1" \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{
"clientId": "'"$CLIENT_ID"'",
"invoiceType": "INVOICE",
"productId": "INVOICE_FACTORING_SELL",
"languageId": "sv",
"serviceProviderCode": "'"$SERVICE_PROVIDER_CODE"'"
}'
  • All the body fields are optional filters. languageId is one of sv, nb, en, fi, da, pl. Service provider codes are listed by GET /service-providers (requires ReadServiceProviders).
  • The search is paginated with the limit, page and order query parameters, and returns 10 texts per page by default. Without a filter on service provider you may need several pages to see the texts of every service provider; see Pagination and search.
  • Texts cannot be looked up by invoice number. Filter on the invoice’s client, type, product, language and service provider instead.
  • text is the HTML the editor in the Operations Portal saved. There is no plain text version.

Create a text with POST /client-transfer-text (CreateClientTransferText) and change one with PUT /client-transfer-text/{id} (UpdateClientTransferText).

Enabling sync on a client whose integration is not yet connected leaves its sync status PENDING. When the integration is connected, set the status with PUT /clients/{client_id}/sync/mark-integration-as-connected, which moves it from PENDING to CONNECTED. It requires MarkIntegrationAsConnected, and it answers 400 for a client whose sync status is anything other than PENDING.