Configs
GET /system/configs
Lấy danh sách cấu hình hệ thống
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| value | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.system.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.system.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"_embedded": {
"configs": [
{
"id",
"path",
"label",
"value"
},
...
]
},
}
PUT /system/configs[/:id]
Chỉnh sửa cấu hình
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| value | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.system.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.system.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"value": //Not 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.system.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
//SUCCESS
{
"result": "SUCCESS"
}
//Lỗi
- NOT_FOUND_CONFIG: Không tìm thấy config
- ERROR: Lỗi khác
EInvoices
GET /system/e-invoices[/:type]
Lấy thông tin cấu hình hóa đơn điện tử /system/e-invoices/general Quyền system.einvoice.view
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| e_invoice_active | NO | ||
| e_invoice_business_order | NO | ||
| e_invoice_pricesell_include_tax | NO | ||
| e_invoice_tax_rate_general | NO | ||
| e_invoice_auto_issuance | NO | ||
| e_invoice_auto_sync_tax_authority | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.system.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.system.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"result": "OK",
"einvoice": {
"e_invoice_active":"Y|N", //Bật xuất hóa đơn điện tử
"e_invoice_business_order", //Doanh nghiệp và thứ tự ưu tiên xuất hóa đơn điện tử. Danh sách business_uuid kiểu string json. VD "[\"123\",\"456\"]"
"e_invoice_pricesell_include_tax": "Y|N", //Giá bán đã bao gồm thuế
"e_invoice_tax_rate_general", //Thuế suất chung (%)
}
}
PUT /system/e-invoices[/:type]
Chỉnh sửa cấu hình hóa đơn điện tử /system/e-invoices/general
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| e_invoice_active | NO | ||
| e_invoice_business_order | NO | ||
| e_invoice_pricesell_include_tax | NO | ||
| e_invoice_tax_rate_general | NO | ||
| e_invoice_auto_issuance | NO | ||
| e_invoice_auto_sync_tax_authority | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.system.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.system.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"e_invoice_active",
"e_invoice_business_order",
"e_invoice_pricesell_include_tax",
"e_invoice_tax_rate_general"
}
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.system.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{result: "SUCCESS | ERROR"}
Zalo
GET /system/zalo[/:type]
- Lấy thông tin hết hạn refresh token OA: /system/zalo/refresh_token_oa;
- Lấy thông tin app Zalo (app id, secret key): /system/zalo/zalo_app;
- Lấy thông tin thẻ meta xác thực domain: /system/zalo/meta_domain;
- Lấy đường dẫn ủy quyền ứng dụng OA: /system/zalo/link_permission;
- Lấy cấu hình gởi thông báo ZNS: /system/zalo/zns
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| app_id | NO | ||
| secret_key | NO | ||
| meta | NO | ||
| active_send_zns | NO | ||
| min_order_to_send_zns | NO | ||
| allow_send_zns_with_order_return | NO | ||
| allow_send_zns_when_use_score | NO | ||
| zalo_zns_template_id_order | NO | ||
| zalo_zns_template_id_return | NO | ||
| zalo_zns_template_id_use_score | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.system.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.system.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
-Lấy thông tin hết hạn refresh token OA:
{
"result": "SUCCESS|ERROR",
"refresh_token_expired": null | "Y" | "[number]", //null là chưa có refresh token, Y là đã hết hạn, [number] là còn [number] ngày hết hạn (nếu [number]=0 là sắp hết hạn)
}
- Lấy thông tin app Zalo:
{
"result": "SUCCESS|ERROR",
"app_id",
"secret_key",
}
- Lấy thông tin thẻ meta xác thực domain:
{
"result": "SUCCESS|ERROR",
"callback_url",
"meta"
}
- Lấy đường dẫn ủy quyền ứng dụng OA:
{
"result": "SUCCESS",
"link_auth"
}
//Lỗi xảy ra:
+ REQUIRED_PARAM_CALLBACK_URL: Yêu cầu param callback_url
+ INCORRECT_CALLBACK_URL: callback_url không đúng
+ NOT_SET_APP_INFO: Chưa cấu hình thông tin Zalo: app id, app secret key
+ ERROR: Không tìm thấy thông tin
- Lấy cấu hình ZNS:
{
"result": "SUCCESS|ERROR",
"zns": {
"zalo_zns_template_id_order", //ID mẫu ZNS tích điểm đơn đặt hàng
"zalo_zns_template_id_return", //ID mẫu ZNS trừ điểm đơn trả hàng
"zalo_zns_template_id_use_score", //ID mẫu ZNS đổi điểm
"active_send_zns": "Y|N", //Kích hoạt gởi Zalo ZNS
"min_order_to_send_zns": "number", //Giá trị thấp nhất của đơn hàng được phép gởi Zalo ZNS
"allow_send_zns_with_order_return": "Y|N", //Cho phép gởi Zalo ZNS với toa trả hàng
"allow_send_zns_when_use_score": "Y|N", //Cho phép gởi Zalo ZNS khi đổi điểm
},
"param_zns_template": {...}
-
PUT /system/zalo[/:type]
- Cập nhật thông tin Zalo app: /system/zalo/zalo_app;
- Cập nhật thông tin thẻ meta xác thực domain: /system/zalo/meta_domain;
- Cập nhật thông tin cấu hình gởi ZNS: /system/zalo/zns;
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| app_id | NO | ||
| secret_key | NO | ||
| meta | NO | ||
| active_send_zns | NO | ||
| min_order_to_send_zns | NO | ||
| allow_send_zns_with_order_return | NO | ||
| allow_send_zns_when_use_score | NO | ||
| zalo_zns_template_id_order | NO | ||
| zalo_zns_template_id_return | NO | ||
| zalo_zns_template_id_use_score | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.system.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.system.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"app_id", //Với PUT zalo_app
"secret_key", //Với PUT zalo_app
"meta", //Với PUT meta_domain
"zalo_zns_template_id_order", //Với PUT zns
"zalo_zns_template_id_return", //Với PUT zns
"zalo_zns_template_id_use_score", //Với PUT zns
"active_send_zns", //Với PUT zns
"min_order_to_send_zns", //Với PUT zns
"allow_send_zns_with_order_return", //Với PUT zns
"allow_send_zns_when_use_score" //Với PUT zns
}
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.system.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{"result":"SUCCESS|ERROR"}