Skip to main content

Gift — API

Author: Josh S. Sakweli, Backend Lead Team
Last Updated: 2026-11-28
Version: v1.2 (moment gifts in meetings and calls: places MEETING and CALL; an item's places optional, empty = every place; v1.1: Part 13 moment gifts, spec v6)

Base URL: http://localhost:8765/api/v1 (local) · https://dev.api.nexgate.co/api/v1 (staging)

Short Description: Everything the NexGate app (Android, iOS, web) and the admin panel need for gifts. A person buys a gift from their wallet: for someone (a private gift, by account or phone number), as codes (anyone who types the code gets it) or for themselves (loads their own gift balance). The receiver claims it into their gift balance, which pays first at every checkout. Design and rules: GIFT_SYSTEM_SPEC.md.

Hints:

  • Every call uses the person's normal login: Authorization: Bearer <access token>.
  • The feature has a switch. While gifts are off, every endpoint here answers 404, payments take no gift part and the extra fields on existing responses are missing. Hide the Gift entries when GET /gifts/designs answers 404.
  • A person is always an accountId. Find people with the existing user search, then send their accountId.
  • Amounts are TZS, whole shillings (20000, not 20000.50). Dates are server local time, ISO 8601 without zone (2026-11-21T10:30:45).
  • Rules are checked by the server when the checkout opens and again when it is paid. The app may grey things out from GET /gifts/designs, but the server's answer wins.
  • Refusals are HTTP 409 with data.code (branch on it) and data.reason (written for people: show it as it is). The full list is in Part 11.

Contents

  • Part 1 — How it works (flows, diagrams, money)
  • Part 2 — Designs (1)
  • Part 3 — Buying a gift (2–5)
  • Part 4 — My gifts: lists and one gift (6–9)
  • Part 5 — Opening, declining, cancelling, redeeming (10–14)
  • Part 6 — Gift balance (15–16)
  • Part 7 — Changes to existing endpoints (checkout, payment, refunds)
  • Part 8 — The gift card in a chat
  • Part 9 — Notifications
  • Part 10 — Admin (17–29)
  • Part 10a — Who can send me gifts (30–32)
  • Part 11 — Refusal codes
  • Part 12 — Screens checklist
  • Part 13 — Moment gifts (33–41), new in v1.1

Part 1 — How it works

1.1 Three kinds of gift

Kind Who gets it How it is opened Starts as
PRIVATE one person, chosen by account or phone number the receiver taps Claim (or Decline) SENT
PUBLIC whoever types the code first (one code = one person) anyone: Redeem a code ACTIVE
SELF the buyer nothing to do: straight into their gift balance CLAIMED

A gift is a card until it is opened, money after. While it waits, the money sits in NexGate's gift account, not with the buyer and not with the receiver. Opened, it becomes gift balance: it pays for things on NexGate, it can't be withdrawn or sent on.

1.2 Buying a gift for someone (Asha → Juma)

 ASHA (NexGate app)                              SERVER                                  JUMA (NexGate app)
 ──────────────────                              ──────                                  ──────────────────
 Gift ─► GET /gifts/designs ───────────────────► designs, amounts, today's limits
 picks "Birthday", TZS 20,000, Juma, message
 POST /gifts/checkout-sessions ────────────────► checks every rule, holds nothing yet
   { kind: PRIVATE, designId, amount: 20000,      session PENDING_PAYMENT (15 minutes)
     recipientId: Juma, message }
 shows: total, wallet balance, "Pay"
 POST /gifts/checkout-sessions/{id}/process-payment
                                               ► checks every rule again
                                                 one ledger entry: Asha's wallet → gift account
                                                 card SENT, expires in 14 days
 "Your gift to Juma is on its way" ◄──────────── session COMPLETED + cards[ ]
 bell GIFT_PURCHASED (+ email receipt)           bell + push GIFT_RECEIVED ────────────► "🎁 Asha sent you a gift
                                                                                          TZS 20,000 · claim by 5 Dec"
                                                 ◄────────────────────────────────────── POST /gifts/{id}/claim
                                                 gift account → Juma's gift balance
 bell + push GIFT_CLAIMED ◄───────────────────── card CLAIMED                            gift balance TZS 20,000
 "🎉 Juma claimed your gift"
  • Sent from a one-to-one chat with Juma (conversationId): the gift also appears in that chat as a card (Part 8).
  • Juma may Decline instead: the money goes straight back to Asha's wallet and she gets GIFT_REJECTED.

1.3 A gift to someone not on NexGate yet (by phone number)

 ASHA                                   SERVER                                   0754 123 456 (not on NexGate)
 ────                                   ──────                                   ─────────────────────────────
 POST /gifts/checkout-sessions
   { kind: PRIVATE, recipientPhone:
     "0754123456", amount: 20000 } ───► number has no account → card keeps the number
 pays ────────────────────────────────► card SENT, recipient = null
                                        SMS GIFT_INVITE_SMS ───────────────────► "Asha sent you a TZS 20,000 gift
                                                                                   on NexGate. Get the app and sign up
                                                                                   with this number to claim it."
                                                                                 installs, signs up with THAT number
                                        ◄─────────────────────────────────────── opens Gifts (GET /gifts/received)
                                        card linked to the new account
                                        (only the account with that exact number)
                                                                                 Claim → gift balance
  • If the number already belongs to someone on NexGate, it goes to that person (1.2), but Asha is never told whose number it is: the checkout, her Sent list and her notices show only +255•••••3456 until the person claims (then "Juma claimed your gift"). Declined or returned: the name is never shown. Numbers can't be used to look people up.
  • Asha sees the number masked: +255•••••3456.
  • One day before it would come back, the number gets a reminder SMS.

1.4 Gift codes (PUBLIC)

 ASHA buys 3 codes of TZS 10,000
 POST /gifts/checkout-sessions { kind: PUBLIC, amount: 10000, quantity: 3 }
 POST …/process-payment ─► cards[ {code: "NXG-7K4Q-M2PX-9DFT"}, {code: …}, {code: …} ]   ◄─ the ONLY list with full codes
                            shows Copy / Share for each

 later: My codes ─► GET /gifts/codes ─► "…9DFT  ACTIVE"   (codeLast4 only)
        tap Show ─► GET /gifts/{id}/code ─► full code again (only while ACTIVE)

 ANYONE (even Asha herself) ─► POST /gifts/redeem { code: "nxg 7k4q m2px 9dft" } ─► gift balance + TZS 10,000
 ASHA: bell + push GIFT_CODE_REDEEMED "Your gift code …9DFT was redeemed"  (never says who)
  • A code is NXG- + 12 letters/digits. People may type it in any case, with or without NXG, spaces or dashes.
  • The letters 0 O 1 I L U are never used, so a code survives being read aloud.
  • 5 wrong codes → that person is paused for 60 minutes (CODE_TRIES_PAUSED).

1.5 Buying for yourself (SELF)

 POST /gifts/checkout-sessions { kind: SELF, amount: 50000 } ─► POST …/process-payment
 wallet − 50,000 ─► gift balance + 50,000      card CLAIMED at once      bell GIFT_BALANCE_LOADED

Useful to set money aside for shopping. It can't be cancelled or moved back to the wallet.

1.6 The life of one gift card

                              PRIVATE                                             PUBLIC (code)
                         ┌────────────────┐                                  ┌────────────────┐
           paid ───────► │      SENT      │                       paid ────► │     ACTIVE     │
                         └───────┬────────┘                                  └───────┬────────┘
     ┌──────────────┬────────────┼──────────────┬───────────┐          ┌─────────────┼──────────────┬───────────┐
     ▼              ▼            ▼              ▼           ▼          ▼             ▼              ▼           ▼
 ┌────────┐   ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌────────┐  ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌────────┐
 │CLAIMED │   │ REJECTED │ │ CANCELLED │ │ RETURNED │ │ FROZEN │  │ REDEEMED │ │ CANCELLED │ │ RETURNED │ │ FROZEN │
 └────────┘   └──────────┘ └───────────┘ └──────────┘ └───┬────┘  └──────────┘ └───────────┘ └──────────┘ └───┬────┘
 receiver     receiver     buyer, within  14 days, not    │ support    anyone      buyer, within  14 days,     │
 claims       declines     24 h           opened          │            types it    24 h           not used     │
                                                          ▼                                                    ▼
                                           support: unfreeze (back to SENT / ACTIVE) or return to the buyer (RETURNED)

 SELF: created CLAIMED, nothing else happens to it.
 Money:  CLAIMED / REDEEMED → receiver's gift balance.  REJECTED / CANCELLED / RETURNED → buyer's WALLET (never gift).

SENT and ACTIVE are "waiting". Everything else is final, except FROZEN, which only support can end.

1.7 The 14 days of a waiting gift

 day 0 ── bought ───────────────────────────────────────────────────────────────────────────────► day 14
 │◄── 24 h: buyer can Cancel ──►│
                                                  day 11            day 12              day 13       day 14
                                                  receiver:         buyer:              receiver:    not opened →
                                                  GIFT_CLAIM_       GIFT_RETURNING_     GIFT_CLAIM_  back to buyer's wallet
                                                  REMINDER          SOON (bell only)    REMINDER     GIFT_RETURNED
                                                  (3 days left)                         (1 day left;
                                                                                         SMS if not on NexGate)

The reminders and the return run every hour, so they arrive within the hour of these times. A frozen gift is skipped: it never comes back on its own (support decides, Part 10).

1.8 Where the money goes

                       ┌──────────────────────────────── refunds of a shop order: fair share ───────────────────────┐
                       │                                                                                            │
 ┌───────────┐  buy   ┌┴───────────────────┐ claim / redeem ┌─────────────────┐  pay an order   ┌──────────────────┐ │
 │ Asha's    │ ─────► │ NexGate gift       │ ─────────────► │ Juma's gift     │ ──────────────► │ order escrow     │─┘
 │ WALLET    │        │ account (waiting)  │                │ balance         │  (pays first)   │ (as for any      │
 │           │ ◄───── │                    │                └─────────────────┘                 │  payment)        │
 └─────┬─────┘ decline│                    │                                                    └──────────────────┘
       │     cancel   └────────────────────┘                                                     ▲
       │     14 days                                                                             │ the rest
       │ SELF: straight into Asha's own gift balance                                             │
       └───────────────────────────────────────────── Juma's WALLET ─────────────────────────────┘
  • Every move is one double-entry ledger entry, so nothing can be in two places or lost.
  • Admin's report checks every day that the gift account holds exactly the waiting cards (29).

1.9 Paying a shop order with gift balance

Juma has TZS 20,000 gift balance and TZS 50,000 in his wallet. He buys shoes for TZS 35,000.

 POST /e-commerce/checkout-sessions { …, useGiftBalance: true (or left out) }
 GET  /wallet/checkout-balance-check → giftBalance 20000, giftPart 20000, walletBalance 50000, shortfall 0
 POST /e-commerce/checkout-sessions/{id}/process-payment
      → amountPaid 35000, giftPaid 20000, walletPaid 15000
 after: gift balance 0, wallet 35,000
Juma's choice Gift pays Wallet pays
useGiftBalance left out or true 20,000 15,000
useGiftBalance: false 0 35,000
Instalment checkout (any value) 0 all of it (instalments never use gift)

Refund: the order is cancelled. Juma gets back TZS 20,000 to his gift balance and TZS 15,000 to his wallet, the same mix he paid with. A part refund is split in the same proportion (fair share). The ESCROW_REFUNDED notice says it: "TZS 35,000 refunded · From order ORD-… · TZS 20,000 to your gift balance · TZS 15,000 to your wallet".

Gift balance pays at: buy now, cart, group buys, chat offers, event tickets. It does not pay for: instalments, another gift, wallet top-ups, withdrawals, transfers.


Standard Response Format

Success Response Structure

{
  "success": true,
  "httpStatus": "OK",
  "message": "Gift claimed",
  "action_time": "2026-11-21T10:30:45",
  "data": { }
}

Coded refusal (HTTP 409)

{
  "success": false,
  "httpStatus": "CONFLICT",
  "message": "Smallest gift is 1000 TZS",
  "action_time": "2026-11-21T10:30:45",
  "data": { "code": "GIFT_TOO_SMALL", "reason": "Smallest gift is 1000 TZS" }
}

Standard Response Fields

Field Type Description
success boolean true for success, false for errors
httpStatus string HTTP status name (OK, CONFLICT, NOT_FOUND, …)
message string What happened, for people
action_time string When the response was made
data object The answer; for a refusal { code, reason }

Other errors

Status When
401 UNAUTHORIZED missing or expired token
403 FORBIDDEN admin endpoint without the right admin role
404 NOT_FOUND gifts are switched off; or the gift / session doesn't exist or isn't yours (the same answer, on purpose)
409 CONFLICT a coded refusal (Part 11)
422 UNPROCESSABLE_ENTITY a field fails validation (data names the fields)

HTTP Method Badges

GET read · POST create / act · PUT replace · PATCH change a part


Shared objects

These appear in many answers. Each endpoint below refers to them.

GiftCard

{
  "id": "9f1c2d3e-4b5a-6789-8abc-def012345678",
  "kind": "PRIVATE",
  "status": "SENT",
  "amount": 20000,
  "message": "Happy birthday Juma!",
  "designId": "3a7b…",
  "designName": "Birthday",
  "designImage": {
    "fileId": "8c2e…", "status": "READY", "mimeType": "image/webp",
    "variants": { "thumb": "https://files.nexgate.co/…/thumb.webp", "medium": "https://files.nexgate.co/…/medium.webp" }
  },
  "from": { "accountId": "304e…", "name": "Asha Mushi",
            "userProfileMedia": { "fileId": "1d2e…", "status": "COMPLETED", "thumbUrl": "https://…/thumb.jpg", "mimeType": "image/jpeg" } },
  "to":   { "accountId": "3213…", "name": "Juma Ally", "userProfileMedia": null },
  "recipientPhone": null,
  "code": null,
  "codeLast4": null,
  "createdAt": "2026-11-21T10:30:45",
  "expiresAt": "2026-12-05T10:30:45",
  "openedAt": null,
  "closedAt": null,
  "cancelUntil": "2026-11-22T10:30:45"
}
Field Description
id The gift. Notifications and the chat card open it with GET /gifts/{id}
kind PRIVATE, PUBLIC (code), SELF
status SENT, ACTIVE, CLAIMED, REDEEMED, REJECTED, CANCELLED, RETURNED, FROZEN (see 1.6)
amount TZS, one card
message The buyer's words, or null
designId, designName, designImage The design as it was when bought (a later edit of the design doesn't change sent cards). The picture has no words or amount on it: the app draws amount, message and names on top
from The buyer (accountId, name, userProfileMedia)
to The receiver. Always null for a code (the buyer never learns who redeemed it). For a gift sent to a typed number, null until it is CLAIMED (show recipientPhone instead)
recipientPhone Masked number (+255•••••3456) for a gift sent to a phone number; otherwise null
code The full code. Only in the payment answer (endpoint 4) and GET /gifts/{id}/code (10). Everywhere else null
codeLast4 Last 4 characters of a code (9DFT) to tell codes apart; null for other kinds
createdAt When it was bought
expiresAt When it goes back to the buyer if still waiting (bought + 14 days)
openedAt When it was claimed / redeemed
closedAt When it stopped waiting (any final status)
cancelUntil Present only while the buyer can still cancel (waiting and within 24 h). Show Cancel only when it's there

GiftPerson

Field Description
accountId The person
name Display name, or first + last name
userProfileMedia Profile photo (fileId, status, thumbUrl, mimeType) or null

Part 2 — Designs

1. Designs to choose from

Purpose: The gift designs a person can buy now, the amounts each one allows per kind, and how much they can still buy today.

Endpoint: GET {base_url}/gifts/designs

Access Level: 🔒 Protected (any signed-in person)

Authentication: Bearer token

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift designs", "action_time": "2026-11-21T10:30:45",
  "data": {
    "designs": [
      { "id": "3a7b…", "name": "Birthday", "occasion": "Birthday",
        "image": { "fileId": "8c2e…", "status": "READY", "mimeType": "image/webp", "variants": { "thumb": "https://…/thumb.webp" } },
        "presetAmounts": [5000, 10000, 20000],
        "kinds": [ { "kind": "PRIVATE", "minAmount": 1000, "maxAmount": 100000 },
                   { "kind": "PUBLIC",  "minAmount": 1000, "maxAmount": 100000 } ] },
      { "id": "0b11…", "name": "NexGate", "occasion": "General", "image": null,
        "presetAmounts": [5000, 10000, 20000, 50000],
        "kinds": [ { "kind": "PRIVATE", "minAmount": 1000, "maxAmount": 500000 },
                   { "kind": "PUBLIC",  "minAmount": 1000, "maxAmount": 200000 },
                   { "kind": "SELF",    "minAmount": 1000, "maxAmount": 1000000 } ] }
    ],
    "maxCardsPerPurchase": 20,
    "leftToday": 1000000,
    "leftTodayForCodes": 500000
  }
}

Success Response Fields:

Field Description
designs[] Designs showing now, in the admin's order. The NexGate card is always there (last)
designs[].image The picture (no words on it), or null for the NexGate card until one is uploaded: draw the NexGate brand card
designs[].presetAmounts Quick-pick amounts (up to 6). The person may still type any amount in the range
designs[].kinds[] The kinds this design can be bought as, with the real range: the design's range made stricter by the platform limits. A kind not listed can't be bought with this design: hide that option
maxCardsPerPurchase Most codes in one purchase
leftToday TZS this person can still spend on gifts today (all kinds)
leftTodayForCodes TZS left today for codes (codes have a smaller limit inside the daily one)

Grey out amounts above leftToday (or leftTodayForCodes for codes) and say "Daily gift limit".


Part 3 — Buying a gift

Buying is a gift checkout, separate from shop checkouts: open → (look) → pay. A session lives 15 minutes. Nothing is taken from the wallet until process-payment.

2. Open a gift checkout

Purpose: Check the gift against every rule and get a session to pay.

Endpoint: POST {base_url}/gifts/checkout-sessions

Access Level: 🔒 Protected (any signed-in person)

Authentication: Bearer token

Request JSON Sample (private, to a person, from a chat):

{
  "kind": "PRIVATE",
  "designId": "3a7b…",
  "amount": 20000,
  "recipientId": "3213…",
  "message": "Happy birthday Juma!",
  "conversationId": "c9d0…"
}

Other kinds:

{ "kind": "PRIVATE", "amount": 20000, "recipientPhone": "0754 123 456" }
{ "kind": "PUBLIC",  "designId": "3a7b…", "amount": 10000, "quantity": 3, "message": "Asante!" }
{ "kind": "SELF",    "amount": 50000 }

Request Body Parameters:

Parameter Type Required Description Validation
kind string Yes PRIVATE, PUBLIC or SELF enum
designId UUID No A design from endpoint 1. Left out = the NexGate card must be showing now and allow this kind
amount number Yes TZS for one card whole shillings; inside the design's range for this kind; > 0
quantity integer No How many codes (PUBLIC only). Default 1 1 to maxCardsPerPurchase; must be 1 (or left out) for PRIVATE and SELF
recipientId UUID PRIVATE: one of the two The receiver, from the user search not yourself; nobody blocked
recipientPhone string PRIVATE: one of the two Any Tanzanian format: 0754…, 255754…, +255754…, spaces allowed must be a valid number; not your own
message string No The buyer's words on the card max 280 characters; blank = none; no links (www., https://, wa.me/…, bit.ly/…, name.com …)
conversationId UUID No Send from a one-to-one chat: the gift also appears in that chat PRIVATE only (ignored otherwise); must be a personal chat between you and the receiver
  • Send recipientId or recipientPhone for PRIVATE, never both. Send neither for PUBLIC and SELF.
  • A phone number that belongs to a NexGate account becomes a gift to that account (the app is not told).

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift checkout opened", "action_time": "2026-11-21T10:30:45",
  "data": {
    "sessionId": "5e6f…",
    "status": "PENDING_PAYMENT",
    "kind": "PRIVATE",
    "designId": "3a7b…",
    "amount": 20000,
    "quantity": 1,
    "total": 20000,
    "recipient": { "accountId": "3213…", "name": "Juma Ally", "userProfileMedia": null },
    "recipientPhone": null,
    "message": "Happy birthday Juma!",
    "walletBalance": 75000,
    "expiresAt": "2026-11-21T10:45:45",
    "cards": []
  }
}

