Card User  
  • English
  • ภาษาไทย
username: password:
Did you forget your password ?

Longdo Cards API

Clone or download demo application

Main Function

  • Login (JSON)
    https://cards.longdo.com/api/main/login
    Input parameter
    user - Username (Required)
    pass - MD5 hash of password (Required)
    uuid - Device ID (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - Merchant info
    token - Token for use other services (along with uuid)
    mid - Your merchant ID
    name - Your name
    store_id - Your store ID
  • Logout (JSON)
    https://cards.longdo.com/api/main/logout
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    Output parameter
    code - Result code
    msg - Result message
  • Get list of cards (JSON)
    https://cards.longdo.com/api/main/get_cards
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - List of cards
    card_id - Card ID
    name - Card name
  • Get list of rewards (JSON)
    https://cards.longdo.com/api/main/get_rewards
    Input parameter
    card_id - Card ID (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - List of rewards
    reward_id - Reward ID
    name - Reward name
    point_amount - Redeem point amount in negative
    display_amount - Redeem point amount for display
    expire_date - Expired date (unix time)
  • Get customer info (JSON)
    https://cards.longdo.com/api/main/get_customer_info
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    plastic_ident - Serial, barcode or mobile number (Required for plastic card)
    username - Customer username (Required for online card)
    Output parameter
    code - Result code
    msg - Result message
    data - Customer info
    card_type - Card type (plastic/online)
    user_info - Customer info
    pcard_id - Plastic card ID, exist if card type is plastic
    uid - User ID, exist if card type is online
    fname - First name
    lname - Last name
    tel - Mobile number
    gender - Gender (M/F)
    card - Subscription info
    created - Subscribed date (unix time)
    expired - Expired date (unix time)
    point - Point info
    now - Remaining points
    credits - Credits info
    cdid - Remaining points
    credit_name - Credit name
    credit_unit - Credit unit
    current_amount - Remaining credits
    level - Current level id
    level_text - Current level name
  • Create and subscribe new plastic card (JSON)
    https://cards.longdo.com/api/main/subscribe_by_unregistered_card
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    serial - Serial (Required)
    barcode - Barcode (Required)
    mobile - Mobile number (Required)
    fname - First name (Required)
    lname - Last name (Optional)
    gender - Gender (M/F) (Optional)
    Output parameter
    code - Result code
    msg - Result message
    data - Credit info
    credit - Credit left
  • Register plastic card's NFC with barcode (JSON)
    https://cards.longdo.com/api/main/register_plastic_card
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    nfc - Serial (Required)
    barcode - Barcode (Required)
    Output parameter
    code - Result code
    msg - Result message
  • Subscribe customer to a card (JSON)
    https://cards.longdo.com/api/main/add_member
    Input parameter
    token - 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)
    Output parameter
    code - Result code
    msg - Result message
    data - Credit info
    credit - Credit left
  • Edit customer info (JSON)
    https://cards.longdo.com/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 changed


    Input parameter
    token - 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)
    Output parameter
    code - Result code
    msg - Result message
  • Bind plastic card with online card (JSON)
    https://cards.longdo.com/api/main/bind_plastic_card
    Input parameter
    token - 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 parameter
    code - Result code
    msg - Result message
  • Unbind plastic card from online card (JSON)
    https://cards.longdo.com/api/main/unbind_plastic_card
    Input parameter
    token - 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 parameter
    code - Result code
    msg - Result message
  • Create member ticket (JSON)
    https://cards.longdo.com/api/main/create_member_ticket
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    level - Subscribe to this level (Optional)
    Output parameter
    code - Result code
    msg - Result message
    data - Ticket info
    serial - Serial code

