API Chỉnh sửa Công ty
API cập nhật thông tin công ty đã tồn tại. Cho phép thay đổi tên, trạng thái và các cấu hình của công ty.
API Endpoint
POST
https://bankhub-api-sandbox.sepay.vn/v1/company/edit/{company_id}Path Parameters
company_idstringrequired
ID của công ty cần chỉnh sửa
Request Body
company_idstringrequired
ID của công ty cần chỉnh sửa
Lưu ý
- API này yêu cầu Bearer Token trong header Authorization
- Hỗ trợ partial update - chỉ gửi các trường cần thay đổi
Xử lý lỗi
404Not FoundCông ty không tồn tại hoặc không thuộc merchant này
401UnauthorizedAccess token không hợp lệ hoặc đã hết hạn
400Validation ErrorDữ liệu đầu vào không hợp lệ
API Response
Response 200 - Cập nhật thành công
{
"code": 200,
"message": "Đã cập nhật thông tin công ty (tổ chức) thành công."
}codeinteger
messagestring
Response 404 - Không tìm thấy
{
"code": 0,
"message": "string",
"status": 0,
"error": "string"
}Code mẫu
1
2
3
4
5
curl --request POST \--url https://bankhub-api-sandbox.sepay.vn/v1/company/edit/d3dafd01-e06b-11f0-b29e-52c7e9b4f41b \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \--header 'content-type: application/json' \--data '{"full_name":"string","short_name":"string","status":"Pending","payment_code":"on","payment_code_prefix":"string","payment_code_suffix_from":1,"payment_code_suffix_to":1,"payment_code_suffix_character_type":"NumberOnly","transaction_amount":null}'
Ví dụ sử dụng
JSCập nhật tên công ty
1
2
3
4
5
6
curl --location --request POST 'https://bankhub-api-sandbox.sepay.vn/v1/company/edit/d3dafd01-e06b-11f0-b29e-52c7e9b4f41b' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \--data '{"full_name": "Công ty TNHH ABC Updated"}'
JSThay đổi trạng thái công ty thành Pending
1
2
3
4
5
6
curl --location --request POST 'https://bankhub-api-sandbox.sepay.vn/v1/company/edit/d3dafd01-e06b-11f0-b29e-52c7e9b4f41b' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \--data '{"status": "Pending"}'
JSCập nhật giới hạn giao dịch
1
2
3
4
5
6
curl --location --request POST 'https://bankhub-api-sandbox.sepay.vn/v1/company/edit/d3dafd01-e06b-11f0-b29e-52c7e9b4f41b' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \--data '{"transaction_amount": "10000000"}'
Lưu ý quan trọng
- Partial Update: API này hỗ trợ partial update, chỉ gửi các trường cần thay đổi
- Validation: Các trường gửi lên vẫn phải tuân thủ quy tắc validation (tên tối thiểu 3 ký tự, status đúng format, v.v.)
- 404 Error: Kiểm tra company_id trước khi cập nhật để tránh lỗi 404
- Transaction Amount: Có thể set là "Unlimited" hoặc một số cụ thể (string format)