Company Creation API

API to create a new company in the Bank Hub system. Allows creating a company with a name and an initial status.


API Endpoint

POST
https://bankhub-api-sandbox.sepay.vn/v1/company/create

Request Body

full_namestringrequired

Full name of the company

statusenumrequired

Initial status of the company

Note
  • This API requires a Bearer Token in the Authorization header
  • The company name must be unique within the merchant scope
  • The status should be set to Active at creation time so the company can be used immediately
  • After creation, the company will receive a unique xid (UUID format)

Error Handling

401Unauthorized

The access token is invalid or has expired

400Validation Error

Invalid input data (empty company name, invalid status, etc.)

503Service Unavailable

Database error

API Response

Response 201 - Created Successfully
{
  "code": 201,
  "message": "string",
  "data": {
    "xid": "string",
    "full_name": "string"
  }
}
codeinteger

HTTP status code

messagestring

Result message

dataobject

Created company data

Code Examples

>
>
>
>
>
curl --request POST \
--url https://bankhub-api-sandbox.sepay.vn/v1/company/create \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"full_name":"string","status":"Active"}'

Usage Examples

JSCreate a new company with Active status
1
2
3
4
5
6
7
curl --location 'https://bankhub-api-sandbox.sepay.vn/v1/company/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
"full_name": "Công ty TNHH ABC",
"status": "Active"
}'
JSCreate a company with Pending status (not yet usable)
1
2
3
4
5
6
7
curl --location 'https://bankhub-api-sandbox.sepay.vn/v1/company/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
"full_name": "Công ty TNHH XYZ",
"status": "Pending"
}'

Important Notes
  • You can store the company ID: After creation, save the xid to use with other APIs