Concepts
Authorization in MyCreditApp revolves around the organization entity. Each API client you create belongs to a specific organization. By default, every API client has full access to its own organization. Another key concept is connections. Connections allow one organization to interact with another. To collaborate, one organization must invite another organization (or accept an invitation). Once the invitation is accepted and the invited organization creates its own organization entity, a connection between the two organizations is established.Not all endpoints require authorization - only those that operate on organization-related data.
Scenarios
There are three authorization scenarios when calling the API. These scenarios describe how organizations interact.- Guest – your organization accesses resources of another organization that invited you.
- Host – your organization accesses resources of a connected Guest organization.
- Self – your organization accesses its own resources.
Any organization api client with sufficient permissions can perform a Self call.
Requester-Organization-ID and
Target-Organization-ID headers must be set.
Headers
Requester-Organization-ID
The organization that makes the request.
- Always set to your organization ID;
- The scenario (Guest, Host, or Self) depends on the relationship with the target organization.
Target-Organization-ID
The organization that the request is directed at:
- Self – same value as
Requester-Organization-ID; - Host → Guest – Guest organization ID;
- Guest → Host – Host organization ID.
Not all endpoints require authorization - only those that operate on organization-related data.
Examples
-
Host request: get data of a connected Guest organization
Guest’s organization IDYour API client access tokenYour organization IDGuest’s organization ID
-
Self request: upload a financial file of your organization
Your organization IDYour API client access tokenYour organization IDYour organization IDISO 4217 currencyFinancial File
Errors
During authorization, the following errors may occur:-
organization_being_deleted – The
Requester-Organization-IDorTarget-Organization-IDrefers to an organization that is currently being deleted. -
unsupported_crud_operation – This error occurs when the HTTP method used is not valid for the requested endpoint. It is not a common error but may appear in such cases.
-
access_denied – This indicates that the API client does not have permission to perform the requested action. Possible reasons include:
- Invalid API client credentials.
- No active connection exists between the organizations.
- The API client does not have access to the requested resource or operation.