Success Response Fields:

Field Description
sessionId Use it to pay (4), look (3) or leave (5)
status PENDING_PAYMENT, COMPLETED, CANCELLED, EXPIRED
designId The design used (the NexGate card's id when none was sent)
amount, quantity, total total = amount × quantity: what will leave the wallet
recipient The receiver when picked by recipientId. null when a number was typed, even if it is on NexGate
recipientPhone Masked number for a gift to someone not on NexGate, else null
walletBalance The buyer's wallet now. Gifts are paid from wallet only, never from gift balance. If walletBalance < total, offer a top-up first
expiresAt Pay before this (15 minutes)
cards Empty until paid

Errors (409 data.code): GIFT_RECIPIENT, GIFT_PHONE, GIFT_SELF, GIFT_CHAT, DESIGN_UNAVAILABLE, DESIGN_KIND, GIFT_AMOUNT, GIFT_TOO_SMALL, GIFT_TOO_BIG, GIFT_QUANTITY, GIFT_DAILY_LIMIT, GIFT_DAILY_CODE_LIMIT, GIFT_NOT_ACCEPTED, GIFT_MESSAGE_LINK, GIFTS_ON_HOLD. 404 "Person not found" for an unknown recipientId.


3. Look at a gift checkout

Purpose: The session again (for example after the app was closed). Once paid it carries the cards, without full codes.

Endpoint: GET {base_url}/gifts/checkout-sessions/{sessionId}

Access Level: 🔒 Protected (the buyer only; anyone else gets 404)

Authentication: Bearer token

Path Parameters:

Parameter Type Required Description Validation
sessionId UUID Yes From endpoint 2 must be yours

Success Response: the same object as endpoint 2 (cards filled when COMPLETED, each with code: null).


4. Pay

Purpose: Take the money from the buyer's wallet and create the cards, both in one step: either both happen or neither.

Endpoint: POST {base_url}/gifts/checkout-sessions/{sessionId}/process-payment

Access Level: 🔒 Protected (the buyer only)

Authentication: Bearer token

Path Parameters:

Parameter Type Required Description Validation
sessionId UUID Yes From endpoint 2 must be yours, PENDING_PAYMENT, not expired

No body. Every rule from endpoint 2 is checked again (a design may have been switched off, today's total may have changed in another tab).

Success Response JSON Sample (3 codes):

{
  "success": true, "httpStatus": "OK", "message": "Gift paid", "action_time": "2026-11-21T10:31:20",
  "data": {
    "sessionId": "5e6f…", "status": "COMPLETED", "kind": "PUBLIC", "designId": "3a7b…",
    "amount": 10000, "quantity": 3, "total": 30000,
    "recipient": null, "recipientPhone": null, "message": "Asante!",
    "walletBalance": 45000, "expiresAt": "2026-11-21T10:45:45",
    "cards": [
      { "id": "a1…", "kind": "PUBLIC", "status": "ACTIVE", "amount": 10000, "code": "NXG-7K4Q-M2PX-9DFT", "codeLast4": "9DFT",
        "from": { "accountId": "304e…", "name": "Asha Mushi", "userProfileMedia": null }, "to": null,
        "expiresAt": "2026-12-05T10:31:20", "cancelUntil": "2026-11-22T10:31:20", "…": "rest of GiftCard" },
      { "id": "a2…", "kind": "PUBLIC", "status": "ACTIVE", "amount": 10000, "code": "NXG-HR3W-8BNZ-T6QA", "codeLast4": "T6QA", "…": "…" },
      { "id": "a3…", "kind": "PUBLIC", "status": "ACTIVE", "amount": 10000, "code": "NXG-K9PD-2XVE-C4MS", "codeLast4": "C4MS", "…": "…" }
    ]
  }
}

Success Response Fields: the session (endpoint 2) with status: COMPLETED and cards[] (GiftCard).

Kind cards
PRIVATE one card, SENT; the receiver is told (or gets the SMS)
PUBLIC quantity cards, ACTIVE, each with its full code. This is the only list that ever carries full codes: show them with Copy and Share
SELF one card, CLAIMED; the gift balance already has the money
  • Paying twice is safe: a second call on a COMPLETED session returns the same cards and takes no money (still- ACTIVE codes come with their full code again).
  • Network lost after tapping Pay? Call it again with the same sessionId.

Errors (409): CHECKOUT_CLOSED (left or already ended), CHECKOUT_EXPIRED (over 15 minutes: start again), INSUFFICIENT_BALANCE (reason says how much to top up: "Top up 5000 TZS to continue"), and every code from endpoint 2.


5. Leave a gift checkout

Purpose: The buyer backs out before paying.

Endpoint: POST {base_url}/gifts/checkout-sessions/{sessionId}/cancel

Access Level: 🔒 Protected (the buyer only)

Authentication: Bearer token

No body. A PENDING_PAYMENT session becomes CANCELLED; any other session is returned unchanged (calling it twice is safe). Nothing was taken, so nothing is given back. To cancel a gift after paying, use endpoint 13.

Success Response: the session (endpoint 2) with status: CANCELLED.


Part 4 — My gifts

The Gift menu has three lists: Received, Sent and My codes. Each comes with counts for the tabs / chips.

6. Gifts I received

Purpose: Private gifts sent to me, newest first. Also links any gifts sent to my phone number before I joined.

Endpoint: GET {base_url}/gifts/received

Access Level: 🔒 Protected

Authentication: Bearer token

Query Parameters:

Parameter Type Required Description Validation Default
page integer No Page, from 0 ≥ 0 0
size integer No Cards per page 1–50 20

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gifts received", "action_time": "2026-11-21T10:30:45",
  "data": {
    "cards": [ { "id": "9f1c…", "kind": "PRIVATE", "status": "SENT", "amount": 20000, "…": "GiftCard" } ],
    "counts": { "waiting": 1, "opened": 4, "returned": 0, "rejected": 1, "cancelled": 0, "onHold": 0 },
    "page": 0, "size": 20, "hasNext": false
  }
}

Success Response Fields:

Field Description
cards[] GiftCards
counts.waiting SENT + ACTIVE: still to be opened
counts.opened CLAIMED + REDEEMED
counts.returned RETURNED (not opened in 14 days)
counts.rejected REJECTED
counts.cancelled CANCELLED by the buyer
counts.onHold FROZEN by support
page, size, hasNext Paging: ask for page + 1 while hasNext

Show Claim / Decline on cards with status: SENT.


7. Gifts I sent

Purpose: Private gifts I bought for other people, newest first.

Endpoint: GET {base_url}/gifts/sent

Access Level: 🔒 Protected

Authentication: Bearer token

Query Parameters: page, size as in endpoint 6.

Success Response: the same shape as endpoint 6. counts are over my sent gifts. Show Cancel while cancelUntil is present.


8. My codes

Purpose: Gift codes I bought, newest first. Codes show codeLast4 only.

Endpoint: GET {base_url}/gifts/codes

Access Level: 🔒 Protected

Authentication: Bearer token

Query Parameters: page, size as in endpoint 6.

Success Response: the same shape as endpoint 6. On each card to is null. A REDEEMED code shows "Redeemed on {closedAt}" (never by whom). An ACTIVE code shows Show code (endpoint 10) and Cancel while cancelUntil is present.


9. One gift

Purpose: One gift, for its buyer or its receiver. Notifications and the chat card open this.

Endpoint: GET {base_url}/gifts/{giftId}

Access Level: 🔒 Protected (the buyer or the receiver; anyone else gets 404)

Authentication: Bearer token

Path Parameters:

Parameter Type Required Description Validation
giftId UUID Yes The gift

Success Response: one GiftCard (code always null here).

What to show:

I am Status Buttons
receiver SENT Claim · Decline
buyer waiting, cancelUntil present Cancel
buyer of a code ACTIVE Show code · Share
anyone FROZEN "On hold by NexGate support"
anyone final the status and closedAt

Part 5 — Opening, declining, cancelling, redeeming

All of these are safe to call twice: repeating a claim that already happened returns the card as it is, without moving money again.

10. Show a code again

Purpose: The buyer sees the full code of an unused code (to share it again).

Endpoint: GET {base_url}/gifts/{giftId}/code

Access Level: 🔒 Protected (the code's buyer only)

Authentication: Bearer token

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift code", "action_time": "2026-11-21T10:30:45",
  "data": { "giftId": "a1…", "code": "NXG-7K4Q-M2PX-9DFT" }
}

Put it behind a tap (and the phone's PIN / fingerprint if the app has it): a code is money for whoever reads it.

Errors: 404 (not a code, or not yours); 409 CODE_CLOSED (no longer ACTIVE: once used, cancelled or returned the code is deleted and can never be shown again).


11. Claim

Purpose: The receiver takes a private gift into their gift balance.

Endpoint: POST {base_url}/gifts/{giftId}/claim

Access Level: 🔒 Protected (the receiver only; anyone else gets 404)

Authentication: Bearer token

No body.

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift claimed", "action_time": "2026-11-21T11:02:10",
  "data": { "id": "9f1c…", "kind": "PRIVATE", "status": "CLAIMED", "amount": 20000,
            "openedAt": "2026-11-21T11:02:10", "closedAt": "2026-11-21T11:02:10", "cancelUntil": null, "…": "GiftCard" }
}

Then: show "TZS 20,000 added to your gift balance" and refresh GET /wallet/gift. The buyer gets GIFT_CLAIMED.

Errors (409): GIFT_CLOSED (already declined, cancelled or returned), GIFT_EXPIRED (past 14 days, on its way back), GIFT_ON_HOLD (frozen by support), GIFTS_ON_HOLD (my account's gifts are frozen).


12. Decline

Purpose: The receiver says no thanks. The money goes straight back to the buyer's wallet.

Endpoint: POST {base_url}/gifts/{giftId}/reject

Access Level: 🔒 Protected (the receiver only)

Authentication: Bearer token

No body. Ask "Decline this gift? The money goes back to Asha." first.

Success Response: the GiftCard with status: REJECTED. The buyer gets GIFT_REJECTED.

Errors (409): GIFT_CLOSED, GIFT_EXPIRED, GIFT_ON_HOLD.


13. Cancel (buyer)

Purpose: The buyer takes back a waiting private gift or an unused code, within 24 hours of buying. The money goes back to their wallet.

Endpoint: POST {base_url}/gifts/{giftId}/cancel

Access Level: 🔒 Protected (the buyer only; SELF gifts can't be cancelled)

Authentication: Bearer token

No body. The receiver is not told; the card just shows Cancelled. A cancelled code stops working at once.

Success Response: the GiftCard with status: CANCELLED.

Errors (409): CANCEL_WINDOW_PASSED ("Gifts can only be cancelled within 24 hours; it comes back by itself if it isn't opened in time"), GIFT_CLOSED (already opened), GIFT_EXPIRED, GIFT_ON_HOLD.


14. Redeem a code

Purpose: Anyone types a gift code and gets its money in their gift balance.

Endpoint: POST {base_url}/gifts/redeem

Access Level: 🔒 Protected (any signed-in person, the buyer too)

Authentication: Bearer token

Request JSON Sample:

{ "code": "nxg 7k4q m2px 9dft" }

Request Body Parameters:

Parameter Type Required Description Validation
code string Yes As the person typed or pasted it not blank; any case; NXG optional; spaces and dashes ignored

Success Response: the GiftCard with status: REDEEMED, to: null. Show "TZS 10,000 added to your gift balance". The buyer gets GIFT_CODE_REDEEMED (unless they redeemed it themselves).

Redeeming the same code twice by the same person returns the card again (no second credit).

Errors (409):

Code Show
CODE_NOT_FOUND "That code doesn't exist; check it and try again" (counts as a wrong try)
CODE_USED "This code has already been used or is no longer valid"
CODE_EXPIRED "This code has expired"
GIFT_ON_HOLD "This code is on hold; contact support"
CODE_TRIES_PAUSED "Too many wrong codes; try again in 60 minutes" (5 wrong tries)
GIFTS_ON_HOLD gifts are frozen for my account

Part 6 — Gift balance

15. My gift balance

Purpose: How much gift money I have.

Endpoint: GET {base_url}/wallet/gift

Access Level: 🔒 Protected

Authentication: Bearer token

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift balance", "action_time": "2026-11-21T10:30:45",
  "data": { "balance": 20000, "currency": "TZS" }
}

The wallet screen shows two lines: Wallet (/wallet/my-wallet, unchanged: pay, withdraw, send) and Gift (this: pay only). Never add them into one number labelled "balance".


16. Gift balance history

Purpose: Every move in and out of my gift balance, newest first.

Endpoint: GET {base_url}/wallet/gift/history

Access Level: 🔒 Protected

Authentication: Bearer token

Query Parameters:

Parameter Type Required Description Validation Default
page integer No Page, from 0 ≥ 0 0
size integer No Entries per page 1–100 20

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift balance history", "action_time": "2026-11-21T10:30:45",
  "data": {
    "entries": [
      { "entryId": "e3…", "type": "GIFT_REFUND", "amount": 20000,  "description": "Gift part back from ESC-2026-0042", "at": "2026-11-23T09:12:00" },
      { "entryId": "e2…", "type": "GIFT_USE",    "amount": -20000, "description": "Contribution to ESC-2026-0042", "at": "2026-11-22T18:40:31" },
      { "entryId": "e1…", "type": "GIFT_CLAIM",  "amount": 20000,  "description": "Gift opened", "at": "2026-11-21T11:02:10" }
    ],
    "page": 0, "size": 20, "hasNext": false
  }
}

Success Response Fields:

Field Description
entries[].type GIFT_CLAIM (a private gift claimed), GIFT_LOAD (bought for myself), GIFT_USE (paid an order / ticket), GIFT_REFUND (a refund's gift part came back)
entries[].amount + money in, − money out
entries[].description Short text from the ledger
entries[].at When

A redeemed code shows as GIFT_CLAIM too.


Part 7 — Changes to existing endpoints

Also listed in commerce_logistics_changes.md §15. With gifts off, none of this appears.

7.1 Creating or changing a checkout: useGiftBalance

Endpoints: POST {base_url}/e-commerce/checkout-sessions · PATCH {base_url}/e-commerce/checkout-sessions/{sessionId} · POST {base_url}/e-events/checkout

New Request Body Parameter:

Parameter Type Required Description Validation
useGiftBalance boolean No Left out or true: gift balance pays first, the wallet the rest. false: wallet only for this payment ignored by instalment checkouts (always cash)
{ "sessionType": "REGULAR_DIRECTLY", "items": [ … ], "useGiftBalance": false }
  • On the pay screen show a toggle "Use gift balance (TZS 20,000)", on by default, only when the gift balance is more than 0. Changing it on an open checkout: PATCH with useGiftBalance.
  • The "not enough money" check when a checkout is created now counts wallet + gift (when the toggle is on). Before, a person paying partly with gift was refused here.
  • Event tickets: gift is not used for tickets sold at the door, cash-receipt sales or free tickets.

7.2 Balance check before paying

Endpoint: GET {base_url}/wallet/checkout-balance-check?sessionId={id}&domain={PRODUCT|EVENT}

New response fields (only when gifts are on):

{
  "success": true, "httpStatus": "OK", "message": "Checkout balance check completed", "action_time": "2026-11-22T18:40:00",
  "data": {
    "walletBalance": 50000,
    "sessionTotal": 35000,
    "giftBalance": 20000,
    "giftPart": 20000,
    "shortfall": 0,
    "hasSufficientBalance": true,
    "pspMinimum": 1000,
    "currency": "TZS"
  }
}
Field Description
giftBalance New. The person's gift balance now
giftPart New. What the gift will pay for this checkout: min(giftBalance, sessionTotal), or 0 when useGiftBalance is false / instalment / not allowed
shortfall Changed. sessionTotal − giftPart − walletBalance (at least 0)
walletBalance Unchanged: the wallet

Show: "Gift TZS 20,000 · Wallet TZS 15,000 · Total TZS 35,000".

7.3 Payment answer

Endpoint: POST {base_url}/e-commerce/checkout-sessions/{sessionId}/process-payment (and the event payment)

New response fields:

{ "success": true, "status": "COMPLETED", "amountPaid": 35000, "giftPaid": 20000, "walletPaid": 15000, "currency": "TZS", "…": "unchanged" }
Field Description
giftPaid New. Paid from the gift balance (0 when none)
walletPaid New. Paid from the wallet (not cash in hand: every payment goes through the wallet; this is the part that wasn't gift balance). giftPaid + walletPaid = amountPaid

New refusal (409): GIFT_BALANCE_CHANGED: "Your gift balance has changed; check the price again". The gift balance went down between the balance check and Pay (for example, spent on another phone). Call the balance check again and show the new split.

7.4 Refund notice (ESCROW_REFUNDED)

The notification data gains a refund object with ready lines. In-app shows refund.title and refund.body:

Paid with refund.title refund.body
wallet only TZS 35,000 refunded to your wallet From order ORD-2026-0042
gift + wallet TZS 35,000 refunded From order ORD-2026-0042 · TZS 20,000 to your gift balance · TZS 15,000 to your wallet

With a gift part, refund also has total, toGift, toWallet (formatted, e.g. "TZS 20,000"). A refund that went all to the gift balance now notifies too (before, nothing to the wallet = no notice). The old amount field stays as it was (the wallet part).

7.5 Transaction history

New type values in the transaction history (GET /transaction-history):

Type Direction When
GIFT_PURCHASE debit bought a gift / codes
GIFT_LOADED debit bought for myself (wallet → gift)
GIFT_SPENT debit the gift part of a payment
GIFT_REFUNDED credit the gift part of a refund
GIFT_RECEIVED credit a gift claimed or a code redeemed (into the gift balance)
GIFT_RETURNED credit a gift came back to the wallet (declined, cancelled, 14 days, support)

Part 8 — The gift card in a chat

A private gift bought with conversationId writes a message of type GIFT_REF into that one-to-one chat (push preview "🎁 Gift"). It is written after payment succeeds. Group chats can't carry gifts.

The card is built each time it is shown, from the gift as it is now: when Juma claims, the card in both phones shows CLAIMED without a new message.

{
  "kind": "GIFT",
  "labelKey": "card.gift",
  "title": "Birthday",
  "thumbUrl": "https://files.nexgate.co/…/thumb.webp",
  "amount": { "minor": 2000000, "currency": "TZS" },
  "status": "SENT",
  "target": { "type": "GIFT", "id": "9f1c…" },
  "details": { "giftId": "9f1c…", "expiresAt": "2026-12-05T10:30:45", "forMe": true, "canAnswer": true }
}
Field Description
title The design's name
thumbUrl The design picture's thumbnail (or null: draw the NexGate card)
amount.minor Minor units like every chat card (2000000 = TZS 20,000.00)
status The gift's status now
target Tap → GET /gifts/{id}
details.forMe The viewer is the receiver
details.canAnswer Show Claim / Decline on the card (receiver and still SENT)
 Asha's phone                                  Juma's phone
 ┌───────────────────────────────┐             ┌───────────────────────────────┐
 │ [Birthday picture]            │             │ [Birthday picture]            │
 │ TZS 20,000                    │             │ TZS 20,000                    │
 │ "Happy birthday Juma!"        │             │ "Happy birthday Juma!"        │
 │ Waiting · until 5 Dec         │             │ [ Claim ]  [ Decline ]        │
 └───────────────────────────────┘             └───────────────────────────────┘
                after Juma claims, both show:  ✓ Claimed

Part 9 — Notifications

All have targetType: "GIFT" and targetId = the gift id (open GET /gifts/{id}), except GIFT_BALANCE_LOADED (targetType: "GIFT_BALANCE", no id: open the gift balance). Settings category: Gifts.

Type To When Channels In-app text (example)
GIFT_RECEIVED receiver a private gift arrives bell, push 🎁 Asha sent you a gift · TZS 20,000 · claim by 5 Dec
GIFT_INVITE_SMS a phone not on NexGate a gift to that number; reminder 1 day before return SMS only (bell for the buyer: "Gift sent to +255•••••3456 · They get an SMS to sign up and claim it")
GIFT_CLAIM_REMINDER receiver 3 days and 1 day before return bell, push Your gift from Asha expires in 3 days · Claim TZS 20,000 before 5 Dec
GIFT_CLAIMED buyer receiver claimed bell, push 🎉 Juma claimed your gift · TZS 20,000
GIFT_REJECTED buyer receiver declined bell, push Juma declined your gift · TZS 20,000 is back in your wallet
GIFT_CODE_REDEEMED buyer someone else used a code bell, push Your gift code …9DFT was redeemed · TZS 10,000 · 22 Nov
GIFT_RETURNING_SOON buyer 2 days before return bell Your gift to Juma is not opened yet · It returns to your wallet on 5 Dec
GIFT_RETURNED buyer not opened in 14 days (or support returned it) bell, push TZS 20,000 is back in your wallet · Your gift to Juma wasn't opened in time
GIFT_PURCHASED buyer paid (private / codes) bell, email Your gift to Juma is on its way · TZS 20,000 paid from your wallet
GIFT_BALANCE_LOADED buyer bought for myself bell TZS 50,000 added to your gift balance · Pay only · it can't be withdrawn

Notification data (for apps that draw their own text): giftId, actor.name (buyer), recipient.name (or masked phone), gift.amount, gift.expiresOn, gift.kind, gift.codeLast4, gift.daysLeft (reminders), gift.count / gift.total (purchase), isCode.

Cancelling sends nothing to the receiver. Freezing sends nothing to anyone.


Part 10 — Admin

Base: {base_url}/admin/gifts. Every change asks for a reason and is written to the admin audit log with who did it.

Role Can
ROLE_STAFF_ADMIN look up, freeze / unfreeze gifts and accounts, needs-decision list, report
ROLE_SUPER_ADMIN all of that + designs, settings, return a gift to its buyer

17. All designs

Purpose: Every design, switched on or off, in display order.

Endpoint: GET {base_url}/admin/gifts/designs

Access Level: 🔒 Protected (super admin)

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift designs", "action_time": "2026-11-21T10:30:45",
  "data": [
    { "id": "3a7b…", "name": "Birthday", "occasion": "Birthday",
      "image": { "fileId": "8c2e…", "status": "READY", "mimeType": "image/webp", "variants": { "thumb": "https://…" } },
      "minAmount": 1000, "maxAmount": 100000, "presetAmounts": [5000, 10000, 20000],
      "allowPrivate": true, "allowPublic": true, "allowSelf": false,
      "active": true, "fallback": false, "showFrom": null, "showUntil": null, "sortOrder": 10 },
    { "id": "0b11…", "name": "NexGate", "occasion": "General", "image": null, "minAmount": 1000, "maxAmount": 1000000,
      "presetAmounts": [5000, 10000, 20000, 50000], "allowPrivate": true, "allowPublic": true, "allowSelf": true,
      "active": true, "fallback": true, "showFrom": null, "showUntil": null, "sortOrder": 1000 }
  ]
}

Success Response Fields:

Field Description
minAmount, maxAmount The design's own range. People get the stricter of this and the platform limits (settings)
allowPrivate, allowPublic, allowSelf Which kinds can use it
active Switched on
fallback The NexGate card: always there, can't be switched off
showFrom, showUntil Optional dates (a Christmas design from 1 Dec to 31 Dec)
sortOrder Lower shows first

18. Add a design

Purpose: A new design from an uploaded picture.

Endpoint: POST {base_url}/admin/gifts/designs

Access Level: 🔒 Protected (super admin)

Request JSON Sample:

{
  "name": "Christmas",
  "occasion": "Holiday",
  "imageFileId": "77aa…",
  "minAmount": 2000,
  "maxAmount": 200000,
  "presetAmounts": [5000, 10000, 25000],
  "allowPrivate": true,
  "allowPublic": true,
  "allowSelf": false,
  "showFrom": "2026-12-01T00:00:00",
  "showUntil": "2026-12-31T23:59:59",
  "sortOrder": 5,
  "reason": "Christmas season"
}

Request Body Parameters:

Parameter Type Required Description Validation
name string Yes Shown to people max 60
occasion string No Grouping label max 30
imageFileId UUID No A picture uploaded to File Thunder with context GIFT_DESIGN (domain GIFTS), with no words or amount on it must be READY, an image, context GIFT_DESIGN
minAmount, maxAmount number Yes The design's range > 0; min ≤ max
presetAmounts number[] No Quick picks up to 6; each inside the range
allowPrivate, allowPublic, allowSelf boolean Yes Kinds at least one true
showFrom, showUntil datetime No When it shows from before until
sortOrder integer No Order
reason string No For the audit log

Success Response: the design (as in 17).

Errors (409): DESIGN_LIMITS, DESIGN_KINDS, DESIGN_DATES, DESIGN_PRESETS, DESIGN_IMAGE (not found), DESIGN_IMAGE_NOT_READY (still processing: try again shortly), DESIGN_IMAGE_TYPE (not a picture), DESIGN_IMAGE_CONTEXT (not uploaded as GIFT_DESIGN).


19. Edit a design

Purpose: Change a design. Cards already sent keep the name and picture they were bought with.

Endpoint: PUT {base_url}/admin/gifts/designs/{designId}

Access Level: 🔒 Protected (super admin)

Request Body: the same as 18 (send every field). Response / errors: as 18; 404 for an unknown design.


20. Switch a design on / off, reorder

Purpose: Hide or show a design, or move it, without editing it.

Endpoint: PATCH {base_url}/admin/gifts/designs/{designId}/state

Access Level: 🔒 Protected (super admin)

Request JSON Sample:

{ "active": false, "sortOrder": 20, "reason": "Season over" }
Parameter Type Required Description
active boolean No On / off
sortOrder integer No New position
reason string No For the audit log

A checkout opened with a design that is switched off before paying is refused at pay (DESIGN_UNAVAILABLE).

Errors (409): DESIGN_FALLBACK (the NexGate card can't be switched off).


21. Gift settings

Purpose: The platform-wide gift rules.

Endpoints: GET {base_url}/admin/gifts/settings · PUT {base_url}/admin/gifts/settings

Access Level: 🔒 Protected (super admin)

Request JSON Sample (PUT: only the fields sent change):

{ "dailyCodes": 300000, "wrongCodeLimit": 3, "reason": "Fraud wave on codes" }

Response JSON Sample (both):

{
  "success": true, "httpStatus": "OK", "message": "Gift settings", "action_time": "2026-11-21T10:30:45",
  "data": {
    "minAmount": 1000, "maxPrivate": 500000, "maxPublic": 200000, "maxSelf": 1000000,
    "maxCardsPerPurchase": 20, "dailyTotal": 1000000, "dailyCodes": 500000,
    "cancelWindowHours": 24, "returnDays": 14, "buyerNoticeDaysBefore": 2,
    "wrongCodeLimit": 5, "wrongCodePauseMinutes": 60, "updatedAt": "2026-11-21T10:30:45"
  }
}
Field Default Meaning
minAmount 1,000 Smallest card, any kind
maxPrivate / maxPublic / maxSelf 500,000 / 200,000 / 1,000,000 Largest card per kind
maxCardsPerPurchase 20 Most codes in one purchase
dailyTotal 1,000,000 Most TZS one person buys per day, all kinds
dailyCodes 500,000 Most TZS of codes per day (inside dailyTotal)
cancelWindowHours 24 Buyer may cancel within
returnDays 14 Unopened gifts go back after (applies to gifts bought after the change)
buyerNoticeDaysBefore 2 GIFT_RETURNING_SOON this many days before
wrongCodeLimit / wrongCodePauseMinutes 5 / 60 Wrong code tries before a pause, and its length

All amounts must be > 0; reason is required on PUT.


22. Find gifts

Purpose: Support looks gifts up by person, phone number, code or status.

Endpoint: GET {base_url}/admin/gifts

Access Level: 🔒 Protected (staff admin, super admin)

Query Parameters:

Parameter Type Required Description Validation Default
accountId UUID No Gifts this person bought, received or redeemed
phone string No Gifts sent to this phone number (not on NexGate) valid number
code string No The full code a customer reads out (found by its hash)
status string No One status GiftStatus enum
page integer No ≥ 0 0
size integer No 1–100 20

Filters combine. Success Response: as endpoint 6 (counts are all 0 here).


23. One gift (admin)

Purpose: Everything support needs about one gift.

Endpoint: GET {base_url}/admin/gifts/{giftId}

Access Level: 🔒 Protected (staff admin, super admin)

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift", "action_time": "2026-11-21T10:30:45",
  "data": {
    "card": { "id": "a1…", "kind": "PUBLIC", "status": "REDEEMED", "amount": 10000, "codeLast4": "9DFT", "…": "GiftCard" },
    "redeemedBy": { "accountId": "77c1…", "name": "Neema John", "userProfileMedia": null },
    "checkoutSessionId": "5e6f…",
    "recipientPhone": null,
    "buyerFrozen": false,
    "recipientFrozen": false
  }
}
Field Description
card The GiftCard
redeemedBy Who redeemed a code (staff only: never shown to the buyer)
checkoutSessionId The purchase it came from (with its ledger entry)
recipientPhone The full number for a phone gift
buyerFrozen, recipientFrozen The account's gifts are on hold

The freeze, unfreeze and return endpoints answer with this same object.


24. A person's gift balance (admin)

Purpose: One person's gift balance, freeze state and last 50 moves.

Endpoint: GET {base_url}/admin/gifts/people/{accountId}

Access Level: 🔒 Protected (staff admin, super admin)

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift balance", "action_time": "2026-11-21T10:30:45",
  "data": {
    "person": { "accountId": "3213…", "name": "Juma Ally", "userProfileMedia": null },
    "giftBalance": 20000,
    "frozen": false,
    "frozenReason": null,
    "history": [ { "entryId": "e1…", "type": "GIFT_CLAIM", "amount": 20000, "description": "Gift opened", "at": "2026-11-21T11:02:10" } ]
  }
}

The account freeze endpoints answer with this same object.


25. Freeze / unfreeze one gift

Purpose: Put a waiting gift on hold (suspected fraud, a complaint), or release it.

Endpoints: POST {base_url}/admin/gifts/{giftId}/freeze · POST {base_url}/admin/gifts/{giftId}/unfreeze

Access Level: 🔒 Protected (staff admin, super admin)

Request JSON Sample:

{ "reason": "Buyer reports their phone was stolen" }
Parameter Type Required Validation
reason string Yes not blank, max 300
  • Freeze: SENT / ACTIVE → FROZEN. It can't be claimed, redeemed, declined or cancelled, and the 14-day return skips it. Freezing twice is safe.
  • Unfreeze: back to what it was (SENT or ACTIVE). If it is past its 14 days, the next hourly run returns it.

Errors (409): GIFT_CLOSED (freeze: already opened or final), GIFT_NOT_FROZEN (unfreeze).


26. Return a gift to its buyer

Purpose: The only hand-made money move: send a waiting or frozen gift's money back to the buyer's wallet.

Endpoint: POST {base_url}/admin/gifts/{giftId}/return

Access Level: 🔒 Protected (super admin only)

Request: { "reason": "…" } as in 25.

The gift becomes RETURNED, a code stops working, the buyer gets GIFT_RETURNED. Returning twice is safe. An opened gift can't be returned (its money is already someone's gift balance).

