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 company scope 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/company
Authorization: Bearer {YOUR_ACCESS_TOKEN}
  • This endpoint returns information about the current company and related configurations.

  • Required permissions

    • Scope: company
    • User role: Admin or SuperAdmin

Update company configurations

PATCH
/api/v1/company/configurations
Authorization: Bearer {YOUR_ACCESS_TOKEN}
  • This endpoint allows updating the company’s configurations, especially the payment code structure.

  • Required permissions

    • Scope: company
    • User role: Admin or SuperAdmin
NameTypeRequiredDescription
payment_code_formats
arrayRequired
List of payment code formats (required if submitted)

Error codes

  • Below are possible error codes when using the company API:
    HTTP CodeDescriptionCause
    401
    Unauthorized
    Access token is invalid or expired
    403
    Forbidden
    Insufficient privileges (not an Admin or SuperAdmin)
    400
    Bad Request
    Invalid payload (does not satisfy constraints)
    500
    Internal Server Error
    Server error while processing the request