TicketsTemp

Quản lý phiếu tạm. Lưu ý: xảy ra lỗi "NOT_PERMISSION_DEVICE_LOCATION" nếu person đăng nhập trên device (được set location) mà location không thuộc quyền quản lý của person

GET /tickets/temp

Lấy danh sách phiếu tạm, trừ phiếu hiện tại

Fields

Field Type Description Required
action

Action: - addLine: Thêm sản phẩm; - editQty: Sửa số lượng line; - editPrice: Sửa giá, chiết khấu line; - deleteLine: Xóa line; - editCustomer: Thay đổi khách hàng; - activeTicket: Thay đổi trạng thái phiếu tạm đang chờ khác thành đang chỉnh sửa; - forwardTicket: Chuyển tiếp phiếu hiện tại cho một nhân viên khác.

YES
ticket_id

Ticket đang xử lý hoặc ticket cần active

YES
product_id

Truyền giá trị với action addLine

NO
product_code

Truyền giá trị với action addLine, thay thế khi không truyền product_id. Ưu tiên product_id khi truyền cùng lúc 2 field

NO
line_id

Truyền giá trị với action: editQty, editPrice, deleteLine

NO
qty

Truyền giá trị với action addLine, editQty

NO
price

Truyền giá trị với action editPrice

NO
discount_price

Truyền giá trị với action editPrice. Giảm giá theo số tiền.

NO
discount_rate

Truyền giá trị với action editPrice. Giảm giá theo %. Giá trị thập phân từ 0 đến 1.

NO
customer_id

Truyền giá trị với action editCustomer. Không truyền hoặc truyền rỗng giá trị này khi chọn khách vãng lai

NO
customer_code

Truyền giá trị với action editCustomer, thay thế khi không truyền customer_id. Ưu tiên customer_id khi truyền cùng lúc 2 field

NO
trans_score_code

Truyền giá trị với action transScore

NO
person_id

Truyền giá trị với action forwardTicket

NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

{
   "_embedded": {
       "tickets_temp": [
           {
               "ticket_id":,
               "person_name",
               "customer_name",
               "location_name",
               "person_share",
               "first_product_name", //Tên sản phẩm đại diện
               "num_other_line", //Số lượng line khác (đã trừ line đại diện)
               "created_at",
               "updated_at",         
           },
           ...
       ]
   }
}

GET /tickets/temp[/:ticket_id]

Lấy thông tin nợ của khách hàng: /tickets/temp/debt?ticket=[ticket_temp_id]. Lấy thông tin phiếu hiện tại: /tickets/temp/current. Thêm param set_current_access_token=Y để set quyền truy cập ticket hiện tại.

Fields

Field Type Description Required
action

Action: - addLine: Thêm sản phẩm; - editQty: Sửa số lượng line; - editPrice: Sửa giá, chiết khấu line; - deleteLine: Xóa line; - editCustomer: Thay đổi khách hàng; - activeTicket: Thay đổi trạng thái phiếu tạm đang chờ khác thành đang chỉnh sửa; - forwardTicket: Chuyển tiếp phiếu hiện tại cho một nhân viên khác.

YES
ticket_id

Ticket đang xử lý hoặc ticket cần active

YES
product_id

Truyền giá trị với action addLine

NO
product_code

Truyền giá trị với action addLine, thay thế khi không truyền product_id. Ưu tiên product_id khi truyền cùng lúc 2 field

NO
line_id

Truyền giá trị với action: editQty, editPrice, deleteLine

NO
qty

Truyền giá trị với action addLine, editQty

NO
price

Truyền giá trị với action editPrice

NO
discount_price

Truyền giá trị với action editPrice. Giảm giá theo số tiền.

NO
discount_rate

Truyền giá trị với action editPrice. Giảm giá theo %. Giá trị thập phân từ 0 đến 1.

NO
customer_id

Truyền giá trị với action editCustomer. Không truyền hoặc truyền rỗng giá trị này khi chọn khách vãng lai