Errors (409): GIFT_CLOSED ("Only an unopened or frozen gift can be returned").


27. Freeze / unfreeze a person's gifts

Purpose: Stop one account from buying, claiming, redeeming or paying with gifts.

Endpoints: POST {base_url}/admin/gifts/people/{accountId}/freeze · POST {base_url}/admin/gifts/people/{accountId}/unfreeze

Access Level: 🔒 Protected (staff admin, super admin)

Request: { "reason": "…" }. Response: as 24.

While frozen, that person gets GIFTS_ON_HOLD on gift checkout, claim and redeem, and their checkouts pay from the wallet only (the gift balance is left untouched). Their wallet is not affected. Calling twice is safe.


28. Needs a decision

Purpose: Frozen gifts past their 14 days: they will never come back on their own, so someone must unfreeze or return them.

Endpoint: GET {base_url}/admin/gifts/needs-decision

Access Level: 🔒 Protected (staff admin, super admin)

Success Response: a list of the object in 23.


29. Report

Purpose: What was bought and what happened to it, and a check that the money adds up.

Endpoint: GET {base_url}/admin/gifts/report?from=2026-11-01

Access Level: 🔒 Protected (staff admin, super admin)

Query Parameters:

Parameter Type Required Description Validation Default
from date No Cards bought since this day YYYY-MM-DD first day of this month

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gift report", "action_time": "2026-11-21T10:30:45",
  "data": {
    "from": "2026-11-01T00:00:00",
    "byStatus": { "SENT": 60000, "ACTIVE": 30000, "CLAIMED": 140000, "REDEEMED": 20000, "RETURNED": 10000 },
    "countByStatus": { "SENT": 3, "ACTIVE": 3, "CLAIMED": 9, "REDEEMED": 2, "RETURNED": 1 },
    "waitingNow": 90000,
    "liabilityBalance": 90000,
    "giftBalancesTotal": 135000,
    "reconciled": true,
    "difference": 0
  }
}
Field Description
byStatus TZS of cards bought since from, by their status now
countByStatus Number of those cards by status
waitingNow TZS in all cards waiting or frozen now (any purchase date)
liabilityBalance What NexGate's gift account holds now
giftBalancesTotal Sum of everyone's gift balances now
reconciled true when the gift account holds exactly the waiting cards
difference liabilityBalance − waitingNow; anything but 0 is a problem to look into at once

