Company API
Documentation on how to use the company API via OAuth2 in SePay.
Introduction
SePay’s company API allows you to access information about the current company and its configurations. This API is only for users with the Admin or SuperAdmin role in the company.
To use this API, your Access Token must include the
companyscope and you must be a user with the Admin or SuperAdmin role.
Endpoints
The company API provides the following endpoints:
GET/api/v1/company- Get information about the current company
PATCH/api/v1/company/configurations- Update company configurations
Get company information
GET
/api/v1/companyAuthorization: Bearer {YOUR_ACCESS_TOKEN}
This endpoint returns information about the current company and related configurations.
Required permissions
- Scope:
company - User role:
AdminorSuperAdmin
- Scope:
Update company configurations
PATCH
/api/v1/company/configurationsAuthorization: Bearer {YOUR_ACCESS_TOKEN}
This endpoint allows updating the company’s configurations, especially the payment code structure.
Required permissions
- Scope:
company - User role:
AdminorSuperAdmin
- Scope:
| Name | Type | Required | Description |
|---|---|---|---|
payment_code_formats | array | Required | List of payment code formats (required if submitted) |
Error codes
- Below are possible error codes when using the company API:
HTTP Code Description Cause 401 UnauthorizedAccess token is invalid or expired— 403 ForbiddenInsufficient privileges (not an Admin or SuperAdmin)— 400 Bad RequestInvalid payload (does not satisfy constraints)— 500 Internal Server ErrorServer error while processing the request—