NO
customer_code

Truyền giá trị với action editCustomer, thay thế khi không truyền customer_id. Ưu tiên customer_id khi truyền cùng lúc 2 field

NO
trans_score_code

Truyền giá trị với action transScore

NO
person_id

Truyền giá trị với action forwardTicket

NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

- Get debt customer
{
    "result": "SUCCESS",
    "debt": {
        "taxid",
        "name",
        "maxdebt",
        "curdate",
        "curdebt"
    },
}
//Lỗi có thể xảy ra:
- REQUIRED_PARAM_TICKET: yêu cầu param ticket
- TICKET_NOT_CURRENT: Ticket param không phải ticket current
- TICKET_NOT_CUSTOMER: Chưa set customer ticket

- GET ticket temp current
{
    "result": "SUCCESS",
    "current_ticket": {
        "ticket_id",
        "person_name",
        "customer": null | [
            "id",
            "name",
            "taxcategory",
            "score",
            "valuetoscore",
            "loyal_name",
            "loyal_discount"
        ],
        "lines": [{
                "line_id",
                "product_id",
                "product_name",
                "product_image",
                "price",
                "discount_price_line",
                "discount_price",
                "discount_rate_line",
                "discount_rate",
                "price_discount_line",
                "price_discount",
                "qty",
                "total_line",
                "units_package",
                "promotions": [], // danh sách khuyến mại
                "tutorials": [] //danh sách HDSD
            },...],
        "summary": {
            "price", //Tổng ĐH trước chiết khấu
            "price_discount",//Tổng chiết khấu
            "score",//Điểm TL đơn hàng
            "score_trans": null | {
                "score", //Số điểm đổi
                "status": "valid | invalid" // Có hiệu lực hoặc hết hiệu lực
             },
            "score_total",//Tổng số điểm TL mới
            "total",
            "total_round"
        },
        "note"
    }
}
//Các lỗi có thể xảy ra
{
    "result":"ERROR",
    "code": 
        - NOT_CURRENT_ACCESS_TOKEN: Chưa set truy cập phiếu tạm cho access_token hiện tại.
        - ERROR: Lỗi khác
}

PUT /tickets/temp[/:ticket_id]

Xử lý các hành động: addLine (Thêm SP), editQty (Chỉnh sửa số lượng), editPrice (Chỉnh giá và chiết khấu), deleteLine (Xóa dòng), editCustomer (thay đổi khách hàng), transScore (đổi điểm), activeTicket (kích hoạt phiếu chờ), forwardTicket (chuyển tiếp phiếu), createNewTicket (Tạo phiếu mới), editNote (Sửa ghi chú)

Fields

Field Type Description Required
action

Action: - addLine: Thêm sản phẩm; - editQty: Sửa số lượng line; - editPrice: Sửa giá, chiết khấu line; - deleteLine: Xóa line; - editCustomer: Thay đổi khách hàng; - activeTicket: Thay đổi trạng thái phiếu tạm đang chờ khác thành đang chỉnh sửa; - forwardTicket: Chuyển tiếp phiếu hiện tại cho một nhân viên khác.

YES
ticket_id

Ticket đang xử lý hoặc ticket cần active

YES
product_id

Truyền giá trị với action addLine

NO
product_code

Truyền giá trị với action addLine, thay thế khi không truyền product_id. Ưu tiên product_id khi truyền cùng lúc 2 field

NO
line_id

Truyền giá trị với action: editQty, editPrice, deleteLine

NO
qty

Truyền giá trị với action addLine, editQty

NO
price

Truyền giá trị với action editPrice

NO
discount_price

Truyền giá trị với action editPrice. Giảm giá theo số tiền.

NO
discount_rate

Truyền giá trị với action editPrice. Giảm giá theo %. Giá trị thập phân từ 0 đến 1.

NO
customer_id

