Giao diện
API · campaign-public
Trang sinh tự động
Parse từ schema.graphql (SDL backend export) bằng parser graphql. Mô tả và quyền lấy nguyên văn từ description trong SDL.
12 query · 2 mutation.
Query
campaignProgress
Server progress/estimate of a published Group Buy (UA-06/07). Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
id | ID! |
Trả về CampaignProgress!
| Field | Kiểu | Mô tả |
|---|---|---|
campaignId | ID! | |
status | PublicCampaignStatus! | |
acceptingOrders | Boolean! | |
serverTime | DateTime! | |
products | [PublicCampaignProgress!]! |
mySearchHistory
The caller's last 5 search keywords, newest first. Signed-in APP_USER buyer only.
query · SDL không ghi quyền
Không có tham số.
Trả về: [String!]!
publicCampaign
One published Group Buy (UA-07); unpublished = not_found. Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
id | ID! |
Trả về PublicCampaign!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
type | CampaignType! | |
name | String! | |
status | PublicCampaignStatus! | |
acceptingOrders | Boolean! | Server decision (status OPEN); the client clock never decides (UA-06 Rule 2). |
opensAt | DateTime! | |
closesAt | DateTime! | |
serverTime | DateTime! | Database time the status was derived at. |
spinEnabled | Boolean! | Áp dụng vòng quay: false = the App shows no wheel for this campaign (B006.R10). |
spinSchedule | [PublicSpinInterval!]! | Lượt quay theo thời điểm hệ thống xác nhận cọc, [startsAt, endsAt): the rounds of the configuration in force of the wheel the campaign chose, cut at the campaign's close (BR-VQ-06; a legacy wheel: its intervals); empty when spinEnabled is false or the wheel has no configuration. |
participantCount | Int! | Số người đã tham gia, decided by the server: distinct buyers with a confirmed deposit (committed states) plus the virtual units (lượng ảo, one unit = one participant, #395), so it never shows fewer people than the virtual part of the progress (B006.R05 counts units). After a failed close only the virtual part is left; the App hides it on FAILED. |
participantsToday | Int! | Of those, buyers whose deposit was confirmed and virtual units added (DAILY step) since 00:00 Asia/Ho_Chi_Minh today. |
rewardUnit | CampaignRewardUnit | |
pointCapPct | Float | Trần thanh toán bằng Pi-Point of this campaign, % of the order (B064.R07). |
payNowBonus | Int | Thưởng thanh toán online, in rewardUnit (B064.R08). |
terms | PublicCampaignTerms | Điều khoản tham gia Deal the buyer accepts before the deposit (B058.R10). |
refundEtaText | String | Thời gian hoàn cọc shown on the App (B006.R08, e.g. "1–3 ngày làm việc"): Cấu hình hệ thống refund.eta_text, never set per campaign; null when the parameter is missing. |
featured | PublicFeaturedProduct | Featured slot of the App home: product 1 and its tag (B006.R17). |
policy | PublicCampaignPolicy | |
products | [PublicCampaignProduct!]! | |
milestones | [PublicCampaignMilestone!]! | |
currentTier | CampaignPriceTier | Authoritative current tier of the lead (position 1) product (UA-UI-07 HC03, GAP-1876): the tier of Tổng + 1 units, computed on the server, never by the client. Null while that progress is not READY. A basket with several products reads each one's products[].progress.currentTier. |
deliverySchedule | [PublicDeliveryCycle!]! | The delivery periods in order (cycleNo ascending); empty when none is published. |
maxPointsPerSpin | PointAmount | Mức tối đa mỗi lượt of the wheel the campaign chose (the largest slot of its configuration in force, R5); null when spinEnabled is false or the wheel has no configuration. |
depositWindowMinutes | Int! | Thời hạn thanh toán cọc in minutes (Cấu hình hệ thống, the value the server uses for Order.depositDueAt). The App shows it, never a hard-coded 24 h. |
spinWheel | SpinWheelDisplay | VQM S14: the wheel the App previews next to spinSchedule (tone, 8 slots, Thể lệ, Mức tối đa); null when spinEnabled is false or no wheel is chosen. Never the wheel name (BR-VQ-02). |
spinPrizePoints | [PointAmount!]! | Points of each slot of the wheel the campaign chose (its configuration in force), in slot order (the slices of the wheel); empty when spinEnabled is false or the wheel has no configuration. Never a probability. |
publicCampaignHome
App home, Mua chung: one Đang mở + one Sắp mở (null when none). Requires deal.read_public.
query · quyền: deal.read_public
Không có tham số.
Trả về PublicCampaignHome!
| Field | Kiểu | Mô tả |
|---|---|---|
open | PublicCampaign | |
upcoming | PublicCampaign |
publicCampaigns
Published Group Buy campaigns (UA-04..06): only Đang mở (OPEN) and Sắp mở (UPCOMING) are listed (CD-US-19 AC06/AC10); a status filter asking for a closed state answers an empty page, and a closed campaign stays readable by id. keyword = campaign name, product SKU/name or brand; windowFrom/windowTo = VN calendar days (YYYY-MM-DD, Asia/Ho_Chi_Minh) the registration window overlaps. Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
status | [PublicCampaignStatus!] | ||
windowFrom | String | ||
windowTo | String | ||
categoryId | ID | G1S (BR-KP-05): a category and its sub-categories; only campaigns with a Deal in it, and products holds only those Deals. | |
page | Int | 1 | |
pageSize | Int | 20 |
Trả về PublicCampaignPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [PublicCampaign!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | |
sourceStatus | SourceStatus! |
publicCategories
Level-1 categories with at least one Deal shown on the App (Đang mở or Sắp mở). With campaignId (G2S S8, BR-KPD-02): level-1 categories with at least one product in that campaign (Mua định kỳ basket chips; [] when the campaign is not shown on the App). Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
campaignId | ID |
Trả về [PublicCategory!]!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
name | String! | |
imageUrl | String | Ảnh đại diện of the category (public URL); null without one (the App shows its default icon). |
position | Int! | Server order of the chip row, 1..n; the list is already sorted by it. |
publicHomeStats
App home community figures (system_settings home.* / banner.*). Requires deal.read_public.
query · quyền: deal.read_public
Không có tham số.
Trả về PublicHomeStats!
| Field | Kiểu | Mô tả |
|---|---|---|
communityThisWeek | Int! | Hero core: người cùng mua tuần này. |
groupBuy | PublicHomeGroupBuyStats! | |
recurring | PublicHomeRecurringStats! | |
heroRecentJoined | Int! | Hero: +{n} người vừa tham gia. |
heroTodayNearby | Int! | Hero: {n} người mới tham gia hôm nay quanh bạn. |
heroInitials | [String!]! | Hero: initials of the avatar row, in display order. |
groupBuyBanner | PublicGroupBuyBanner! | Banner of the Deal list (G1-02). |
publicRecurringCampaign
One published Recurring basket; unpublished, unknown or Group Buy = not_found. Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
id | ID! |
Trả về PublicRecurringCampaign!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
name | String! | |
status | PublicCampaignStatus! | |
acceptingOrders | Boolean! | Server decision (status OPEN); the client clock never decides. |
opensAt | DateTime! | |
closesAt | DateTime! | |
serverTime | DateTime! | Database time the status was derived at. |
spinEnabled | Boolean! | Áp dụng vòng quay (B223.R08). |
spinSchedule | [PublicSpinInterval!]! | Lượt quay theo thời điểm hệ thống xác nhận cọc, [startsAt, endsAt): the rounds of the configuration in force of the wheel the campaign chose, cut at the campaign's close (BR-VQ-06; a legacy wheel: its intervals); empty when spinEnabled is false or the wheel has no configuration. |
participantCount | Int! | Số người đã tham gia, decided by the server: distinct buyers with a confirmed deposit (committed states) plus the virtual units (lượng ảo, one unit = one participant, #395), so it never shows fewer people than the virtual part of the progress (B006.R05 counts units). After a failed close only the virtual part is left; the App hides it on FAILED. |
participantsToday | Int! | +{n} hôm nay. G2S (BR-APP-17, DEC-OWN28-G2S-TODAY-FIXED): the Admin-set value of system_settings recurring.participants_today (placeholder, tech debt G2S-TD-01, GAP-G2S-12), never computed from orders. |
rewardUnit | CampaignRewardUnit | |
pointCapPct | Float | Trần thanh toán bằng Pi-Point, % of the order. |
prepayAllBonus | Int | Thưởng khi trả trước toàn bộ các kỳ, in rewardUnit (B223.R04). |
minOrderValueVnd | VndAmount | Giá trị đơn tối thiểu per period (B223.R05). |
startMonth | String | Kỳ bắt đầu giao, YYYY-MM. |
terms | PublicCampaignTerms | |
refundEtaText | String | Thời gian hoàn cọc (B006.R08): Cấu hình hệ thống refund.eta_text; null when missing. |
featured | PublicFeaturedProduct | Featured slot of the App home: product 1 and its tag. |
maxPointsPerSpin | PointAmount | G2S S7 (G2-04 Vòng quay đăng ký sớm): Mức tối đa mỗi lượt of the wheel the campaign chose (the largest slot of its configuration in force); null when spinEnabled is false or the wheel has no configuration. Same as PublicCampaign.maxPointsPerSpin. |
pointRateVnd | Float | VND của 1 Pi-Point theo cấu hình đang hiệu lực (BR-APP-07); null = chưa có tỷ giá; App dùng cho ví dụ U-20 |
depositWindowMinutes | Int! | G2S S7: Thời hạn thanh toán cọc in minutes (Cấu hình hệ thống, the value the server uses for Order.depositDueAt). Same as PublicCampaign.depositWindowMinutes. |
packages | [PublicRecurringPackage!]! | |
windows | [PublicDeliveryWindow!]! | |
policy | PublicRecurringPolicy | |
products | [PublicCampaignProduct!]! | Products of the basket; progress counts quantity x cycles of committed orders. |
deliverySchedule | [PublicDeliveryCycle!]! | The delivery cycles in order (cycleNo ascending); empty when none is published. |
spinWheel | SpinWheelDisplay | VQM S14: as PublicCampaign.spinWheel (G2-04). |
publicRecurringCampaigns
Published Recurring baskets (GAP-192): only OPEN and UPCOMING are listed (CD-US-19 AC06/AC10; a closed basket stays readable by id). search = basket name, product SKU/name or brand; status = the list chips. Order is the server's (OPEN by deadline, then UPCOMING by opening). Requires deal.read_public; User App only.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
status | [PublicCampaignStatus!] | ||
page | Int | 1 | |
pageSize | Int | 20 |
Trả về PublicRecurringCampaignPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [PublicRecurringCampaign!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | |
sourceStatus | SourceStatus! |
publicRecurringHome
App home, Mua định kỳ: one Đang mở + one Sắp mở (null when none). Requires deal.read_public; User App only.
query · quyền: deal.read_public
Không có tham số.
Trả về PublicRecurringHome!
| Field | Kiểu | Mô tả |
|---|---|---|
open | PublicRecurringCampaign | |
upcoming | PublicRecurringCampaign |
publicSearch
Products matching the keyword (product name, brand, campaign / basket name; case ignored, Vietnamese diacritics kept, PAF-P1-16), Đang mở first (closing first) then Sắp mở bán (opening first). categoryIds: a level-1 id includes its sub-categories, several ids are a union. An empty keyword is validation_failed. Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
keyword | String! | ||
kind | PublicSearchKind | ALL | |
categoryIds | [ID!] | ||
page | Int | 1 | |
pageSize | Int | 20 |
Trả về PublicSearchPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [PublicSearchItem!]! | |
total | Int! | |
page | Int! | |
pageSize | Int! | |
hasMore | Boolean! | |
serverTime | DateTime! | PAF-P3-12 (R-22): the server's clock at this read (DB now()), so the App's countdowns run on server time. |
publicSearchFacets
Counts for the U-16 filter (same result set as publicSearch). Requires deal.read_public.
query · quyền: deal.read_public
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
keyword | String! | ||
kind | PublicSearchKind | ALL | |
categoryIds | [ID!] |
Trả về PublicSearchFacets!
| Field | Kiểu | Mô tả |
|---|---|---|
total | Int! | Results for the keyword, kind and categories: the n of Áp dụng ({n} kết quả). |
kindCounts | PublicSearchKindCounts! | |
categories | [PublicSearchCategoryCount!]! |
Mutation
clearSearchHistory
Deletes the caller's search history. Signed-in APP_USER buyer only.
mutation · SDL không ghi quyền
Không có tham số.
Trả về: Boolean!
recordSearchKeyword
Puts the keyword first (duplicates ignoring case and spaces removed), keeps 5; returns the new history. Signed-in APP_USER buyer only.
mutation · SDL không ghi quyền
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | RecordSearchKeywordInput! |
Trả về: [String!]!