Tenant API - Tenant Management

Request access to a tenant

Request access to an existing tenant that is outside the client scope. Typically this request follows an unsuccessful attempt to create a tenant that resulted in a conflict error (error 409).

The meaning of the conflict error is that a tenant is already associated to a company_id including the same orgnr as in the tenant that the client attempted to post, and the tenant who owns the orgnr is outside the scope for the client.

In Kivra, it is allowed to have several different flows on the same tenant, for example one flow for invoices and another flow for salary slips. As these flows could be managed by different clients, we need a mechanism to allow sharing a tenant between clients. The request_access endpoint provide this functionality. As the request may be granted (or denied) asynchronously, after a successfull call to request_access the client will need to poll the request until it becomes accepted or rejected.

As allowing access to a new tenant requires modification of the scope for the client, an authorization must be performed once the request has been accepted, to retrieve an access token with the new scope.

If the client posts a new identical request (requesting the same OrgNr for the same client), the same object will be returned with an updated status.

post/v2/tenant/request_access

Request

  • Base URL: https://sender.api.kivra.com
  • URL: https://sender.api.kivra.com/v2/tenant/request_access
  • Auth: oAuth2Client (defined in the document in a form this page cannot read)

Request body

vat_numberstring

Example request

{
  "vat_number": "SE556840226601"
}

Response

Data about the requested tenant

created_atstring

Datum when the request was created in UTC format

created_bystring

ID of client that created the request

statusstring

status of the request, for instance pending, accepted or rejected

client_idunknown
client_namestring

Name of the client who created the requested tenant

tenant_namestring

Name of the requested tenant

tenant_keystring

Key of the requested tenant

Example response

{
  "created_at": "2019-05-20T12:42:29Z",
  "created_by": "client_15063298495eafd2749bb78e2f991af3ab023d13df",
  "status": "pending",
  "client_name": "Client XYZ",
  "tenant_name": "Tenant ABC",
  "tenant_key": "1424780396902ee9278b16417f8e3252c3ced28c38"
}

Changes

No recorded changes to this operation across all 1 revision of this API.