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.
-
Create the client. Requires the
CreateClientsright.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}andaddressInformation.{name, address, zip, city}.contactInformation.emailbecomes the client’s portal login and report recipient. An optionalcontactInformation.primaryContactEmailholds 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 newid(prefixC.).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. -
Configure billing and bookkeeping settings. Requires
UpdateClientBillingDetailsandUpdateClientBookkeepingDetails.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" } }' -
Enable the products the client should use (invoice service, factoring, reminders, collection). List the auto-created products and toggle the ones you need; requires
ReadClientProductsandToggleClientProducts.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. -
(Optional) Connect an ERP and enable sync so invoices and bookkeeping flow automatically. Set both
invoiceErpIdandbookkeepErpIdviaPUT /clients/$CLIENT_ID/erp-connect(ConnectErpToClient), then enable withPUT /clients/$CLIENT_ID/sync/enable. -
(Optional) Add client users and email recipients with
POST /client-usersandPOST /clients/$CLIENT_ID/email-recipients.
Set the global limits
Section titled “Set the global limits”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:
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 |
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 }'Approval status
Section titled “Approval status”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.
Transfer texts
Section titled “Transfer texts”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):
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.
languageIdis one ofsv,nb,en,fi,da,pl. Service provider codes are listed byGET /service-providers(requiresReadServiceProviders). - The search is paginated with the
limit,pageandorderquery 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.
textis 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).
Mark the integration as connected
Section titled “Mark the integration as connected”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.