The same check runs every night at 03:15 and writes a log line on a mismatch.


Part 10a — Who can send me gifts

Each person chooses who may send them a private gift. Codes and buying for yourself are not affected. Gifts already sent stay (they can still be claimed or declined).

Setting Asha can send Juma a gift when
EVERYONE (default) always, unless one has blocked the other
PEOPLE_I_FOLLOW Juma follows Asha
NOBODY never
 ASHA picks Juma (chat, profile, person picker)
        │
        ▼
 GET /gifts/can-send?recipientId=Juma ──► canSend: false ──► grey out Gift, show reason
        │ canSend: true                     "Juma isn't accepting gifts from you"
        ▼
 POST /gifts/checkout-sessions ─────────► checked again ─► 409 GIFT_NOT_ACCEPTED if Juma changed it meanwhile
        ▼
 POST …/process-payment ─────────────────► checked again ─► 409, nothing paid

30. Can I send this person a gift?

Purpose: Ask before checkout, to show or grey out Gift with the reason.

Endpoint: GET {base_url}/gifts/can-send

Access Level: 🔒 Protected

Authentication: Bearer token

Query Parameters:

Parameter Type Required Description Validation Default
recipientId UUID One of the two The person picked
recipientPhone string One of the two A typed number valid phone

Success Response JSON Sample (always HTTP 200; the answer is in canSend):

