Consents
Create, read, update, and delete consents; create one-time codes used in the Onboarding Flow. See the API description for consent statuses and supported accounting systems.
Use this endpoint to fetch the full details of a consent (e.g. after creating one via the Location header, or to check status and system settings for a specific connection).
You must generate an API Key by logging into the Client Portal.
You should use the API Key when calling all API endpoints in API.1.
Identifier of the consent representing the connection to the accounting system.
Unique identifier used to correlate and trace this request.
Returns a consent.
Consent resource returned by get and list endpoints. Represents the link between your customer and their connection to an accounting system.
The ID of the Consent
The name of the Consent
Consent status. Values: CREATED (0), ACCEPTED (1), REVOKED (2), INACTIVE (3).
The source of the consent (i.e. what system has been connected)
The selected system settings ID once the consent is accepted. Populated when the consent has a single connected system; see systemSettings for the full dictionary of available system settings.
The date the consent was created on
The date the consent was updated on
Not authenticated to access this API endpoint.
Not authorised to access this API endpoint.
The consent does not exist.
GET /consents/api/v1/consents/{consentId} HTTP/1.1
Host: apione.zwapgrid.com
x-api-key: YOUR_API_KEY
x-correlation-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Acme Corp - Fortnox",
"status": 1,
"source": "Fortnox",
"systemSettingsId": "a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d",
"systemSettings": {
"fileone": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fortnox": "a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d"
},
"createdOn": "2024-01-15T10:30:00Z",
"updatedOn": "2024-01-20T14:45:00Z"
}Use this endpoint to permanently remove a consent. After deletion, the consent ID can no longer be used and the customer would need a new consent to reconnect.
You must generate an API Key by logging into the Client Portal.
You should use the API Key when calling all API endpoints in API.1.
Identifier of the consent representing the connection to the accounting system.
Unique identifier used to correlate and trace this request.
If consent is removed
No content
If request is invalid
Unauthorized
Forbidden
Not Found
DELETE /consents/api/v1/consents/{consentId} HTTP/1.1
Host: apione.zwapgrid.com
x-api-key: YOUR_API_KEY
x-correlation-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
No content
Use this endpoint to change the consent display name or to revoke the consent (set status to REVOKED so the customer's connection is no longer active). Send the If-Match header with the ETag from the last GET consent response to avoid overwriting concurrent changes.
You must generate an API Key by logging into the Client Portal.
You should use the API Key when calling all API endpoints in API.1.
Identifier of the consent representing the connection to the accounting system.
Value of the ETag returned as a response header from the get-consent endpoint.
Unique identifier used to correlate and trace this request.
Request body for updating an existing consent. Only provided properties are updated.
Consent status. Values: CREATED (0), ACCEPTED (1), REVOKED (2), INACTIVE (3).
New display name for the consent.
The consent was updated successfully.
No content
The request is invalid.
Not authenticated to access this API endpoint.
Not authorised to access this API endpoint.
The consent does not exist.
If-Match header does not match Etag - this means that the resource has been changed and now has a different Etag.
PATCH /consents/api/v1/consents/{consentId} HTTP/1.1
Host: apione.zwapgrid.com
x-api-key: YOUR_API_KEY
If-Match: text
x-correlation-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 51
{
"status": 2,
"name": "Acme Corp - Fortnox (revoked)"
}No content
Use this endpoint to retrieve all consents (connections to accounting systems) for your client. Filter by status, source, name, dates, or other query parameters to find specific consents.
You must generate an API Key by logging into the Client Portal.
You should use the API Key when calling all API endpoints in API.1.
Number of records to return per page.
One-based index of the page to return.
Filter by creation date. Format: yyyy-MM-dd.
Filter by last update date. Format: yyyy-MM-dd.
Sort order for the results.
Filter by consent status. Use the status name or numeric value: CREATED (0), ACCEPTED (1), REVOKED (2), INACTIVE (3).
Filter by source (accounting system identifier).
Filter by test flag. When true, only test consents are returned.
Filter by the selected system settings ID (the system setting in effect once a consent is accepted).
Filter by consent name.
Unique identifier used to correlate and trace this request.
Returns a list of consents.
Paginated list response. Contains a page of items and metadata for total count and pagination.
Not authenticated to access this API endpoint.
Not authorised to access this API endpoint.
The client does not exist.
GET /consents/api/v1/consents HTTP/1.1
Host: apione.zwapgrid.com
x-api-key: YOUR_API_KEY
x-correlation-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
"meta": {
"totalResources": 42,
"totalPages": 3,
"currentPage": 1
},
"data": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Acme Corp - Fortnox",
"status": 1,
"source": "Fortnox",
"systemSettingsId": "a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d",
"systemSettings": {
"fileone": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fortnox": "a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d"
},
"createdOn": "2024-01-15T10:30:00Z",
"updatedOn": "2024-01-20T14:45:00Z"
}
]
}Use this endpoint to create a consent that links your customer to a future connection in API.1. After creating, use the Location header to get the consent ID, then create a one-time code (POST /consents/{consentId}/otc) and use it only inside your embedded client integration when starting the Onboarding Flow. Do not expose the OTC in share links because it can be prematurely consumed. The 201 response includes a Location header with the URI of the created consent.
You must generate an API Key by logging into the Client Portal.
You should use the API Key when calling all API endpoints in API.1.
Unique identifier used to correlate and trace this request.
Request body for creating a new consent. Links a customer in your system to a connection that is completed in the Onboarding Flow.
Display name for the consent (e.g. your customer or integration name).
Created.
No body; use the Location header to fetch the created consent.
The request is invalid.
Not authenticated to access this API endpoint.
Not authorised to access this API endpoint.
The consent does not exist.
POST /consents/api/v1/consents HTTP/1.1
Host: apione.zwapgrid.com
x-api-key: YOUR_API_KEY
x-correlation-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 148
{
"name": "Acme Corp - Fortnox",
"systemsSettings": {
"fileone": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fortnox": "a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d"
}
}{}Use this endpoint after creating a consent to obtain a one-time code (OTC). Use the OTC only inside your embedded client integration when starting the Onboarding Flow. Do not expose the OTC in share links because it can be prematurely consumed.
You must generate an API Key by logging into the Client Portal.
You should use the API Key when calling all API endpoints in API.1.
Identifier of the consent representing the connection to the accounting system.
Unique identifier used to correlate and trace this request.
One-time code was created successfully.
One-time code returned when creating an OTC. Use it only inside your embedded client integration when starting the Onboarding Flow. Do not expose it in share links because it can be prematurely consumed.
The one-time code used by the embedded client integration when starting the Onboarding Flow.
The request is invalid.
Not authenticated to access this API endpoint.
Not authorised to access this API endpoint.
The consent does not exist.
POST /consents/api/v1/consents/{consentId}/otc HTTP/1.1
Host: apione.zwapgrid.com
x-api-key: YOUR_API_KEY
x-correlation-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
"code": "OTC-7a3b2c1d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
}Last updated
Was this helpful?
