PosApp Open APIs
  1. Thẻ PosApp
PosApp Open APIs
  • Tổng quan
  • Thẻ PosApp
    • Mã lỗi (error code)
    • API Idempotency
    • Nạp tiền vào thẻ
      POST
    • Kiểm tra trạng thái giao dịch
      POST
  • Thông tin khác
    • Digital Signature
  • Webhook
    • Tổng quan
    • Order Schema
    • Warehouse import Schema
  • Sản phẩm
    • Tạo mới sản phẩm
      POST
    • Sửa một sản phẩm
      PATCH
    • Tồn kho sản phẩm
      POST
  • Khuyến mãi
    • Đồng giá
      • Tạo khuyến mãi
      • Sửa khuyến mãi
    • Xóa khuyến mãi
      POST
  • Đăng ký tài khoản PosApp
    • Danh sách mô hình kinh doanh
      GET
    • Đăng ký tài khoản
      POST
  1. Thẻ PosApp

Nạp tiền vào thẻ

Test Env
https://retail-api.posapp.vn/
Test Env
https://retail-api.posapp.vn/
POST
api/public/posapp-cards/top-up
API này dùng để gửi yêu cầu nạp tiền trực tiếp vào thẻ trả trước của khách hàng theo card_id.

Request

Header Params
Accept
string 
optional
Example:
application/json
Content-Type
string 
required
Example:
application/json
Body Params application/json
partner_code
string 
required
Mã đối tác, được PosApp cung cấp
request_id
string 
required
Định danh duy nhất cho mỗi yêu cầu.
Đối tác sử dụng requestId để xử lý idempotency
<= 50 characters
card_id
string 
required
Mã thẻ được phát hành từ phía PosApp
amount
integer 
required
Số tiền nạp
>= 1<= 50000000
order_id
null 
optional
Mã đơn hàng của đối tác
order_info
string  | null 
optional
Thông tin đơn hàng
lang
string 
required
Ngôn ngữ của message được trả về (vi hoặc en)
Default:
vi
Examples:
vien
extra_data
string  | null 
optional
Thông tin thêm (định dạng base64)
signature
string 
required
Chữ ký để xác nhận giao dịch. Sử dụng thuật toán Hmac_SHA256 theo định dạng chuỗi sắp xếp tất cả tên khóa của trường dữ liệu từ a-z: amount=10000&card_id=123456
Example
{
    "partner_code": "PAC1234567",
    "request_id": "d3d9c551-ab6a-4efd-bba5-c9b99abb6812",
    "card_id": "NRP0CPBJWX",
    "order_id": "13475873434",
    "amount": 10000,
    "order_info": "Nap the cho NV1 voi don hang NT001",
    "lang": "vi"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://retail-api.posapp.vn/api/public/posapp-cards/top-up' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "partner_code": "PAC1234567",
    "request_id": "d3d9c551-ab6a-4efd-bba5-c9b99abb6812",
    "card_id": "NRP0CPBJWX",
    "order_id": "13475873434",
    "amount": 10000,
    "order_info": "Nap the cho NV1 voi don hang NT001",
    "lang": "vi"
}'

Responses

🟢200Success
application/json
Body
partner_code
string 
required
Mã đối tác (PosApp cung cấp)
request_id
string 
required
Định danh duy nhất cho mỗi yêu cầu.
Đối tác sử dụng requestId để xử lý idempotency
card_id
string 
required
Mã thẻ được phát hành từ phía PosApp
amount
integer 
required
Số tiền cần nạp
posapp_trans_id
string 
required
Mã giao dịch của PosApp
order_id
string  | null 
optional
Mã đơn hàng của đối tác
order_info
string  | null 
optional
Thông tin đơn hàng
paid_at
string 
required
Thời gian nạp tiền thành công. Định dạng ISO UTC. VD: 2024-07-24T07:18:24.000000Z
message
string 
required
Mô tả lỗi, ngôn ngữ dựa trên lang
result_code
integer 
required
Mã lỗi, thành công sẽ là 0
extra_data
null 
optional
Thông tin thêm (định dạng base64)
lang
string 
required
Ngôn ngữ của message được trả về (vi hoặc en)
signature
string 
required
Chữ ký
Example
{
    "partner_code": "PAC1234567",
    "request_id": "d3d9c551-ab6a-4efd-bba5-c9b99abb6812",
    "card_id": "NRP0CPBJWX",
    "amount": 10000,
    "posapp_trans_id": "9dafcf76-6f58-48b1-8fb9-9ce136d6568d",
    "order_id": "13475873434",
    "order_info": "Nap the cho NV1 voi don hang NT001",
    "paid_at": null,
    "message": "Nạp tiền thành công",
    "result_code": null,
    "extra_data": null,
    "lang": "vi",
    "signature": "cf8f62599fcb3639ed16c8223013ad4c4e94b67fde17d692797ec8e076fa7be2"
}
🟠400Bad Request
Modified at 2024-10-16 04:51:11
Previous
API Idempotency
Next
Kiểm tra trạng thái giao dịch
Built with