Points

  • Add customer points (JSON)
    https://cards.longdo.com/api/points/add_customer_point
    Input parameter
    token - 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)
    remark - Any message (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - Result info
    point - Point info
    now - Remaining points
  • Use customer points (JSON)
    https://cards.longdo.com/api/points/use_customer_point
    Input parameter
    token - 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 (Required if no pp_id)
    Output parameter
    code - Result code
    msg - Result message
  • Bulk add points (JSON)
    https://cards.longdo.com/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.


    Input parameter
    token - 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 (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 parameter
    code - Result code
    msg - Result message
    data - Result info
    users - Customer info
    cuid - Customer user ID
    point - Remaining points
    transaction - Transaction info
    start - First transaction ID
    end - Last transaction ID
    fail_at - Index of data that cause error, data after this index will not proceed (For code: 503)
  • Bulk use points (JSON)
    https://cards.longdo.com/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.


    Input parameter
    token - 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 (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 parameter
    code - Result code
    msg - Result message
    data - Result info
    point - Point info
    now - Remaining points
    fail_at - Index of data that cause error, data after this index will not proceed (For code: 503)
  • Create ticket (JSON)
    https://cards.longdo.com/api/points/create_ticket
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    amount - Amount of points (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - Ticket info
    serial - Serial code

Credits

  • Add customer credits (JSON)
    https://cards.longdo.com/api/credits/add_customer_credits
    Input parameter
    token - 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 (Required)
    remark - Any message (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - Result info
    credits - Credits info
    current - Remaining credits
  • Use customer credits (JSON)
    https://cards.longdo.com/api/credits/use_customer_credits
    Input parameter
    token - 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 (Required)
    remark - Any message (Required)
    Output parameter
    code - Result code
    msg - Result message
    data - Result info
    credits - Credits info
    current - Remaining credits
  • Create credit QR (JSON)
    https://cards.longdo.com/api/credits/create_credit_qr
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    cdid - Credit ID (Required)
    amount - Amount of credits (Required)
    remark - Any message (Optional)
    store_id - Store ID (Optional)
    Output parameter
    code - Result code
    msg - Result message
    data - QR data

Activities

  • Get activities (JSON)
    https://cards.longdo.com/api/activities/get_activities
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    filter - Filter (Optional)
    Output parameter
    code - Result code
    msg - Result message
    data - List of activities
    type - Activity type
    transaction_id - Transaction ID
    created - Created date (unix time)
    detail - Detail

Helpdesk

  • Check invalid for card and helpdesk app (JSON)
    https://cards.longdo.com/api/helpdesk/checkinvalidapp
    Input parameter
    card_id - Card ID (Required)
    Output parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    result - "1": valid / "0": invalid
  • Get Helpdesk Messages (JSON)
    https://cards.longdo.com/api/helpdesk/getmsg
    Input parameter
    token - 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 parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    result - Array of object as follow:
    msg_id - Message ID
    board_id - Board ID
    msg - Message
    image - Image path
    uid - ID of user's own message
    username - Username of user's own message
    user_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 posted
    read_timestamp - Unix timestamp when messages are read
  • Post Helpdesk Message (JSON)
    https://cards.longdo.com/api/helpdesk/postmsg
    Input parameter
    token - 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 parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    result - "Success" / "Fail"
  • Remove Helpdesk Message (JSON)
    https://cards.longdo.com/api/helpdesk/removemsg
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    msg_id - Message ID (Required)
    Output parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    result - "Success" / "Fail"
  • Get number of unread messages (JSON)
    https://cards.longdo.com/api/helpdesk/checknewmsg
    Input parameter
    token - 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 parameter
    result_code - 200: success, others: failed
    msg - 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://cards.longdo.com/api/helpdesk/checkreadmsg
    Input parameter
    token - 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 parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    result - Array of object as follow:
    msg_id - Message ID
    board_id - Board ID
    read_timestamp - Unix timestamp when messages are read

Helpdesk (Merchant)

  • Get All boards (JSON)
    https://cards.longdo.com/api/helpdesk/getallboard
    Input parameter
    card_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 parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    next_page - Query string to request next page
    has_more - Has next page (true/false)
    result - Array of object as follow:
    board_id - Board ID
    card_id - Card ID
    status - Message status (N: New/Unread, R: Read by another)
    merchant_uid - ID of merchant user's own message
    created - Unix timestamp when board are created
    updated - Unix timestamp when board are updated
    priority - Priority
    recent_msg - Last message
    recent_image - Last image path of message
    recent_msg_uid - ID of user's own last message
    recent_msg_status - Last message status (N: New/Unread, R: Read by another)
    recent_msg_username - Username of user's own last message
    recent_msg_timestamp - Unix timestamp when last message is posted
    customer_uid - ID of user's own board
    customer_username - Username of user's own board
    read_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://cards.longdo.com/api/helpdesk/updatestatusmsg
    Input parameter
    status - Message Status (N: Open, C: Closed) (Required)
    board_id - Board ID (Required)
    Output parameter
    result_code - 200: success, others: failed
    msg - Error message (return when result_code is not "200")
    result - "Success" / "Fail"

Post

  • Post Message (JSON)
    https://cards.longdo.com/api/post/postmsg
    Input parameter
    token - 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 parameter
    result - "Success" / "Fail"
    msg - Error message (return when result is "Fail")
  • Remove post (JSON)
    https://cards.longdo.com/api/post/removemsg
    Input parameter
    token - User token (Required)
    uuid - Device ID (Required)
    card_id - Card ID (Required)
    post_id - Post ID (Required)
    Output parameter
    result - "Success" / "Fail"
    msg - Error message (return when result is "Fail")
ร้านค้าสนใจใช้บริการ?
อีเมล marketing@longdo.com ไลน์: @longdocards โทร 02 108 1790