{
  "success": true, "httpStatus": "OK", "message": "Can send a gift", "action_time": "2026-11-21T10:30:45",
  "data": { "canSend": false, "code": "GIFT_NOT_ACCEPTED", "reason": "Juma isn't accepting gifts from you",
            "recipient": { "accountId": "3213…", "name": "Juma Ally", "userProfileMedia": null }, "recipientPhone": null }
}
Field Description
canSend true: go to checkout
code, reason Only when canSend is false: GIFT_NOT_ACCEPTED, GIFT_SELF, GIFT_RECIPIENT, GIFT_PHONE, GIFTS_ON_HOLD. Show reason
recipient The person, when picked by recipientId. Always null for a typed number, so a number never reveals its owner
recipientPhone The typed number, masked (+255•••••3456)

A typed number not on NexGate answers canSend: true (the person gets an SMS after paying). 404 for an unknown recipientId.


31. My gift setting

Endpoint: GET {base_url}/gifts/me/preferences

Access Level: 🔒 Protected

Success Response JSON Sample:

{ "success": true, "httpStatus": "OK", "message": "Gift preferences", "action_time": "2026-11-21T10:30:45",
  "data": { "whoCanSendGifts": "EVERYONE" } }

32. Change my gift setting

Endpoint: PUT {base_url}/gifts/me/preferences

