Gift cards (company wide)
Gift cards sold outside the online shop: company, value, expiry and status (active, cancelled, expired). The balance is the sum of gift_card_entries. The code is not returned on read: the loyalty.sell_gift_card command and the show_code action give it. Actions: show_code, document, send, set_text, new_code, cancel, extend.
Module: Fidelizare (loyalty).
Endpoints
Section titled “Endpoints”GET /api/v1/gift_cards- List with filters, sorting and pagination (scopeloyalty:read)GET /api/v1/gift_cards/{id}- A record by id (scopeloyalty:read)POST /api/v1/gift_cards/{id}/show_code- Codul unui card activ. Deschiderea se notează pe card (access_log). (scopeloyalty:write)POST /api/v1/gift_cards/{id}/document- PDF-ul cardului, în base64.recipient_nameșimessage, dacă vin, rămân pe card. (scopeloyalty:write)POST /api/v1/gift_cards/{id}/send- Trimite cardul pe email, cu PDF-ul atașat, prin SMTP-ul companiei. (scopeloyalty:write)POST /api/v1/gift_cards/{id}/set_text- Schimbă numele și mesajul de pe card. (scopeloyalty:write)POST /api/v1/gift_cards/{id}/new_code- Cod nou, pentru când codul a ajuns la altcineva: cel vechi nu mai merge. (scopeloyalty:write)POST /api/v1/gift_cards/{id}/cancel- Închide cardul: soldul rămas iese, cu motiv și cu felul restituirii. (scopeloyalty:write)POST /api/v1/gift_cards/{id}/extend- Schimbă termenul unui card activ. (scopeloyalty:write)
Fields
Section titled “Fields”id(string, uuid; read): Unique identifier (UUID).legal_entity_id(string, uuid; read)code_last4(string; read)currency(string; read): Currency (ISO code, e.g. RON).initial_value(number; read)status(string; read)expires_on(string, date; read)buyer_party_id(string, uuid; read)recipient_name(string; read)note(string; read)sale_method(string; read)sale_reference(string; read)location_id(string, uuid; read)idempotency_key(string; read)sold_by_name(string; read)created_by(string; read)created_at(string, date-time; read): Creation date (ISO 8601).updated_at(string, date-time; read): Last modification date (ISO 8601).gift_message(string; read)access_log(object; read)
Events
Section titled “Events”gift_cards.createdgift_cards.updatedgift_cards.deleted