Skip to content
This is a new version of the Kivra Developer Docs. Report issues or share feedback at avsandare.support@kivra.se. The previous version can be found here.

Request access to a tenant

POST
/v2/tenant/request_access
curl --request POST \
--url https://sender.api.kivra.com/v2/tenant/request_access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "vat_number": "SE556840226601" }'

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.

Media typeapplication/json
object
vat_number
string
Example
SE556840226601

Data about the requested tenant

Media typeapplication/json
RequestAccess
object
created_at

Datum when the request was created in UTC format

string
created_by

ID of client that created the request

string
status

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

string
client_id

ID Of You the Client

client_name

Name of the client who created the requested tenant

string
tenant_name

Name of the requested tenant

string
tenant_key

Key of the requested tenant

string
Example
{
"created_at": "2019-05-20T12:42:29Z",
"created_by": "client_15063298495eafd2749bb78e2f991af3ab023d13df",
"status": "pending",
"client_name": "Client XYZ",
"tenant_name": "Tenant ABC",
"tenant_key": "1424780396902ee9278b16417f8e3252c3ced28c38"
}
kivra-objkey
string format: hexadecimal value

Object Key for the Request (requestKey)

location
string format: hexadecimal value

The complete API url for where to check the status of this request