Avanzar In Time Shop is designed for markets where automated payment gateway integration is impractical. Instead of processing cards programmatically, the platform captures a payment intent at checkout and then relies on admin staff to verify the incoming transfer or cash receipt before releasing the order for fulfillment. This manual model keeps the integration surface small and supports real-world informal payment channels common in the Cuban market.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ItsJhonAlex/Ecommerce/llms.txt
Use this file to discover all available pages before exploring further.
Payment Methods
Three payment methods are supported, defined in thepayment_method enum:
cod
Cash on Delivery. The customer pays the courier in cash upon receiving the package. No upfront payment reference is expected.
transfer_local
Local bank transfer. The buyer transfers funds through a domestic Cuban bank channel and provides the transaction reference to the admin.
zelle
Zelle wire transfer. Common for overseas buyers (e.g., from the US) who send USD to a Zelle-registered account before the order is dispatched.
Payment Statuses
Each payment record moves through thepayment_status enum:
| Status | Meaning |
|---|---|
pending | Created automatically at checkout. Awaiting admin review and confirmation. |
confirmed | Admin has verified the payment receipt. The linked order is promoted to paid. |
rejected | Payment was rejected. Defined in the schema for future use — not wired to V1 transition logic yet. |
Confirmation Flow
Customer places order
The checkout endpoint creates an
orders record (status: pending_payment) and a payments record (status: pending) atomically in the same database transaction. The amountMinor on the payment equals the totalMinor of the order.Customer sends payment
For Zelle or local transfer, the customer completes the payment outside the platform and obtains a confirmation number or reference code from their bank or Zelle app.
Customer submits reference
The customer shares the reference number with the shop (e.g., via WhatsApp or the order notes field). The admin will use this reference to reconcile the incoming funds.
Admin confirms via API
An authenticated admin calls
PATCH /api/v1/admin/payments/:id/confirm with the reference string in the request body:Payment record updated
The backend performs a conditional
UPDATE payments SET status = 'confirmed', confirmed_by = :adminId, confirmed_at = NOW(), reference = :reference WHERE id = :id AND status = 'pending'. The confirmedBy and confirmedAt fields are populated, creating a permanent record of who authorized the payment.Double-Confirmation Safety
TheWHERE status = 'pending' clause on the payment UPDATE is the key guard against double-confirmation. If two admin users open the same payment record and click “Confirm” within milliseconds of each other, only the first request will match the WHERE predicate and succeed. The second request finds 0 rows affected and receives a 409 Conflict response.
The reference Field
The reference column on the payments table stores the external confirmation identifier provided by the customer — for example a Zelle transaction ID or a local bank transfer folio number. It is optional at order creation (some methods like cod have no upfront reference) and is set by the admin during confirmation.
| Payment method | Typical reference format |
|---|---|
zelle | ZEL-YYYYMMDD-XXXXXX (Zelle confirmation number) |
transfer_local | Bank-issued folio or transaction ID |
cod | Left blank — cash is collected on delivery |