Truyền giá trị với action editCustomer. Không truyền hoặc truyền rỗng giá trị này khi chọn khách vãng lai

NO
customer_code

Truyền giá trị với action editCustomer, thay thế khi không truyền customer_id. Ưu tiên customer_id khi truyền cùng lúc 2 field

NO
trans_score_code

Truyền giá trị với action transScore

NO
person_id

Truyền giá trị với action forwardTicket

NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.v1+json
application/hal+json
application/json
Content-Type
application/vnd.tickets.v1+json
application/json
Authorization HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details)

Body

{
   "action": "addLine | editQty | editPrice | deleteLine | editCustomer | transScore | activeTicket | forwardTicket | createNewTicket | editNote",
   "ticket_id": "Ticket đang xử lý hoặc ticket đang chờ cho action activeTicket",
   "product_id|product_code": "Áp dụng với action addLine",
   "line_id": "Áp dụng với các action: editQty, editPrice, deleteLine",
   "qty": "Áp dụng với action addLine|editQty",
   "price": "Áp dụng với action addLine, editPrice",
   "discount_price": "Áp dụng với action editPrice. Giảm giá theo số tiền.",
   "discount_rate": "Áp dụng với action editPrice. Giảm giá theo %. Giá trị thập phân từ 0 đến 1.",
   "customer_id|customer_code": "Áp dụng với action editCustomer",
   "trans_score_code": "Áp dụng với action transScore"
   "person_id" : "Áp dụng với action forwardTicket",
   "note": "Áp dụng với action editNote"
}

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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

Trả về thông tin phiếu hiện tại theo cấu trúc trả về GET /tickets/temp/current

Các lỗi có thể xảy ra:
Lỗi chung:
+ TICKET_NOT_CURRENT: Giá trị ticket_id không phải ticket hiện tại. (Trừ action activeTicket)
+ NOT_CURRENT_ACCESS_TOKEN: Chưa set truy cập phiếu tạm cho access_token hiện tại.
+ ERROR: Lỗi khác.
Lỗi riêng:
- addLine:
  + PRODUCT_NOT_FOUND: Không tìm thấy SP
- editQty, editPrice, deleteLine:
  + LINE_NOT_FOUND: Không tìm thấy line để chỉnh sửa
- editCustomer:
  + CUSTOMER_NOT_FOUND: Không tìm thấy khách hàng
  + PRODUCT_NOT_FOUND: Có sản phẩm trong ticket không tìm thấy
- transScore:
  + TICKET_NOT_CUSTOMER: Phiếu chưa chọn khách hàng
  + NOT_FOUND_SCORE_TRANS: mã đổi điểm không tìm thấy
  + SCORE_TRANS_CODE_INVALID: Mã đổi điểm không đúng
  + SCORE_TRANS_CODE_EXPIRED: Mã đổi điểm hết hạn
  + SCORE_TRANS_GREATER_THAN_SCORE: Điểm đổi không được lớn điểm TL của KH
- activeTicket:
  + TICKET_NOT_FOUND: Không tìm thấy ticket
- forwardTicket:
  + PERSON_NOT_FOUND: Nhân viên không tìm thấy
  + NOT_FORWARD_YOURSELF: Không được chuyển tiếp cho chính mình
  + TICKET_NOT_ITEM: Phiếu không có item nào
- createNewTicket: không có

DELETE /tickets/temp[/:ticket_id]

Xóa phiếu hiện tại: /tickets/temp/[ticket_id]; Và tự động tạo phiếu mới. Trả về thông tin phiếu mới theo cấu trúc trả về GET /tickets/temp/current. Các lỗi có thể xảy ra: - TICKET_NOT_CURRENT: Không tìm thấy ticket; - NOT_CURRENT_ACCESS_TOKEN: Chưa set truy cập phiếu tạm cho access_token hiện tại; - ERROR: Lỗi khác

Fields

Field Type Description Required
action

