transferred ledger entry to the ticket.
Transfer flow
Verify recipient
The function looks up the recipient by
email in u_users. The recipient must exist and have account_validated: true.Retrieve current ledger
The ticket’s existing ledger is read from PostgreSQL (
tickets table) to preserve the full audit history.Update ticket ownership
Firestore and PostgreSQL are updated with the new
customer_email, customer_id, customer_name, customer_phone, and a new transferred ledger entry.app_transfer_tickets
Transfers a ticket online to another registered user. Both users must be registered in u_users. The recipient must have account_validated: true.
Endpoint
Request
The full ticket ID (e.g.,
eventId-ticketDocId) to transfer.Email address of the recipient user.
Email address of the sender (current ticket holder).
Response
Success:app_transfer_tickets_offline
Same as app_transfer_tickets but adds a deduplication guard: if the ticket’s transferred field in PostgreSQL is already set (non-null), the transfer is rejected with "Ticket ya sincronizado". This prevents double-transfers of tickets that were already transferred offline.
Endpoint
Request
Same parameters asapp_transfer_tickets.
Full ticket ID to transfer.
Recipient email address.
Sender email address.
Additional response case
Ticket already transferred offline:The offline transfer sets
transferred: "offline" in both Firestore and PostgreSQL. The online transfer sets transferred: "online". Use app_transfer_tickets_offline when the device may have been offline during the original transfer to prevent duplicate processing.