Access Level: 🔒 Protected

Request JSON Sample:

{ "whoCanSendGifts": "PEOPLE_I_FOLLOW" }
Parameter Type Required Description Validation
whoCanSendGifts string Yes Who may send me private gifts EVERYONE, PEOPLE_I_FOLLOW, NOBODY

Success Response: as 31, with the new value. Show it in Settings → Privacy → Who can send me gifts.


Part 11 — Refusal codes

All are HTTP 409; show data.reason.

Code Where When
GIFT_RECIPIENT open PRIVATE without exactly one of recipientId / recipientPhone; or a recipient on PUBLIC / SELF
GIFT_PHONE open, admin search not a valid phone number
GIFT_SELF open the recipient is yourself (use SELF)
GIFT_CHAT open conversationId isn't a one-to-one chat between you and the receiver
GIFT_NOT_ACCEPTED can-send, open, pay the receiver doesn't take gifts from you (their setting, or one of you blocked the other; the reason never says which). Typed number: "This number can't receive a gift from you"
GIFT_MESSAGE_LINK open, pay the message has a link
DESIGN_UNAVAILABLE open, pay design switched off or outside its dates
DESIGN_KIND open, pay design doesn't allow this kind
GIFT_AMOUNT open, pay not whole shillings
GIFT_TOO_SMALL / GIFT_TOO_BIG open, pay outside the range for this design and kind
GIFT_QUANTITY open, pay several cards for PRIVATE / SELF, or more than maxCardsPerPurchase
GIFT_DAILY_LIMIT open, pay over today's gift total
GIFT_DAILY_CODE_LIMIT open, pay over today's code total
GIFTS_ON_HOLD open, pay, claim, redeem the account's gifts are frozen
INSUFFICIENT_BALANCE pay wallet too low; reason says how much to top up
CHECKOUT_CLOSED pay session left or ended
CHECKOUT_EXPIRED pay over 15 minutes
GIFT_CLOSED claim, decline, cancel, admin the gift isn't waiting any more
GIFT_EXPIRED claim, decline, cancel past its 14 days (on its way back)
GIFT_ON_HOLD claim, decline, cancel, redeem the gift is frozen
CANCEL_WINDOW_PASSED cancel more than 24 h after buying
CODE_NOT_FOUND redeem no such code (counts as a wrong try)
CODE_USED redeem used, cancelled or returned
CODE_EXPIRED redeem past its 14 days
CODE_TRIES_PAUSED redeem too many wrong codes: paused
CODE_CLOSED show code the code isn't ACTIVE any more
GIFT_BALANCE_CHANGED shop / event payment gift balance went down under the payment; check again
GIFT_NOT_FROZEN admin unfreeze the gift isn't frozen
DESIGN_FALLBACK admin design state the NexGate card can't be switched off
DESIGN_LIMITS / DESIGN_KINDS / DESIGN_DATES / DESIGN_PRESETS admin design bad range / no kind / dates / presets
DESIGN_IMAGE / DESIGN_IMAGE_NOT_READY / DESIGN_IMAGE_TYPE / DESIGN_IMAGE_CONTEXT admin design picture missing / processing / not a picture / not uploaded as GIFT_DESIGN
GIFT_NOT_HERE catalogue, moment send, card open / pay from a live the live isn't on, the person isn't who can receive here, not your one-to-one chat
GIFT_PLACE moment send, card open, admin items / settings a place not built yet (POST); a card from a place where cards don't show; a public / self card with a place
GIFT_ITEM_UNAVAILABLE moment send the item is switched off, out of its dates, or not allowed in this place
GIFT_ACCOUNT_NEW catalogue, moment send the sender's account is younger than momentMinAccountAgeDays
GIFT_KEY_REUSED moment send this idempotencyKey was already used for a different gift
GIFT_SELF moment send a moment gift to yourself
GIFT_DAILY_LIMIT moment send over today's moment total (momentDailyTotal)
ITEM_KEY / ITEM_KEY_TAKEN / ITEM_PRICE / ITEM_DATES / ITEM_ICON… admin items key missing or taken / not whole shillings / dates / picture (as the design picture codes)