Action: - addLine: Thêm sản phẩm; - editQty: Sửa số lượng line; - editPrice: Sửa giá, chiết khấu line; - deleteLine: Xóa line; - editCustomer: Thay đổi khách hàng; - activeTicket: Thay đổi trạng thái phiếu tạm đang chờ khác thành đang chỉnh sửa; - forwardTicket: Chuyển tiếp phiếu hiện tại cho một nhân viên khác.

YES
ticket_id

Ticket đang xử lý hoặc ticket cần active

YES
product_id

Truyền giá trị với action addLine

NO
product_code

Truyền giá trị với action addLine, thay thế khi không truyền product_id. Ưu tiên product_id khi truyền cùng lúc 2 field

NO
line_id

Truyền giá trị với action: editQty, editPrice, deleteLine

NO
qty

Truyền giá trị với action addLine, editQty

NO
price

Truyền giá trị với action editPrice

NO
discount_price

Truyền giá trị với action editPrice. Giảm giá theo số tiền.

NO
discount_rate

Truyền giá trị với action editPrice. Giảm giá theo %. Giá trị thập phân từ 0 đến 1.

NO
customer_id

Truyền giá trị với action editCustomer. Không truyền hoặc truyền rỗng giá trị này khi chọn khách vãng lai

NO
customer_code

Truyền giá trị với action editCustomer, thay thế khi không truyền customer_id. Ưu tiên customer_id khi truyền cùng lúc 2 field

NO
trans_score_code

Truyền giá trị với action transScore

NO
person_id

Truyền giá trị với action forwardTicket

NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Tickets

Quản lý phiếu chính thức. Lưu ý: xảy ra lỗi "NOT_PERMISSION_DEVICE_LOCATION" nếu person đăng nhập trên device (được set location) mà location không thuộc quyền quản lý của person

POST /tickets/tickets

Tạo phiếu chính thức từ phiếu tạm

Fields

Field Type Description Required
ticket_temp_id

Id của ticket temp current

NO
payment_method

Phương thức thanh toán. Mặc định "cash"

NO
cash_tendered

Tiền mặt khách đưa. Chỉ áp dụng với phương thức thanh toán cash

NO
action NO
line NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.v1+json
application/hal+json
application/json
Content-Type
application/vnd.tickets.v1+json
application/json
Authorization HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details)

Body

{
   "ticket_temp_id": "Id của ticket temp current",
   "payment_method": "cash|debt" //Phương thức thanh toán,
   "cash_tendered": "Tiền mặt khách đưa. Chỉ áp dụng với phương thức thanh toán cash"
}

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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

{
    "result": "SUCCESS",
    "ticket": {
        "ticketid",
        "date",
        "person",
        "customer": null | {
            "taxid": "",
            "name": "",
            "curdebt",
            "loyal_name": "", // có thể không có
            "score": "", // có thể không có
            "payment_nearest": { // Có hoặc không
                "date",
                "total"
            }
        },
        "lines": [
            {
                "product_ref",
                "product_name",
                "product_name_root", 
                "discount_price",
                "discount_rate",
                "discount_total",
                "price",
                "qty",
                "total_line"
            },
            ...
        ],
        "summary": {
            "price", //Tổng giá trước CK
            "discount", //Tổng CK
            "price_discount", //Tổng giá sau CK
            "score", //Điểm TL đơn hàng. Có khi có loyal
            "score_trans", //Điểm TL đổi. Có khi có loyal
            "total_score", Tổng điểm TL mới (sau khi cộng TL đơn hàng và trừ TL đổi). Có khi có loyal
            "total", //Tổng cộng đơn hàng = price_discount - score_trans
            "total_debt", // Tổng nợ. Có khi có customer
            "total_round", //Làm tròn tổng cộng. Có với payment cash            
            "cash_tendered", //Tiền KH đưa. Có với payment cash
            "cash_change" //Tiền thối lại. Có với payment cash
        },
        "note"
    }
}

