Skip to main content

Callback

Merchant Server receives payment's results from Zalopay Server, only when Zalopay has received money from user successfully

Request Body required
  • data string

    Zalopay transaction data callback to the application

    Data is Json String has field:

    app_id (int): order's app_id
    app_trans_id (string): Order's app_trans_id. Example: 180208181007242
    app_time (long): Order's app_time. Example: 1460543835849
    app_user (string): Order's app_user
    amount (long): Amount received (VND)
    embed_data (json string): Order's embed_data. Use "{}" if empty". Example: {"promotioninfo":"","merchantinfo":"du lieu rieng cua ung dung"}

    item (json array string): Order's item. Use "[]" if empty. Example: [{"itemid":"knb","itename":"kim nguyen bao","itemprice":198400,"itemquantity":1}]
    zp_trans_id (long): Zalopay's Transaction code. Example: 160413000003083
    server_time (long): Zalopay's Transaction trading time (unix timestamp in milliseconds). Example: 1460543836370
    channel (int): Payment channel. Example: 38
    merchant_user_id (string): Zalopay user, who paid for the order. Example: 7ZMSl3nEg5sOUJzOLSoUFT8xKNQVaLOLXHB--8Eytqc
    user_fee_amount (long): Fee (VND).
    discount_amount (long): Discount (VND).

    Data sample:

    {"data":"{\"app_id\":2553,\"app_trans_id\":\"200904_2553_1598435687208\",\"app_time\":1599189392817,\"app_user\":\"demo\",\"amount\":10000,\"embed_data\":\"{\\\"merchantinfo\\\":\\\"embeddata123\\\",\\\"promotioninfo\\\":\\\"\\\"}\",\"item\":\"[{\\\"itemid\\\":\\\"knb\\\",\\\"itemname\\\":\\\"kim nguyen bao\\\",\\\"itemprice\\\":198400,\\\"itemquantity\\\":1}]\",\"zp_trans_id\":200904000000389,\"server_time\":1599189413498,\"channel\":38,\"merchant_user_id\":\"7ZMSl3nEg5sOUJzOLSoUFT8xKNQVaLOLXHB--8Eytqc\",\"user_fee_amount\":0,\"discount_amount\":0}","mac":"d8d33baf449b31d7f9b94fa50d7c942c08cd4d83f28fa185557da21acb104f67","type":1}
  • mac string

    It is signature of request. It’s calculated by following input: hmacInput = (callback_data.data) and use HmacSha256 with app’s hmac key.

  • type int

    Callback type
    1: Order
    2: Agreement

Responses

OK


Schema
  • return_code int

    1: Success
    2: Zalopay ZpTransTd or AppTransTd is duplicate
    other: failure (not callback again)

  • return_message string

    Details of the status code

Loading...