Create API ReferenceTham chiếu API Create · source_type=API_PAYMENT · Build SDK laterSDK xây sau· do not change Create portal.· không thay Create portal.
1. Introduction1. Giới thiệu
1.1 Purpose1.1 Mục đích
Neo business confirms that the Payment API creates the same type of invoice; SDK details to follow.Neo business confirmation rằng API Payment tạo cùng loại invoice; chi tiết SDK để sau.
RoundVòng
ContentNội dung
OwnerThực hiện
A — business confirmation via UI (this document)A — xác nhận nghiệp vụ qua giao diện (tài liệu này)
UI journey: screens, buttons, fieldsHành trình trên giao diện: màn hình, nút, trường
Rules and user-visible error messagesQuy tắc, thông báo lỗi người dùng thấy
1.4 Glossary & abbreviations1.4 Thuật ngữ & viết tắt
Terms follow the CPG glossary: keep industry English terms; short meaning text (ND-03).Thuật ngữ theo Từ điển thuật ngữ CPG: giữ thuật ngữ ngành (tiếng Anh), giải thích ngắn bằng tiếng Việt (ND-03).
VietnameseTiếng Việt
English / UITiếng Anh / trên giao diện
MeaningNghĩa
StatusTrạng thái
hóa đơn
Invoice
Merchant crypto payment request document (code INV-…), linked to order/customer/line items.Chứng từ yêu cầu thanh toán crypto của merchant (mã INV-…), gắn order/khách/dòng hàng.
referencetham khảo
trạng thái hóa đơn
PENDING / PAID / OVERDUE / CANCELLED
Pending: awaiting payment. Paid: fully paid. Overdue: past due unpaid. Cancelled: cancelled. System-driven only.Pending: chờ thanh toán. Paid: đã thanh toán đủ. Overdue: quá hạn chưa thanh toán. Cancelled: đã hủy. Chỉ hệ thống đổi trạng thái.
referencetham khảo
tài sản
Asset
Token received / held: USDT, USDC (stablecoin).Đồng tiền nhận / giữ: USDT, USDC (stablecoin).
referencetham khảo
mã đơn
Order ID
Merchant order reference bound to the invoice.Tham chiếu đơn hàng phía merchant gắn với hóa đơn.
referencetham khảo
hạn thanh toán
Due Date / Expiry Time
Invoice payment deadline; past due may become Overdue.Thời điểm hết hạn thanh toán hóa đơn; quá hạn có thể chuyển Overdue.
referencetham khảo
nguồn tạo
source_type
Invoice origin: MANUAL (portal), QR_CODE, CHECKOUT_LINK, API_PAYMENT (SDK/API).Nguồn sinh hóa đơn: MANUAL (cổng), QR_CODE, CHECKOUT_LINK, API_PAYMENT (SDK/API).
referencetham khảo
(keep English)
Hot Wallet (HW)
CPG-managed transit wallet per merchant and network. Do not use the Vietnamese calque for 'hot wallet'.Ví trung chuyển do CPG quản lý, theo từng merchant và network. Không dịch 'ví nóng'.
referencetham khảo
(keep English)
Virtual Account (VA)
Per-customer deposit address bound to a Hot Wallet.Địa chỉ nhận tiền riêng của từng khách hàng, gắn với một Hot Wallet.
referencetham khảo
(keep English)
network
Blockchain the wallet runs on: TRON, BSC, Ethereum, Polygon (Mainnet / Testnet).Blockchain mà ví hoạt động: TRON, BSC, Ethereum, Polygon (Mainnet / Testnet).
referencetham khảo
xuất dữ liệu
Export
Download invoice list (CSV / Excel / PDF) under current filters.Tải danh sách hóa đơn (CSV / Excel / PDF) theo bộ lọc hiện tại.
Required — fail = not accepted (RFC 2119: SHALL)Bắt buộc — không đạt thì không nghiệm thu (RFC 2119: SHALL)
MUST NOT
Forbidden (SHALL NOT)Cấm (SHALL NOT)
SHOULD
Recommended — alternatives need a reason (SHOULD)Khuyến nghị — làm khác phải nêu lý do (SHOULD)
MAY
Optional (MAY)Tuỳ chọn (MAY)
Status labelNhãn trạng thái
MeaningNghĩa
Confirmed (source)Đã xác nhận (source)
Already in URD / RTM / FSD v2.2 or confirmed by FlyPay (cite source, date).Đã có trong URD / RTM / FSD v2.2 hoặc FlyPay đã xác nhận (ghi nguồn, ngày).
DHC proposalDHC đề xuất
DHC proposal with rationale; needs FlyPay agreement.DHC đề xuất kèm lý do; cần FlyPay đồng ý.
Awaiting decision QnChờ quyết định Qn
FlyPay must answer Qn in §12; each has a DHC recommendation.Cần FlyPay trả lời câu hỏi Qn ở Mục 12; mỗi câu có khuyến nghị DHC.
DHC added (v0.2)DHC bổ sung (bản 0.2)
DHC added in the version in parentheses (usually missing shot / description).DHC bổ sung ở phiên bản ghi trong ngoặc (thường là ảnh / mô tả còn thiếu).
referencetham khảo
Explanatory info, not a requirement.Thông tin giải thích, không phải yêu cầu.
Combined cellÔ ghép
Example: Confirmed (RL-05-01); length: Awaiting Q6. 'Confirmed' applies only to the cited part.Ví dụ: Đã xác nhận (RL-05-01); độ dài: Chờ quyết định Q6.
SymbolKý hiệu
MeaningNghĩa
S1, S2, S2-N…
Screen ids; suffix = variantMã màn hình; hậu tố là biến thể
B1…Bn
User-flow step ids (§5)Mã bước trong luồng người dùng (Mục 5)
123…
Callout numbers on shots; explained in the table below the image.Số chú thích trên ảnh; giải thích ở bảng ngay dưới ảnh.
BR, RL, TC, E-*, AC, Q, L
Requirement, rule, test case, error, acceptance, question, referenceYêu cầu, quy tắc, kịch bản kiểm thử, thông báo lỗi, tiêu chí nghiệm thu, câu hỏi, tài liệu tham chiếu
(new id)(mã mới)
DHC-proposed id; FlyPay assigns official RTM ids (ND-08)Mã DHC đề xuất; FlyPay cấp mã chính thức khi cập nhật RTM (ND-08)
dd/mm/yyyy
Date formatĐịnh dạng ngày
2. Overview2. Tổng quan
No MP UI for create API (Section 6).Không UI MP cho API create (Mục 6).
DHC added (v0.2)DHC bổ sung (bản 0.2)— no MP wireframe; this is a reference page.— không wireframe MP; đây là trang tham chiếu.
Figure 1Hình 1— Overview: There is no MP screen for the create API — merchant calls POST /api/v1/invoices (SDK to be built later).— Toàn cảnh: Không có màn MP cho API create — merchant gọi POST /api/v1/invoices (SDK xây sau).
3. Business rules3. Nghiệp vụ
3.1 Create via API / SDK3.1 Tạo qua API / SDK
Together contract created with portal butCùng hợp đồng tạo với portal nhưngsource_type=API_PAYMENT(and optional(và optionalsource_id). Merchant Developer only). Merchant Developer chỉread-onlyon the gate.trên cổng.Full Client SDK / OpenAPI → after Round A.Client SDK / OpenAPI đầy đủ → sau Vòng A.
ND-02 / Scope of Circle A:ND-02 / phạm vi Vòng A:this page does not changetrang này không thayL31 Create Invoice; do not describe SDK methods, retry, webhook.; không mô tả SDK methods, retry, webhook.
BR IDMã BR
Original wording (URD / RTM / FSD)Nguyên văn (URD / RTM / FSD)
InterpretationDiễn giải
UI manifestationThể hiện trên giao diện
StatusTrạng thái
FSD §6 POST /api/v1/invoices
Create body + response
Field referenceTham chiếu field
—
Confirmed (FSD §6)Đã xác nhận (FSD §6)
API_Invoice
RBAC invoice:manage
Bearer token
—
Confirmed (plan)Đã xác nhận (plan)
4. Roles & permissions4. Vai trò & phân quyền
ActionThao tác
Admin
Finance
Operator
Support
Developer
Viewer
StatusTrạng thái
Call create API (outside MP)Gọi API create (ngoài MP)
Have*Có*
NoneKhông
NoneKhông
NoneKhông
Have* (credential)Có* (credential)
NoneKhông
Confirmed (FSD §2)Đã xác nhận (FSD §2) *qua API key/app
View invoice created from API on MPXem invoice tạo từ API trên MP
CreditCó
CreditCó
CreditCó
CreditCó
CreditCó
CreditCó
Confirmed (FSD §2)Đã xác nhận (FSD §2)
5. User flows5. Luồng người dùng
Figure 4 — API create (SDK later) — Column = actor lane; blue ellipse = Start; red ellipse = End; diamond = condition (Hình 4 — API create (SDK later) — Cột = làn actor; elip xanh = Bắt đầu; elip đỏ = Kết thúc; hình thoi = điều kiện (Achieve/HaveĐạt/Có↓ next step,↓ bước sau,Not pass/NoKhông đạt/Không→ go back to the step indicated by the red arrow); dotted line = option / step outside the function. Text in the block is not cut off.→ quay về bước ghi trên mũi tên đỏ); nét đứt = phương án / bước ngoài tính năng. Chữ trong block không bị cắt.
Each step: screenshot first, then a table explaining each orange callout number (HA-02, HA-03). Keep UI copy in English as on DEV. DEV shots are wireframes; missing variants are marked DHC added (v0.2)DHC added (version 0.2) in the Figure column.Mỗi bước: ảnh màn hình trước, bảng ngay dưới giải thích từng số tròn cam (HA-02, HA-03). Chữ trên giao diện để tiếng Anh như DEV hiện tại. Ảnh DEV là wireframe; biến thể chưa có ảnh ghi DHC added (v0.2)DHC bổ sung (bản 0.2) ở cột Hình.
6.1 No MP UI step6.1 Không có bước UI MP
Reference field table (match Create portal + source_type):Bảng field tham chiếu (khớp Create portal + source_type):
Each rule uses keywords from §1.6 and a verification method: Test = test against AC in §11.1; Inspection = verify directly on the UI.Mỗi quy tắc dùng từ khoá theo Mục 1.6 và có cách kiểm chứng: Test = kiểm thử theo AC ở Mục 11.1; Inspection = kiểm tra trực tiếp trên giao diện.
12. Questions for FlyPay12. Câu hỏi cần FlyPay quyết định
Each question includes a DHC recommendation (ND-07). FlyPay only needs to accept the recommendation or choose another option.Mỗi câu kèm khuyến nghị DHC (ND-07). FlyPay chỉ cần chọn: đồng ý khuyến nghị, hoặc chọn phương án khác.
IDMã
QuestionCâu hỏi
SectionMục
DHC proposalĐề xuất DHC
Q1
Preferred language SDK (JS/Python)?SDK ngôn ngữ ưu tiên (JS/Python)?
—
Outside Circle A — Product to be decided later.Ngoài Vòng A — Product quyết định sau.
Q2
Is Idempotency-Key required on create?Idempotency-Key bắt buộc trên create?
—
Recommendations are available in Round B.Khuyến nghị có ở Round B.
13. SoW baseline & FSD handoff13. Baseline SoW & phần chuyển sang FSD
13.1 Items for SoW baseline13.1 Phần đưa vào baseline SoW
The feature enters baseline when Q1–Q2 are decided and FlyPay signs §14.Tính năng vào baseline khi Q1–Q2 đã có quyết định và FlyPay ký Mục 14.
13.2 Items moved to FSD (Round B)13.2 Phần chuyển sang FSD (vòng B)
Round A MUST NOT contain APIs, data tables, or system error codes (ND-02). The following belong in Round B FSD:Vòng A KHÔNG ĐƯỢC chứa API, bảng dữ liệu, mã lỗi hệ thống (ND-02). Các nội dung sau thuộc FSD vòng B:
SDK docs
Idempotency
OpenAPI export
14. Feedback & approval14. Phản hồi & phê duyệt
14.1 How to respond14.1 Cách phản hồi
FlyPay records each Q1–Q2 decision in the 'FlyPay decision' column of §12.FlyPay ghi quyết định từng câu Q1–Q2 vào cột 'FlyPay quyết định' ở Mục 12.
Other feedback: Word comments anchored to the exact paragraph / figure.Góp ý khác: ghi comment trong file Word, mỗi comment gắn đúng đoạn / ảnh.
Reply on the same email thread used to send the document.Gửi lại theo thread email đã gửi tài liệu.
DHC updates the next revision, updates Version history, and marks changed items.DHC cập nhật bản kế tiếp, ghi Lịch sử phiên bản và đánh dấu mục đã sửa.
14.2 Approval14.2 Phê duyệt
RoleVai trò
NameHọ tên
DateNgày
DecisionKết luận
DHC — BA authorDHC — BA soạn
—
FlyPay — BusinessFlyPay — Nghiệp vụ
Approve / Approve with conditions / RejectDuyệt / Duyệt có điều kiện / Không duyệt
FlyPay — PM
Approve / Approve with conditions / RejectDuyệt / Duyệt có điều kiện / Không duyệt
Appendix A. Reference figuresPhụ lục A. Số liệu tham chiếu
Main endpoint:Endpoint chính:POST /api/v1/invoices · List GET /api/v1/invoices · Detail GET /api/v1/invoices/{id}. Payload details: FSD Invoice §6 / API_Invoice.. Chi tiết payload: FSD Invoice §6 / API_Invoice.
Related code & document linksMã liên quan & liên kết tài liệu
Missing code log / out of scopeNhật ký mã thiếu / ngoài scope
The codes areCác mã đượcyellow highlighthighlight vàngbecause there is no (or external) target document. Changelog version 0.3.vì chưa có (hoặc ngoài) tài liệu đích. Changelog bản 0.3.
CodeMã
CategoryLoại
MarkGhi chú
UC-INV-API-CREATE
uc_anchor_missing
Add anchor / stub on RTM or TC; highlight in yellow until FlyPay issues the official code.Bổ sung anchor / stub trên RTM hoặc TC; highlight vàng đến khi FlyPay cấp mã chính thức.
UC-INV-CREATE
uc_anchor_missing
Add anchor / stub on RTM or TC; highlight in yellow until FlyPay issues the official code.Bổ sung anchor / stub trên RTM hoặc TC; highlight vàng đến khi FlyPay cấp mã chính thức.
Generated for CPG documentation suite · CPG-SPEC-INV-API-CREATE · v0.2