Các lỗi có thể xảy ra:
- DEVICE_NOT_SET_LOCATION: Thiết bị chưa được set kho
- ERROR_DEVICE: Có lỗi thiết bị (cần đăng ký lại)
- TICKET_TEMP_INVALID: Phiếu tạm không đúng.
- NOT_CURRENT_ACCESS_TOKEN: Chưa set truy cập phiếu tạm cho access_token hiện tại.
- TICKET_TEMP_NOT_ITEM: Phiếu tạm không có item nào
- SCORE_TRANS_CODE_INVALID: Điểm đổi không hợp lệ
- CASH_TENDERED_NOT_ENOUGH_PAY: Tiền khách đưa không đủ
- TICKET_NOT_CUSTOMER: Phiếu chưa set khách hàng
- DEBT_NOT_GREATER_MAXDEBT: Tổng nợ vượt max nợ
- ERROR: Lỗi khác

GET /tickets/tickets

Lấy danh sách hóa đơn. Có thể sử dụng các param để lọc danh sách: start_date, end_date, ticketid, tickettype, customer, person, location. Yêu cầu phải có ít nhất 1 trong các param "start_date, ticketid, customer". Start_date, end_date cần theo format "YYYY-mm-dd HH:ii"; Truyền param "get_total=Y" để lấy tổng các giá trị

Fields

Field Type Description Required
ticket_temp_id

Id của ticket temp current

NO
payment_method

Phương thức thanh toán. Mặc định "cash"

NO
cash_tendered

Tiền mặt khách đưa. Chỉ áp dụng với phương thức thanh toán cash

NO
action NO
line NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

- Tổng các giá trị
{
    "result": "SUCCESS",
    "total": {
        "total",
        "real",
        "score",
        "round"
    }
}

- Danh sách hóa đơn
{
    "_embedded": {
        "tickets": [
            {
                "ticket_uuid",
                "ticketid",
                "tickettype",
                "status",
                "datenew",
                "customer_name",
                "person_name",
                "total",
                "real",
                "score",
                "round",
            }
        ]
    }
}

GET /tickets/tickets[/:ticket_uuid]

  • Lấy thông tin nợ của khách hàng: /[ticket_uuid]?get_debt=Y;
  • Lấy thông tin chi tiết hóa đơn: /[ticket_uuid]. Mặc định giá trị [ticket_uuid] là ticket_uuid, để lấy theo ticketid thì truyền param "type=0|1" chính là ticket_type và lúc này [ticket_uuid] cần truyền vào là ticketid.

Fields

Field Type Description Required
ticket_temp_id

Id của ticket temp current

NO
payment_method

Phương thức thanh toán. Mặc định "cash"

NO
cash_tendered

Tiền mặt khách đưa. Chỉ áp dụng với phương thức thanh toán cash

NO
action NO
line NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

- Lấy thông tin nợ của KH
{
    "result": "SUCCESS",
    "debt": {
        "taxid",
        "name",
        "maxdebt",
        "curdate",
        "curdebt"
    }
}
//Các lỗi xảy ra:
- TICKET_NOT_FOUND: Không tìm thấy ticket
- TICKET_NOT_CUSTOMER: Ticket không có khách hàng

