Businesses
Quản lý hệ thống doanh nghiệp
GET /businesses
Lấy danh sách doanh nghiệp
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| business_name | NO | ||
| lience_number | NO | ||
| tax_code | NO | ||
| lience_front_image | NO | ||
| lience_back_image | NO | ||
| is_active | NO | ||
| action | NO | ||
| business_type | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"_embedded": {
"businesses": [
{
"uuid",
"business_type",
"business_name",
"is_active": "Y|N",
"created_at"
},
...
]
}
}
POST /businesses
Thêm mới doanh nghiệp
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| business_name | NO | ||
| lience_number | NO | ||
| tax_code | NO | ||
| lience_front_image | NO | ||
| lience_back_image | NO | ||
| is_active | NO | ||
| action | NO | ||
| business_type | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.businesses.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"business_type": "household|company", //Hộ kinh doanh | Công ty
"business_name", //required
"lience_number", //Mã số GPKD
"tax_code", //Mã số thuế
"lience_front_image", //Mặt trước GPKD, kiểu base64
"lience_back_image": "", //Mặt sau GPKD, kiểu base64
"is_active": "Y|N", / required
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
result: "SUCCESS|ERROR"
}
//Các mã lỗi:
- ERROR_UPLOAD_IMAGE: Lỗi khi upload hình ảnh
- ERROR: Lỗi khác
PUT /businesses[/:business_id]
Chỉnh sửa thông tin doanh nghiệp
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| business_name | NO | ||
| lience_number | NO | ||
| tax_code | NO | ||
| lience_front_image | NO | ||
| lience_back_image | NO | ||
| is_active | NO | ||
| action | NO | ||
| business_type | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.businesses.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"action": "editType | editName | editLienceNumber | editTaxCode | editLienceImage | editActive"
"business_type", //Action editType. Reuiqred
"business_name", //Action editName. Reuiqred
"lience_number", //Action editLienceNumber
"tax_code", //Action editTaxCode
"lience_front_image", //Action editLienceImage
"lience_back_image", //Action editLienceImage
"is_active", //Action editActive. Required
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
result: "SUCCESS|ERROR"
}
//Các mã lỗi:
- NOT_FOUND_BUSINESS
- ERROR
- ERROR_UPLOAD_IMAGE //Chỉ với action editLienceImage
- INVALID_IMAGE //Chỉ với action editLienceImage
DELETE /businesses[/:business_id]
Xóa doanh nghiệp
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| business_name | NO | ||
| lience_number | NO | ||
| tax_code | NO | ||
| lience_front_image | NO | ||
| lience_back_image | NO | ||
| is_active | NO | ||
| action | NO | ||
| business_type | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 204: No Content
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
GET /businesses[/:business_id]
Lấy thông tin chi tiết doanh nghiệp
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| business_name | NO | ||
| lience_number | NO | ||
| tax_code | NO | ||
| lience_front_image | NO | ||
| lience_back_image | NO | ||
| is_active | NO | ||
| action | NO | ||
| business_type | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.businesses.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"result": "OK",
"business": {
"uuid",
"business_type",
"business_name",
"lience_number",
"tax_code",
"lience_front_image",
"lience_back_image",
"is_active": "Y|N"
}
}
//Mã lỗi:
- NOT_FOUND_BUSINESS