Part 12 — Screens checklist

Screen Calls
Wallet /wallet/my-wallet (Wallet) + GET /wallet/gift (Gift balance) · Gift history → GET /wallet/gift/history
Gift menu tabs Received (6) · Sent (7) · My codes (8), chips from counts · Buy a gift · Redeem a code (14)
Buy a gift GET /gifts/designs (1) → pick kind, design, amount, person / phone / quantity, message → open (2) → confirm (total, wallet balance) → pay (4)
After paying codes the codes list from (4) with Copy / Share; "You can see them again in My codes"
One gift GET /gifts/{id} (9) with buttons by the table in 9
Profile / chat "Send a gift" can-send (30) first, then open (2) with recipientId (+ conversationId from a one-to-one chat)
Settings → Privacy Who can send me gifts (31, 32)
Checkout pay screen toggle Use gift balance (7.1), split from the balance check (7.2), giftPaid / walletPaid on the receipt (7.3)
Admin: Gifts find (22), one (23), person (24), freeze / unfreeze (25, 27), return (26), needs decision (28), report (29)
Admin: Gift designs + settings 17–21

Part 13 — Moment gifts (new in v1.1)

Spec: GIFT_SYSTEM_SPEC.md §1a and §4.7.

13.0 How it works

                 ┌──────────── 🎁 GIFTS ────────────┐
     🎉 Moment gifts (this part)            💳 Gift cards (Parts 1–12)
     admin list: 🔥 Fire 1,000 · 🦁 Lion…   amount + design + message
     one tap, instant, no claim            claimed, 14-day return
                 └──────────► 💰 GIFT BALANCE ◄──────┘
  • A moment gift is one item from an admin-made list (key, name, icon, price, size), sent in one tap to one person, from a place: LIVE (a live that is on; the receiver is the host), CHAT (a one-to-one chat; the receiver is the other person), MEETING (an open meeting you are in; the host, co-hosts and speakers receive, listeners only send) or CALL (a call that is on and you are in; the others in the call receive). Meetings and calls: the sender must be 18 or older, else the catalogue has no receivers. The money goes straight from the sender's wallet into the receiver's gift balance. Nothing to claim, never refunded, never cash.
  • Two switches. Moment gifts have their own switch on top of the gift switch: with moments off, the catalogue lists no items and sending answers 404. With gifts off, everything here answers 404.
  • The app plays the animation for key (e.g. fire). An unknown key (a new admin item, an old app): show icon with a simple fly-up. size says how big to play it.
  • Ask the server what to show: GET /gifts/catalogue?place=&contextId= (33) returns the items allowed here, whether the 💳 gift card tab shows, who can receive and what is left today. If canSend is false, grey the picker out and show reason.
  • Every tap gets its own idempotencyKey (a UUID made by the app). A retry of the same tap sends the same key: the server returns the first gift and moves no money twice.
  • No PIN. Prices are set by the admin; the daily limit (100,000 by default) caps the risk.
  • The price is kept. A sent gift keeps the name and price it was sent at, even if the admin changes the item later.
  • No push per moment gift. In a live the room sees it (13.6); in a chat the gift message is the notice.

Example (live). Juma is live, Neema watches.

  1. Neema taps 🎁 → GET /gifts/catalogue?place=LIVE&contextId=<streamId> → 🔥 1,000 · 🌹 2,000 · 🦁 50,000 + 💳 tab; receiver Juma.
  2. She taps 🔥 → POST /gifts/moments → her wallet −1,000, Juma's gift balance +1,000.
  3. Everyone in the live gets a system comment GIFT_MOMENT with the gift's id → reads it (37) → plays 🔥 "Neema → Juma".

Refused (one answer, never which reason): Juma doesn't take gifts from Neema (his setting, a block, his gifts on hold) → GIFT_NOT_ACCEPTED; the live ended / Rose isn't the host / not your chat → GIFT_NOT_HERE.

33. What can I send here (catalogue)

Purpose: Everything the gift picker needs for one live or one chat.

Endpoint: GET {base_url}/gifts/catalogue

Access Level: 🔒 Protected

Authentication: Bearer token

Query Parameters:

Parameter Type Required Description Validation Default
place string Yes Where the picker is open LIVE, CHAT, MEETING, CALL (POST refused for now) —
contextId UUID Yes LIVE: the streamId. CHAT: the conversationId of a one-to-one chat. MEETING: the meetingId. CALL: the callId — —

Success Response JSON Sample:

{
  "success": true, "httpStatus": "OK", "message": "Gifts here", "action_time": "2026-11-24T20:15:02",
  "data": {
    "place": "LIVE", "contextId": "7c1e…",
    "items": [
      { "id": "a1…", "key": "fire", "name": "Fire", "icon": { "fileId": "…", "status": "READY", "variants": { "thumb": "https://…" }, "mimeType": "image/webp" }, "price": 1000, "size": "SMALL" },
      { "id": "a2…", "key": "lion", "name": "Lion", "icon": { … }, "price": 50000, "size": "BIG" }
    ],
    "giftCards": true,
    "receivers": [ { "accountId": "3213…", "name": "Juma", "userProfileMedia": { … } } ],
    "leftToday": 99000,
    "canSend": true, "code": null, "reason": null
  }
}

Success Response Fields:

Field Description
items Moment gifts allowed here, in the admin's order. Empty when moment gifts are switched off
giftCards Show the 💳 Gift card tab (opens checkout 2 with place + contextId, see 13.5)
receivers Who can get a gift here; the first is the default. Only people who accept gifts from you
leftToday TZS of moment gifts you can still send today
canSend / code / reason false with a refusal code (GIFT_ACCOUNT_NEW, GIFTS_ON_HOLD, GIFT_NOT_HERE) when nothing can be sent; then giftCards is false too

34. Send a moment gift

Purpose: One tap: the money moves at once.

Endpoint: POST {base_url}/gifts/moments

Access Level: 🔒 Protected

Authentication: Bearer token

Request JSON Sample:

{ "itemId": "a1…", "receiverId": "3213…", "place": "LIVE", "contextId": "7c1e…", "idempotencyKey": "5b0e2c7a-…" }

Request Body Parameters:

Parameter Type Required Description Validation
itemId UUID Yes From the catalogue —
receiverId UUID Yes One of the catalogue's receivers —
place string Yes LIVE, CHAT, MEETING or CALL —
contextId UUID Yes streamId, conversationId, meetingId or callId —
idempotencyKey string Yes New for every tap; the same for a retry of that tap ≤ 64 chars

Success Response JSON Sample (the GiftMoment object):

{
  "success": true, "httpStatus": "OK", "message": "Gift sent", "action_time": "2026-11-24T20:15:09",
  "data": {
    "id": "m9…", "itemKey": "fire", "itemName": "Fire", "icon": { … }, "size": "SMALL",
    "price": 1000, "quantity": 1, "amount": 1000,
    "from": { "accountId": "304e…", "name": "Neema", "userProfileMedia": { … } },
    "to":   { "accountId": "3213…", "name": "Juma",  "userProfileMedia": { … } },
    "place": "LIVE", "contextId": "7c1e…", "at": "2026-11-24T20:15:09"
  }
}

Success Response Fields:

Field Description
itemKey, itemName, price, amount As sent (kept even if the admin changes the item)
icon, size From the item as it is now, for drawing
quantity Always 1 for now (combos later)

Refusals (409): GIFT_SELF, GIFT_ITEM_UNAVAILABLE, GIFT_NOT_HERE, GIFT_NOT_ACCEPTED, GIFTS_ON_HOLD, GIFT_ACCOUNT_NEW, GIFT_DAILY_LIMIT, INSUFFICIENT_BALANCE, GIFT_KEY_REUSED, GIFT_PLACE (Part 11).

35. Moment gifts I sent

Endpoint: GET {base_url}/gifts/moments/sent?page=0&size=20

Access Level: 🔒 Protected

Success Response JSON Sample:

{ "success": true, "httpStatus": "OK", "message": "Gifts sent", "action_time": "…",
  "data": { "moments": [ { "id": "m9…", "itemKey": "fire", "amount": 1000, "to": { … }, "place": "LIVE", "at": "…" } ],
            "count": 12, "total": 18000, "page": 0, "size": 20, "hasNext": false } }

count and total cover every gift sent, not only this page. size 1–100.

36. Moment gifts I received

Endpoint: GET {base_url}/gifts/moments/received?page=0&size=20. Same shape as 35, with from filled.

37. One moment gift

Purpose: What the live overlay reads after a GIFT_MOMENT system comment (13.6), and what a chat card opens.

Endpoint: GET {base_url}/gifts/moments/{momentId}

Access Level: 🔒 Protected. Anyone signed in for a gift sent in a live; only sender and receiver for a chat gift (others get 404).

Success Response: the GiftMoment object (34).

38–41. Admin: the moment gift list (super admin)

# Method Endpoint Purpose
38 GET /admin/gifts/items All items, any state, in order
39 POST /admin/gifts/items Add an item
40 PUT /admin/gifts/items/{itemId} Edit (the key never changes)
41 PATCH /admin/gifts/items/{itemId}/state { "active": false, "sortOrder": 3, "reason": "…" } switch off / on, reorder

Request JSON Sample (39, 40):

{ "key": "fire", "name": "Fire", "iconFileId": "f1…", "price": 1000, "places": ["LIVE", "CHAT"], "size": "SMALL",
  "showFrom": null, "showUntil": null, "sortOrder": 1, "reason": "first gifts" }
Parameter Type Required Description Validation
key string create only What the app plays the animation for; fixed once created [a-z0-9_]{2,40}, unique
name string Yes Shown in the picker ≤ 60
iconFileId UUID create Picture uploaded with context GIFT_DESIGN, processed (READY) —
price number Yes TZS whole shillings, > 0
places array No Where it shows LIVE, CHAT, MEETING, CALL (POST refused). Create: empty or left out = every place that works today. Edit: empty or left out = unchanged. To take an item out of meetings or calls, send the list without them
size string Yes Animation size SMALL, MEDIUM, BIG
showFrom / showUntil datetime No Seasonal items until after from
sortOrder, reason — No Order; the reason goes into the admin audit —

Success Response: the item { id, key, name, icon, price, places, size, active, showFrom, showUntil, sortOrder, createdAt, updatedAt }. Items are never deleted, only switched off. Every change is in the admin audit (GIFT_ITEM_CREATED, GIFT_ITEM_EDITED, GIFT_ITEM_STATE).

Refusals (409): ITEM_KEY, ITEM_KEY_TAKEN, ITEM_ICON (+ _NOT_READY, _TYPE, _CONTEXT), ITEM_PRICE, ITEM_DATES, GIFT_PLACE.

13.5 Changes to existing gift endpoints (fields only added)

Endpoint Change
POST /gifts/checkout-sessions (2) + optional place (LIVE / CHAT, or MEETING / CALL if the admin added them to cardPlaces) and contextId: a private card sent from a live (to the host, while it's on) or a chat. A conversationId alone still means "from that chat". Refusals: GIFT_PLACE (not private, or cards don't show in this place), GIFT_NOT_HERE
GET /wallet/gift/history (16) + entries[].giftType: MOMENT (type GIFT_MOMENT, a moment gift received), CARD (GIFT_CLAIM, GIFT_LOAD), empty for spending and refunds
GET/PUT /admin/gifts/settings (21) + momentDailyTotal (100,000), momentMinAccountAgeDays (3), cardPlaces (["LIVE","CHAT"], where the 💳 tab shows; MEETING and CALL may be added)
GET /admin/gifts/report (29) + moments: { count, total, byItem: [{ key, name, count, total }], topReceivers: [{ person, count, total }] } since from
GET /admin/gifts/people/{accountId} (24) + moments: { sentCount, sentTotal, receivedCount, receivedTotal, recent: [GiftMoment…] }
Wallet transaction history new types GIFT_MOMENT_SENT (debit) and GIFT_MOMENT_RECEIVED (credit)

13.6 In a live, a chat, a meeting and a call

  • Live: after a moment gift or a gift card bought in a live, every viewer's comment stream gets a system comment: { "system": true, "event": "GIFT_MOMENT", "refId": "<momentId>" } (read it with 37) or { "system": true, "event": "GIFT_CARD", "refId": "<giftId>" } ("Juma sent Mama Yoyo a gift card 💳"; the host claims it as usual). Today through the 2-second comment read; through Centrifugo after the live revamp.
  • Chat: a new message type GIFT_MOMENT in the one-to-one chat, written as the sender, metadata { momentId, amountMinor, currency, itemKey, itemName }. Its card: kind GIFT, labelKey "card.gift_moment", title = item name, amount, status "RECEIVED", target GIFT_MOMENT + momentId, details { momentId, itemKey, size, forMe }. Nothing to answer: the money is already in the receiver's gift balance. The chat list preview is "🎁 Gift".
  • Meeting / call: everyone in the room gets the room message GIFT_MOMENT with itemId = the momentId (read it with 37, play the animation for itemKey). No chat message, no push. Details in the calls & meetings doc, F12.

13.7 Screens checklist (moment gifts)

Screen Calls
Live: 🎁 button GET /gifts/catalogue?place=LIVE&contextId=<streamId> → tap an item → POST /gifts/moments (new key per tap) · 💳 tab → checkout 2 with place=LIVE
Live: overlay on a GIFT_MOMENT system comment → GET /gifts/moments/{id} → play the animation for itemKey · GIFT_CARD → "💳 gift card" line
Chat: 🎁 button GET /gifts/catalogue?place=CHAT&contextId=<conversationId> → moment items + 💳 tab (checkout 2 with conversationId)
Meeting / call: 🎁 button GET /gifts/catalogue?place=MEETING&contextId=<meetingId> (or place=CALL&contextId=<callId>) → tap an item → POST /gifts/moments · on the room message GIFT_MOMENT {itemId: momentId} → GET /gifts/moments/{id} → play the animation (calls & meetings doc, F12)
Gift menu new tabs Moments sent (35) / Moments received (36)
Admin: Moment gifts 38–41; settings (21) for the daily limit, account age and card places