- Lấy thông tin chi tiết hóa đơn
{
    "result": "SUCCESS",
    "ticket": {
        "ticket_uuid",
        "ticketid",
        "tickettype": "0|1",
        "status": "0|[ticketid]",
        "datenew",
        "person": {
            "person_id",
            "person_name"
        },
        "customer": {
            "customer_id",
            "customer_taxid",
            "customer_name",
            "loyal_name", //có hoặc không
            "loyal_discount", //có hoặc không
            "loyal_score", //có hoặc không
            "loyal_scoretrans" //có hoặc không
        },
        "lines": [
            {
                "line_id",
                "product_id",
                "product_name",
                "price",
                "price_discount",
                "units",
                "total_line"
            },
            ...
        ],
        "summary": {
            "total_order",
            "total_discount",
            "total_order_discount",
            "loyal_score", //có hoặc không
            "total_loyal_score" //có hoặc không
        },
        "payment": {
            "total",
            "total_round", //có hoặc không
            "cash_tendered", //có hoặc không
            "cash_change" //có hoặc không
        },
        "return": [
            {
                "ticket_uuid",
                "ticketid",
                "datenew"
            },
            ...
        ],
        "note"
    }
}
//Các lỗi có thể xảy ra:
- DUPLICATE_LINE_ID: Trùng data line_id
- DEVICE_NOT_SET_LOCATION: Thiết bị chưa set kho
- ERROR_DEVICE: Lỗi thiết bị
- TICKET_NOT_FOUND: Không tìm thấy ticket bán
- PRODUCT_NOT_FOUND_IN_TICKET: Có sản phẩm không tìm thấy trong ticket bán
- UNITS_RETURN_TOO_LARGE: Số lượng trả hàng quá lớn so với SL mua

PUT /tickets/tickets[/:ticket_uuid]

Trả hàng và lấy thông tin trước khi trả hàng.

Fields

Field Type Description Required
ticket_temp_id

Id của ticket temp current

NO
payment_method

Phương thức thanh toán. Mặc định "cash"

NO
cash_tendered

Tiền mặt khách đưa. Chỉ áp dụng với phương thức thanh toán cash

NO
action NO
line NO
note NO

Request

Headers

Header Value
Accept
application/vnd.tickets.v1+json
application/hal+json
application/json
Content-Type
application/vnd.tickets.v1+json
application/json
Authorization HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details)

Body

{
   "action": "return|getReturn",
   "line": "[{"line_id","product_id","units"},...]",
   "payment_method":"cash|debt" //đối với action return
   "note"
}

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.tickets.v1+json
application/hal+json
application/json
Allow Comma-separated list of all HTTP methods allowed

Body

{
    "result": "SUCCESS",
    "return|getReturn": {
        "ticketid", // chỉ với return
        "date", //chỉ với return
        "person", //chỉ với return
        "customer": null | {
            "taxid",
            "name",
            "curdebt",
            "loyal_name", // có hoặc không
            "score" //có hoặc không,
            "payment_nearest": { // Có hoặc không. Chỉ với return
                "date",
                "total"
            }
        },
        "lines": [
            {
                "product_ref", //Mã SP
                "product_name", //tên SP, đã gồm CK
                "product_name_root", //tên SP,
                "discount_price", //tên SP, đã gồm CK
                "discount_rate", //tên SP, đã gồm CK
                "discount_total",
                "price", // giá gốc SP
                "qty", 
                "total_line" //Tổng dòng, đã tính CK
            },
            ...
        ],
        "summary": {
            "price", // Tổng giá trước CK
            "discount", //Tổng CK
            "price_discount", // Tổng giá sau CK
            "score", //Điểm TL DH, có hoặc không
            "total_score", //Tổng điểm TL mới của KH, có hoặc không
            "total", //Tổng thanh toán
            "total_debt", // Tổng nợ. Có khi có customer. Chỉ với return
            "total_round"://Làm tròn thanh toán. Có với payment cash
        }
    },
}

//Các lỗi có thể xảy ra:
- DUPLICATE_LINE_ID: Trùng data line_id
- DEVICE_NOT_SET_LOCATION: Thiết bị chưa set kho
- ERROR_DEVICE: Lỗi thiết bị
- TICKET_NOT_FOUND: Không tìm thấy ticket bán
- PRODUCT_NOT_FOUND_IN_TICKET: Có sản phẩm không tìm thấy trong ticket bán
- DUPLICATE_PRODUCT: Dòng sản phẩm đã tồn tại
- UNITS_RETURN_TOO_LARGE: Số lượng trả hàng quá lớn so với SL mua
- TICKET_NOT_CUSTOMER: Ticket không có customer
- ERROR: Lỗi khác