Loga API
Clone or download demo application
Main Function
- Login (JSON)https://loga.app/api/main/loginExample:Input parameteruser - Username (Required)pass - MD5 hash of password (Required)uuid - Device ID (Required)one_userid - ONE User ID for reference with ONECHAT (Optional)Output parametercode - Result codemsg - Result messagedata - Merchant infotoken - Token for authenticate other services (along with uuid), valid until logout or password changedmid - Your merchant IDname - Your namestore_id - Your store ID
- Logout (JSON)https://loga.app/api/main/logoutExample:Input parametertoken - User token (Required)uuid - Device ID (Required)Output parametercode - Result codemsg - Result message
- Get list of cards (JSON)https://loga.app/api/main/get_cardsExample:Input parametertoken - User token (Required)uuid - Device ID (Required)Output parametercode - Result codemsg - Result messagedata - List of cardscard_id - Card IDname - Card name
- Get card detail (JSON)https://loga.app/api/main/get_card_detailInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)Output parametercode - Result codemsg - Result messagedata - List of cardscard_id - Card IDname - Card namepoint_product - Point formulasadd - List of formulasformula_id - Formula IDname - Formula namemultiplier - Formula multiplier
- Get list of rewards (JSON)https://loga.app/api/main/get_rewardsInput parametercard_id - Card ID (Required)Output parametercode - Result codemsg - Result messagedata - List of rewardsreward_id - Reward IDname - Reward namepoint_amount - Redeem point amount in negativedisplay_amount - Redeem point amount for displayexpire_date - Expired date (unix time)
- Get list of customers (JSON)https://loga.app/api/main/get_customersInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)offset - Offset (Required)limit - Limit (Required)Output parametercode - Result codemsg - Result messagedata - List of customerscard_type - Card type (plastic/online)pcard_id - Plastic card ID, exist if card type is plasticpcard_no - Card number, exist if card type is plasticuid - User ID, exist if card type is onlineusername - Username, exist if card type is onlinefname - First namelname - Last nametel - Mobile number
- Get customer info (JSON)https://loga.app/api/main/get_customer_infoInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)plastic_ident - Serial, barcode or mobile number (Required for plastic card)cuid - Customer user ID or mobile number (Required for online card)Output parametercode - Result codemsg - Result messagedata - Customer infocard_type - Card type (plastic/online)user_info - Customer infopcard_id - Plastic card ID, exist if card type is plasticuid - User ID, exist if card type is onlinefname - First namelname - Last nametel - Mobile numbergender - Gender (M/F)card - Subscription infocreated - Subscribed date (unix time)expired - Expired date (unix time)point - Point infonow - Remaining pointscredits - Credits infocdid - Remaining pointscredit_name - Credit namecredit_unit - Credit unitcurrent_amount - Remaining creditslevel - Current level idlevel_text - Current level nameremark - Remark
- Create and subscribe new plastic card (JSON)https://loga.app/api/main/subscribe_by_unregistered_cardInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)serial - NFC serial (Required)barcode - Barcode (Required)mobile - Mobile number (Required)fname - First name (Required)lname - Last name (Optional)gender - Gender (M/F) (Optional)birthday - Birthday (yyyy-mm-dd) (Optional)address - Address, Email address (Optional)remark - Remark (Optional)level - Level ID (Numeric) (Optional)Output parametercode - Result codemsg - Result messagedata - Credit infocredit - Credit left
- Register plastic card's NFC with barcode (JSON)https://loga.app/api/main/register_plastic_cardInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)nfc - NFC serial (Required)barcode - Barcode (Required)Output parametercode - Result codemsg - Result message
- Subscribe customer to a card (JSON)https://loga.app/api/main/add_memberInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)pcard_id - Plastic card ID (Required for plastic card)cuid - Customer user ID (Required for online card)mobile - Mobile number (Required for plastic card)fname - First name (Required for plastic card)lname - Last name (Optional)gender - Gender (M/F) (Optional)birthday - Birthday (yyyy-mm-dd) for P-Member (Optional)address - Address, Email address for P-Member (Optional)remark - Remark for P-Member (Optional)level - Level ID (Numeric) for P-Member (Optional)Output parametercode - Result codemsg - Result messagedata - Credit infocredit - Credit left
- Edit customer info (JSON)https://loga.app/api/main/set_customer_profile
Edit various customer information, e.g., first name, last name, membership level.
In case of any error, e..g, the membership level does not exist, the process will stop and the whole customer information will NOT be changedInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)pcard_id - Plastic card ID (Required for plastic card)cuid - Customer user ID (Required for online card)mobile - Mobile number (Optional, Plastic card only)fname - First name (Optional, Plastic card only)lname - Last name (Optional, Plastic card only)gender - Gender (M/F) (Optional, Plastic card only)level - Level ID (Optional, Online card only)remark - Remark (Optional, Online card only)Output parametercode - Result codemsg - Result message - Bind plastic card with online card (JSON)https://loga.app/api/main/bind_plastic_cardInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cuid - Customer user ID (Required)barcode - Barcode (Required)serial - NFC serial (for validation) (Optional)Output parametercode - Result codemsg - Result message
- Unbind plastic card from online card (JSON)https://loga.app/api/main/unbind_plastic_cardInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cuid - Customer user ID (Required)Output parametercode - Result codemsg - Result message
- Create member subscription ticket (JSON)https://loga.app/api/main/create_member_ticketInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)level - Subscribe to this level (Optional)Output parametercode - Result codemsg - Result messagedata - Ticket infoserial - Member serial code
- Verify code (JSON)https://loga.app/api/main/verify_codeInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)code - Data of QR code (Required)Output parametercode - Result codemsg - Result messagedata - Ticket infovalid - Validity of codelevel - Level idlevel_text - Level name
Points
- Add customer points (JSON)https://loga.app/api/points/add_customer_pointInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)pcard_id - Plastic card ID (Required for plastic card)cuid - Customer user ID (Required for online card)point - Amount of points, must not exceed 1 million. (Required, except in case that both cost and formula_id are specified)formula_id - Money-to-Point formula ID, applicable only when Money-to-Point is enabled and the cost amount is given. You can enable Money-to-Point feature and see the formula_id in the web admin "Manage" tab, under the left-side menu "Points". Also you can use the web service get_card_detail to obtain the formula id. (Optional)cost - Total amount of customer's spending. If Money-to-Point is enabled and both cost and formula_id are specified, the amount of points will be calculated based on that formula and automatically given to the customer. Note that in such case, the parameter point will be ignored. (Optional)remark - Any message, visible to customer (Required)private_remark - Any message, visible only to merchant staff (Optional)reference - Unique reference code to prevent request duplications. Future transcactions using the same reference code will be ignored. (Optional)branch_code - Branch code such as BKK, CMI (Optional)replace_duplicate - Send "yes" when you want to replace transaction data with reference (Optional)Output parametercode - Result codemsg - Result messagedata - Result infopoint - Point infonow - Remaining points
- Use customer points (JSON)https://loga.app/api/points/use_customer_pointInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)pcard_id - Plastic card ID (Required for plastic card)cuid - Customer user ID (Required for online card)point - Amount of points (Required)pp_id - Reward ID (Required if no remark)remark - Any message, visible to customer (Required if no pp_id)reference - Unique reference code to prevent request duplications. Future transcactions using the same reference code will be ignored. (Optional)branch_code - Branch code such as BKK, CMI (Optional)replace_duplicate - Send "yes" when you want to replace transaction data with reference (Optional)Output parametercode - Result codemsg - Result message
- Bulk add points (JSON)https://loga.app/api/points/bulk_add_point
Add points of a single customer in one or more transactions. Parameters for transactions need to be submitted as an array.
In case of error, the process will stop and return the record of data that causes error in the "fail_at" return value.
The already successful transactions will not be rolled back.
This function can received up to 1,000 transactions at onceInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cuid[] - Customer user ID (Required)point[] - Amount of points (Required)remark[] - Any message, visible to customer (Required)reference[] - Unique reference code to prevent request duplications. Future transcactions using the same reference code will be ignored. (Optional)branch[] - From branch (Optional)created[] - Created date (unix time) (Optional)expired[] - Expired date (unix time) (Optional)Output parametercode - Result codemsg - Result messagedata - Result infousers - Customer infocuid - Customer user IDpoint - Remaining pointstransaction - Transaction infostart - First transaction IDend - Last transaction IDfail_at - Index of data that cause error, data after this index will not proceed (For code: 503) - Bulk use points (JSON)https://loga.app/api/points/bulk_use_point
Use points of a single customer in one or more transactions. Parameters for transactions need to be submitted as an array.
In case of error, the process will stop and return the record of data that causes error in the "fail_at" return value.
The already successful transactions will not be rolled back.
This function can received up to 1,000 transactions at onceInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cuid[] - Customer user ID (Required)point[] - Amount of points (Required)remark[] - Any message, visible to customer (Required)reference[] - Unique reference code to prevent request duplications. Future transcactions using the same reference code will be ignored. (Optional)branch[] - From branch (Optional)created[] - Created date (unix time) (Optional)Output parametercode - Result codemsg - Result messagedata - Result infopoint - Point infonow - Remaining pointsfail_at - Index of data that cause error, data after this index will not proceed (For code: 503) - Create point ticket (JSON)https://loga.app/api/points/create_ticketInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)amount - Amount of points (Required)Output parametercode - Result codemsg - Result messagedata - Ticket infoserial - Point serial code
Credits
- Add customer credits (JSON)https://loga.app/api/credits/add_customer_creditsExample:Input parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)pcard_id - Plastic card ID (Required for plastic card)cuid - Customer user ID (Required for online card)cdid - Credit ID (Required)amount - Amount of credits, must not exceed 1 million (Required)remark - Any message, visible to customer (Required)Output parametercode - Result codemsg - Result messagedata - Result infocredits - Credits infocurrent - Remaining credits
- Use customer credits (JSON)https://loga.app/api/credits/use_customer_creditsExample:Input parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)pcard_id - Plastic card ID (Required for plastic card)cuid - Customer user ID (Required for online card)cdid - Credit ID (Required)amount - Amount of credits, must not exceed 1 million (Required)remark - Any message, visible to customer (Required)serial - Credit QR serial code for remote type QR (Optional)Output parametercode - Result codemsg - Result messagedata - Result infocredits - Credits infocurrent - Remaining credits
- Create credit QR (JSON)https://loga.app/api/credits/create_credit_qrInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cdid - Credit ID (Required)amount - Amount of credits, must not exceed 1 million (Required)remark - Any message, visible to customer (Required)type - QR type is static (default; stateless) or remote (just mark QR as used when customer scan, merchant need to check status by call get_credit_qr_status and deduct credits manually via use_customer_credits) (Optional)store_id - Store ID (Optional)reference1 - Reference code 1, remote type only (Optional)reference2 - Reference code 2, remote type only (Optional)Output parametercode - Result codemsg - Result messagedata - QR dataserial - Credit QR serial code, remote type only
- Get credit QR status (JSON)https://loga.app/api/credits/get_credit_qr_statusInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)serial - Credit QR serial code (Required)Output parametercode - Result codemsg - Result messagedata - Result infostatus - Status (N: New, U: Used, I: Insufficient credits)uid - User ID, exist if status is U, Ilevel - User level id, exist if status is U, Ilevel_text - User level name, exist if status is U, Iuse_date - Use date (unix time), exist if status is U, I
Coupons
- Get customer' coupon (JSON)https://loga.app/api/coupon/get_customer_couponsInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cuid - Customer user ID (Required)Output parametercode - Result codemsg - Result messagedata - Result infocoupons array - Coupons infocoupon_id - Coupon IDcoupon_name - Coupon name or descriptionnum - Number of available coupons
- Use customer' coupon (JSON)https://loga.app/api/coupon/force_use_couponInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)cuid - Customer user ID (Required)cupon_id - Coupon ID (Required)remark - Remark (Optional)Output parametercode - Result codemsg - Result messagedata - Result infofeed_id - Feed IDdetail - Coupon descriptiontransaction_id - Transaction IDtime - Use time (unixtime)
Activities
- Get activities (JSON) - 10 latest transactionshttps://loga.app/api/activities/get_activitiesInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)from - Start time (unix timestamp) (Optional)to - End time (unix timestamp) (Optional)filter - Filter = P for point, C for coupon, D for credit (Optional)Output parametercode - Result codemsg - Result messagedata - List of activitiestype - Activity typetransaction_id - Transaction IDcreated - Created date (unix time)detail - Detail
- Get activity detail (JSON)https://loga.app/api/activities/get_activity_detailInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)transaction_id - Transaction ID or reference code (point transaction only) (Required)Output parametercode - Result codemsg - Result messagedata - Activity detailfullname - Customer namecreate_by - Who initiate the transactionremark - Point/credit remarkleft - Point/credit leftsource_id - Point's reference ID, coupon ID or credit ID
Helpdesk
- Check invalid for card and helpdesk app (JSON)https://loga.app/api/helpdesk/checkinvalidappInput parametercard_id - Card ID (Required)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - "1": valid / "0": invalid
- Get Helpdesk Messages (JSON)https://loga.app/api/helpdesk/getmsgInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required for customers)board_id - Board ID (Required for merchants)user_type - Type of requested user - C: Customer, M: Merchant (Default: C) (Required for merchants)lastupdate - Unix timestamp for request new message after previous request (keep lastupdate timestamp by yourself) (Optional)from - Unix timestamp for request message after <from> (Optional)to - Unix timestamp for request message before <to> (Optional)limit - Limit number of message (Default: 10) (Optional)board_status - Filter by board status [for merchant request] (N: new/unfixed/unclosed, C: fixed/closed) (Optional)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - Array of object as follow:msg_id - Message IDboard_id - Board IDmsg - Messageimage - Image pathuid - ID of user's own messageusername - Username of user's own messageuser_type - Type of user's own message (C: Customer, M: Merchant)status - Message status (N: New, R: Read by another)timestamp - Unix timestamp when messages are postedread_timestamp - Unix timestamp when messages are read
- Post Helpdesk Message (JSON)https://loga.app/api/helpdesk/postmsgInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)board_id - Board ID or (Required for merchants)board_uid - Board UID (Required for merchants)user_type - Type of requested user - C: Customer, M: Merchant (Default: C) (Required for merchants)msg - Message (Required)image - $_FILE format (Optional)staffnote - Staff note (for merchant) (Optional)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - "Success" / "Fail"
- Remove Helpdesk Message (JSON)https://loga.app/api/helpdesk/removemsgInput parametertoken - User token (Required)uuid - Device ID (Required)msg_id - Message ID (Required)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - "Success" / "Fail"
- Get number of unread messages (JSON)https://loga.app/api/helpdesk/checknewmsgInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Optional)board_id - Board ID (Optional)mid - Merchant ID, for get number unread messages in all cards (Optional)lastupdate - Unix timestamp for check new message after previous request (keep lastupdate timestamp by yourself) (Optional)user_type - Type of requested user - C: Customer, M: Merchant (Default: C) (Optional)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - number of new messages
- Check messages are read, when users open the chat room; Return the messages that are read by another. (JSON)https://loga.app/api/helpdesk/checkreadmsgInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)user_type - Type of requested user - C: Customer, M: Merchant (Default: C) (Required for merchants)lastupdate - Unix timestamp for check message's status after previous request (keep lastupdate timestamp by yourself) (Optional)board_id - Board ID (Optional)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - Array of object as follow:msg_id - Message IDboard_id - Board IDread_timestamp - Unix timestamp when messages are read
Helpdesk (Merchant)
- Get All boards (JSON)https://loga.app/api/helpdesk/getallboardInput parametercard_id - Card ID (Required)lastupdate - Unix timestamp for request new board after previous request (keep lastupdate timestamp by yourself) (Optional)limit - Limit number of board (Default: 10) (Optional)board_status - Filter by board status [for merchant request] (N: new/unfixed/unclosed, C: fixed/closed) (Optional)search - Keyword to search helpdesk's board with <first name> <last name> / phone no. / uid / username (Optional)orderby - Sort by unread board with orderby=unread (Optional)page_handle - A page handle, returned "next_page" from a previous request (Optional)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")next_page - Query string to request next pagehas_more - Has next page (true/false)result - Array of object as follow:board_id - Board IDcard_id - Card IDstatus - Message status (N: New/Unread, R: Read by another)merchant_uid - ID of merchant user's own messagecreated - Unix timestamp when board are createdupdated - Unix timestamp when board are updatedpriority - Priorityrecent_msg - Last messagerecent_image - Last image path of messagerecent_msg_uid - ID of user's own last messagerecent_msg_status - Last message status (N: New/Unread, R: Read by another)recent_msg_username - Username of user's own last messagerecent_msg_timestamp - Unix timestamp when last message is postedcustomer_uid - ID of user's own boardcustomer_username - Username of user's own boardread_msg_status - Board status (N: New/Unread, R: Read by another)num_unread - Number of unread messages
- Mark chat room as fixed/closed (JSON)https://loga.app/api/helpdesk/updatestatusmsgInput parameterstatus - Message Status (N: Open, C: Closed) (Required)board_id - Board ID (Required)Output parameterresult_code - 200: success, others: failedmsg - Error message (return when result_code is not "200")result - "Success" / "Fail"
Post
- Post Message (JSON)https://loga.app/api/post/postmsgInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)fromdate - Post date (Optional)todate - Expired date (Optional)image - Post image (Optional)detail - Post message (Optional)Output parameterresult - "Success" / "Fail"msg - Error message (return when result is "Fail")
- Remove post (JSON)https://loga.app/api/post/removemsgInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)post_id - Post ID (Required)Output parameterresult - "Success" / "Fail"msg - Error message (return when result is "Fail")
Member
- Download members profile (CSV)https://loga.app/api/member/downloadInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)output - Output format ('csv', 'json') (Optional)date - Select only profiles which were created or last updated during the specific date (Format: DD-MM-YYYY) (Optional)Output parameterCSV File - SuccessError - Failcode - 403msg - Error message
- Download members profile (JSON)https://loga.app/api/member/downloadInput parametertoken - User token (Required)uuid - Device ID (Required)card_id - Card ID (Required)output - Output format ('csv', 'json') (Optional)date - Query member profile only from select date (Format: DD-MM-YYYY) (Optional)Output parametercode - Result codemsg - Result messagedata - List of customer profileuid - User IDusername - Usernameemail - E-mailfname - First namelname - Last nametel - Mobile numberbirthday - Birthdaygender - Genderaddress - Addressremark - Merchant remarklast_visit - Last activitysubscribed_date - Date of subscribeexpiry_date - Member expiry datestatus - Member statusreferrer_code - Referrer codelevel - Member levelplastic_no - Plastic no. of online memberbind_create_date - Bind date / create date (for P-member)start_on_line - Date of start on LINEupdate_profile_date - Date of member update profileconsent_date - Date of member consentoptional_consent - Optional consent if exists (Y: accept, N: Decline)optional_consent_date - Date of optional consent if exists