Tarspay
    Tarspay
    • Indonesia🇮🇩
    • Vietnam🇻🇳
    • India🇮🇳
    • Malaysia🇲🇾
    • Egypt🇪🇬
    • Thailand🇹🇭
    • Philippines🇵🇭
    • Brazil🇧🇷
    • Mexican🇲🇽
    • Kenya🇰🇪
    • Bengal🇧🇩
    • Pakistan🇵🇰

    Indonesia🇮🇩

    Interface Description#

    This article is intended for: technical architects, R&D engineers, and system operation and maintenance engineers who use the TarsPay merchant self-service system. Through this document, merchants can understand the technology connected to TarsPay, the products and businesses connected, the access process, access specifications and other information, so that merchants can successfully complete the access work.

    Access flow chart#

    privateKey (private key): The merchant keeps it by himself and does not disclose it. The merchant uses this private key to sign the order information when placing an order on behalf of the merchant.
    publicKey (public key): The merchant needs to upload the key to our platform (merchant backend-account management-apiKey menu), and when you call our interface, you need to include the request header X-API-KEY carries your public key, and we use this public key to verify that the message is signed by your private key.
    System publicKey: We will inform you to use the transaction status verification. When we send the callback transaction status notification, we will carry the signature information X-RESP-SIGNATURE in the request header. You can use it. The system publicKey verification message is sent by us.

    common problem#

    1.
    The interface returns error description "You have not bound or opened the API Key. Please verify whether the publicKey is consistent with the calling environment, and whether X-API-KEY has passed in the correct public key."
    2.
    The interface returns the error description "sign error". Please verify whether the public and private keys are a pair and whether there is any problem with the signature algorithm. Currently, the Java version signature verification tool class is provided at the bottom of the document.
    3.
    The interface returns the error description "MERCHANT_FEE_CONFIG_NOT_INIT", please contact our operation configuration.

    Signature algorithm#

    TarsPay uses [ECDSA signature tool class](#signature tool class) signature for verification. After you open an account in TarsPay, you can generate a public and private key pair locally, or you can generate your public and private key through the TarsPay Web management interface. If you have any questions, you can also contact our staff to assist you. You can enter your public key through the TarsPay web management interface. Please keep your private key properly and do not disclose it to anyone to avoid asset loss! TarsPay strongly recommends that you bind your IP address to the whitelist.
    TarsPay's API requests, except for public APIs, need to carry API key and signature.
    The data prepared before signing is as follows:
    HTTP_METHOD + | + HTTP_REQUEST_PATH + | + TIMESTAMP + | + PARAMS
    After the connection is completed, the data is ECDSA signed, and the signed bytes are Hex encoded.

    HTTP_HOST#

    Prod: https://payment.tarspay.com

    HTTP_METHOD#

    GET, POST need to be capitalized

    HTTP_REQUEST_PATH#

    The PATH part of the request URL, for example: https://payment.tarspay.com/api/v1/test is /api/v1/test

    NONCE#

    UNIX EPOCH timestamp (accurate to milliseconds) when accessing the API

    PARAMS#

    First sort the keys alphabetically, and then parameterize the url, that is, password=password username=username. Because p is sorted before u in the alphabet, password must be placed before username, and then use & to connect, that is: password =password&username=username The request parameters are the same for POST and GET. All parameters need to be taken out. The signature rules are as follows: All requested keys are sorted in alphabetical order, and then spliced in the form of key=value (the value does not require urlencode), and Use & to connect.

    Complete example#

    For the following requests:
    MethodURLNonce
    POSThttps://payment.tasrspay.com/api/v1/test1537498830736
    parameter
    Parametervalue
    amount100
    price100
    The preparation data before signing is as follows:
    1.
    Assume that all data sent or received is a set M, and the parameters with non-empty parameter values in the set M are sorted from small to large according to the ASCII code of the parameter name (lexicographic order), using the format of URL key-value pairs (i.e. key1=value1&key2 =value2...) concatenated into a string:
    Tip: content does not require URLEncode
    2.
    Splice the concatenated string content and method request information MERTHOD, URL and NONCE into a new string separated by "|":
    3.
    Use the private key you generated (PrivateKey) to perform ECDSA signature on the spliced data, and Hex encode the binary result to generate the final signature for verification to the API server.
    Put the Api key, nonce and signature generated on the right into the Header according to the above name, and you can pass the signature verification.
    The TarsPay signature verification public key can be obtained from the "Web Management Interface - Account Management - apikey" page

    Return description#

    Return results
    NameTypeDescription
    codeintegerResponse code 0 indicates success, otherwise failure
    dataobjectresponse data
    msgstringResponse message
    Return to example
    {
        "code": 0,
        "data": {},
        "msg": "SUCCESS"
    }

    Collection#

    Collection type#

    EncodingDescription
    bankbank VA
    marketmarket VA
    ewalletewallet
    qrisScan Code

    Payment method code#

    Internet banking type coding#

    Bank codeBank name
    BANK_BCABANK BCA
    BANK_BNIBANK BNI
    BANK_BRIBANK BRI
    BANK_BSSBANK BSS
    BANK_CIMBBANK CIMB
    BANK_MANDIRIBANK MANDIRI
    BANK_MAYBANK MAY
    BANK_PERMATABANK PERMATA

    Electronic wallet (ewallet) type encoding#

    E-wallet codeE-wallet name
    EWALLET_DANAEWALLET DANA
    EWALLET_GOPAYEWALLET GOPAY
    EWALLET_LINKAJAEWALLET LINKAJA
    EWALLET_OVOEWALLET OVO
    EWALLET_SHOPEEPAYEWALLET SHOPEEPAY

    Scan code (qr) type encoding#

    Scan codeScan code name
    QRISQRIS

    mart type code#

    Recharge card codeRecharge card name
    MART_ALFAMART ALFA
    MART_INDOMART INDO

    POST collection and unified order placement#

    POST HTTP_HOST/api/pay/unifiedOrder
    Body request parameters
    {
      "amount": "100",
      "body": "test",
      "currency": "IDR",
      "customerAccountNumber": "123456789",
      "customerContact": "15221111111",
      "customerEmail": "xxxx@gmail.com",
      "customerName": "xxxx",
      "mchNo": "80002",
      "mchOrderNo": "M202207131958",
      "notifyUrl": "https://www.yourcompany.com/notify",
      "returnUrl": "https://www.yourcompany.com/return",
      "subject": "test",
      "wayCode": "BANK_BCA"
    }

    Request parameters#

    NameLocationTypeRequiredDescription
    X-API-KEYheaderstringYpublic key
    X-API-NONCEheaderstringYRequest time (timestamp, accurate to milliseconds)
    X-API-SIGNATUREheaderstringYsignature (refer to signature algorithm)
    mchNobodystringYmerchant number
    mchOrderNobodystringYmerchant order number (customized by merchant, cannot be repeated)
    wayCodebodystringYPayment method code
    - Cashier: CASHIER (use the cashier of this system)
    - Non-cashier: refer to [Payment method code] (#Payment method code) (The merchant maintains the checkout counter himself)
    amountbodystringYthe amount (no decimals. It cannot be zero and must meet the amount standard.)
    bodybodystringYproduct Description Information
    currencybodystringYcurrency(IDR)
    notifyUrlbodystringYnotification address
    returnUrlbodystringYreturn address
    customerNamebodystringNusername
    customerEmailbodystringNuser Email
    customerContactbodystringNuser phone
    customerAccountNumberbodystringNuser account number
    Return to example
    {
      "code": 0,
      "data": {
        "amount": "5000",
        "body": "test",
        "countryCode": "id",
        "currency": "IDR",
        "customerContact": "15221113201",
        "mchOrderNo": "202207161603q01",
        "orderState": 0,
        "payOrderId": "P1551396771600912385",
        "payUrl": "https://test.tarspay.com/tarspayToC/#/order/id/P1551396771600912385",
        "payWays": {
          "bank": [
            {
              "countryCode": "id",
              "payWay": "BANK_PERMATA",
              "payWayLogo": "https://tarspay.oss-ap-southeast-1.aliyuncs.com/tarspay_v_1.0/PERMATA.png",
              "payWayType": "bank"
            }
          ]
        },
        "subject": "test"
      },
      "msg": "SUCCESS",
      "sign": "3045022100f32d38d4457295f0ce70376845458ec55a9fad34cce39ae11cd0cdbadd90639e02207d23e33f9b95944fb32923707c30b913063b082995b7e5fb9d8d2369f1ab4e53"
    }

    Return results#

    NameTypeDescription
    amountstringBill amount
    countryCodestringCountry code
    currencystringcurrency number
    customerContactstringUser contact information
    mchOrderNostringMerchant order number
    orderStateintegerOrder status 0: order generated, 1: payment in progress, 2: payment successful, 3: payment failed, 6: timeout cancellation, 9: partial payment
    payOrderIdstringPayment order number
    accountNamestringUser name, non-cashier mode, only returned when the payment method is online banking, e-wallet and scan code
    typeBankstringBank name, non-cashier mode, only returned when the payment method is online banking and scanning QR code
    accountNumberstringUser name, non-cashier mode, only returned when the payment method is online banking, scan code and electronic wallet
    payUrlstring-When in cashier mode, return the cashier address;
    -When in non-cashier mode, return the transfer required content
    payDatastringQR code (returned only when not at the cashier, only returned when the payment method is scan code and electronic wallet)
    payWaysarrayPayment methods
    payment method:
    NameTypeDescription
    countryCodestringCountry code
    payWaystringPayment method code (refer to [Payment method code](#Payment method code))
    payWayLogostringPayment method logo
    payWayTypestringPayment method type (refer to [Collection Type](#Collection Type))
    payCodestringQR code/QR code image (returned only when not at the cashier). When the payment type is qr, the QR code image link is returned. When the payment type is ewallet, the QR code data is returned. )
    #Pay on behalf of

    Payment code#

    Payment bank code#

    Bank & e-wallet codeBank & e-wallet name
    BANK_ABN_AMROBANK ABN AMRO
    BANK_ACEHBANK ACEH
    BANK_ACEH_SYARIAHBANK ACEH SYARIAH
    BANK_AGRISBANK AGRIS
    BANK_ALADIN_SYARIAHBANK ALADIN SYARIAH
    BANK_ALADIN_SYARIAH_TBKBANK ALADIN SYARIAH TBK
    BANK_ALLO_INDONESIABANK ALLO INDONESIA
    BANK_AMAR_INDONESIABANK AMAR INDONESIA
    BANK_ANDARABANK ANDARA
    BANK_ANGLOMAS_INTERNATIONALBANK ANGLOMAS INTERNATIONAL
    BANK_ANTAR_DAERAHBANK ANTAR DAERAH
    BANK_ANZ_INDONESIABANK ANZ INDONESIA
    BANK_ARTHA_GRAHABANK ARTHA GRAHA
    BANK_ARTOS_INDONESIABANK ARTOS INDONESIA
    BANK_BANGKOKBANK BANGKOK
    BANK_BANK_BPD_SUMBAR_SYARIAHBANK BANK BPD SUMBAR SYARIAH
    BANK_BCABANK BCA
    BANK_BCA_SYARIAHBANK BCA SYARIAH
    BANK_BISNIS_INTERNASIONALBANK BISNIS INTERNASIONAL
    BANK_BLUBANK BLU
    BANK_BNIBANK BNI
    BANK_BNI_SYARIAHBANK BNI SYARIAH
    BANK_BNP_PARIBAS_INDONESIABANK BNP PARIBAS INDONESIA
    BANK_BPD_BALIBANK BPD BALI
    BANK_BPD_BANTENBANK BPD BANTEN
    BANK_BPD_BENGKULUBANK BPD BENGKULU
    BANK_BPD_JAMBIBANK BPD JAMBI
    BANK_BPD_JATENGBANK BPD JATENG
    BANK_BPD_JATENG_SYARIAHBANK BPD JATENG SYARIAH
    BANK_BPD_JATENG_UUSBANK BPD JATENG UUS
    BANK_BPD_JAWA_TENGAHBANK BPD JAWA TENGAH
    BANK_BPD_KALBARBANK BPD KALBAR
    BANK_BPD_KALBAR_SYARIAHBANK BPD KALBAR SYARIAH
    BANK_BPD_KALSELBANK BPD KALSEL
    BANK_BPD_KALSEL_SYARIAHBANK BPD KALSEL SYARIAH
    BANK_BPD_KALTENGBANK BPD KALTENG
    BANK_BPD_KALTIMBANK BPD KALTIM
    BANK_BPD_KALTIMTARABANK BPD KALTIMTARA
    BANK_BPD_KALTIMTARA_SYARIAHBANK BPD KALTIMTARA SYARIAH
    BANK_BPD_KALTIM_SYARIAHBANK BPD KALTIM SYARIAH
    BANK_BPD_LAMPUNGBANK BPD LAMPUNG
    BANK_BPD_MALUKUBANK BPD MALUKU
    BANK_BPD_MALUKU_DAN_MALUKU_UTARABANK BPD MALUKU DAN MALUKU UTARA
    BANK_BPD_NTBBANK BPD NTB
    BANK_BPD_NTB_SYARIAHBANK BPD NTB SYARIAH
    BANK_BPD_NTTBANK BPD NTT
    BANK_BPD_PAPUABANK BPD PAPUA
    BANK_BPD_RIAU_KEPRIBANK BPD RIAU KEPRI
    BANK_BPD_SULAWESI_TENGAHBANK BPD SULAWESI TENGAH
    BANK_BPD_SULAWESI_TENGGARABANK BPD SULAWESI TENGGARA
    BANK_BPD_SULAWESI_UTARABANK BPD SULAWESI UTARA
    BANK_BPD_SUMATERA_BARATBANK BPD SUMATERA BARAT
    BANK_BPD_SUMATERA_BARAT_SYARIAHBANK BPD SUMATERA BARAT SYARIAH
    BANK_BPD_SUMATERA_SELATAN_BABELBANK BPD SUMATERA SELATAN BABEL
    BANK_BPD_SUMATERA_SELATAN_SYARIAHBANK BPD SUMATERA SELATAN SYARIAH
    BANK_BPD_SUMATERA_UTARABANK BPD SUMATERA UTARA
    BANK_BPD_SUMBARBANK BPD SUMBAR
    BANK_BPD_SUMSEL_BABELBANK BPD SUMSEL BABEL
    BANK_BPD_SUMSEL_BABEL_SYARIAHBANK BPD SUMSEL BABEL SYARIAH
    BANK_BPD_SUMUTBANK BPD SUMUT
    BANK_BPD_SUMUT_SYARIAHBANK BPD SUMUT SYARIAH
    BANK_BPD_SUMUT_UNIT_SYARIAHBANK BPD SUMUT UNIT SYARIAH
    BANK_BPD_YOGYAKARTABANK BPD YOGYAKARTA
    BANK_BPD_YOGYAKARTA_SYARIAHBANK BPD YOGYAKARTA SYARIAH
    BANK_BPR_KARYAJATNIKA_SADAYABANK BPR KARYAJATNIKA SADAYA
    BANK_BPR_SUPRA_ARTAPERSADABANK BPR SUPRA ARTAPERSADA
    BANK_BRIBANK BRI
    BANK_BRI_AGRONIAGABANK BRI AGRONIAGA
    BANK_BTNBANK BTN
    BANK_BTN_SYARIAHBANK BTN SYARIAH
    BANK_BTPNBANK BTPN
    BANK_BTPN_SYARIAHBANK BTPN SYARIAH
    BANK_BUKOPINBANK BUKOPIN
    BANK_BUMI_ARTABANK BUMI ARTA
    BANK_BUMI_ARTA_INDONESIABANK BUMI ARTA INDONESIA
    BANK_CAPITAL_INDONESIABANK CAPITAL INDONESIA
    BANK_CENTRATAMABANK CENTRATAMA
    BANK_CHINA_CONSTRUCTION_INDONESIABANK CHINA CONSTRUCTION INDONESIA
    BANK_CIMBBANK CIMB
    BANK_CIMB_NIAGABANK CIMB NIAGA
    BANK_CIMB_NIAGA_SYARIAHBANK CIMB NIAGA SYARIAH
    BANK_CIMB_SYARIAHBANK CIMB SYARIAH
    BANK_CITIBANKBANK CITIBANK
    BANK_COMMONWEALTHBANK COMMONWEALTH
    BANK_COMMONWEALTH_BANKBANK COMMONWEALTH BANK
    BANK_CTBC_INDONESIABANK CTBC INDONESIA
    BANK_DANAMONBANK DANAMON
    BANK_DANAMON_SYARIAHBANK DANAMON SYARIAH
    BANK_DBS_INDONESIABANK DBS INDONESIA
    BANK_DEUTSCHE_AGBANK DEUTSCHE AG
    BANK_DIGITAL_BCABANK DIGITAL BCA
    BANK_DINARBANK DINAR
    BANK_DKIBANK DKI
    BANK_DKI_SYARIAHBANK DKI SYARIAH
    BANK_FAMABANK FAMA
    BANK_FAMA_INTERNASIONALBANK FAMA INTERNASIONAL
    BANK_GANESHABANK GANESHA
    BANK_HARDA_INTERNASIONALBANK HARDA INTERNASIONAL
    BANK_HARMONI_INTERNATIONALBANK HARMONI INTERNATIONAL
    BANK_HSBC_INDONESIABANK HSBC INDONESIA
    BANK_HSBC_SYARIAHBANK HSBC SYARIAH
    BANK_IBKBANK IBK
    BANK_IBK_INDONESIA_TBKBANK IBK INDONESIA TBK
    BANK_ICBC_INDONESIABANK ICBC INDONESIA
    BANK_INA_PERDANABANK INA PERDANA
    BANK_INDEX_SELINDOBANK INDEX SELINDO
    BANK_INTERIM_INDONESIABANK INTERIM INDONESIA
    BANK_JABARBANK JABAR
    BANK_JABAR_BANTEN_(BJB)BANK JABAR BANTEN (BJB)
    BANK_JABAR_BANTEN_SYARIAH_(BJB_SYARIAH)BANK JABAR BANTEN SYARIAH (BJB SYARIAH)
    BANK_JABAR_SYARIAHBANK JABAR SYARIAH
    BANK_JAGO_TBKBANK JAGO TBK
    BANK_JASA_JAKARTABANK JASA JAKARTA
    BANK_JATIMBANK JATIM
    BANK_JATIM_SYARIAHBANK JATIM SYARIAH
    BANK_JPMORGAN_CHASEBANK JPMORGAN CHASE
    BANK_JP_MORGANBANK JP MORGAN
    BANK_JP_MORGAN_CHASEBANK JP MORGAN CHASE
    BANK_JTRUST_INDONESIABANK JTRUST INDONESIA
    BANK_KB_BUKOPINBANK KB BUKOPIN
    BANK_KEB_HANABANK KEB HANA
    BANK_KESEJAHTERAANBANK KESEJAHTERAAN
    BANK_MANDIRIBANK MANDIRI
    BANK_MANDIRI_TASPENBANK MANDIRI TASPEN
    BANK_MASPIONBANK MASPION
    BANK_MASPION_INDONESIABANK MASPION INDONESIA
    BANK_MAYAPADABANK MAYAPADA
    BANK_MAYBANKBANK MAYBANK
    BANK_MAYBANK_INDONESIABANK MAYBANK INDONESIA
    BANK_MAYBANK_INDONESIA_SYARIAHBANK MAYBANK INDONESIA SYARIAH
    BANK_MAYBANK_INDONESIA_UUSBANK MAYBANK INDONESIA UUS
    BANK_MAYBANK_SYARIAHBANK MAYBANK SYARIAH
    BANK_MAYBANK_SYARIAH_INDONESIABANK MAYBANK SYARIAH INDONESIA
    BANK_MAYORABANK MAYORA
    BANK_MEGABANK MEGA
    BANK_MEGA_SYARIAHBANK MEGA SYARIAH
    BANK_MEGA_TBKBANK MEGA TBK
    BANK_MESTIKA_DHARMABANK MESTIKA DHARMA
    BANK_MITRANIAGABANK MITRANIAGA
    BANK_MIZUHO_INDONESIABANK MIZUHO INDONESIA
    BANK_MNC_INTERNATIONALBANK MNC INTERNATIONAL
    BANK_MUAMALATBANK MUAMALAT
    BANK_MUFG_LTDBANK MUFG LTD
    BANK_MULTI_ARTA_SENTOSABANK MULTI ARTA SENTOSA
    BANK_NAGARIBANK NAGARI
    BANK_NEO_COMMERCEBANK NEO COMMERCE
    BANK_NOBU_NATIONALBANK NOBU NATIONAL
    BANK_NTB_SYARIAHBANK NTB SYARIAH
    BANK_NUSANTARABANK NUSANTARA
    BANK_OCBC_NISPBANK OCBC NISP
    BANK_OCBC_NISP_SYARIAHBANK OCBC NISP SYARIAH
    BANK_OF_AMERICABANK OF AMERICA
    BANK_OF_CHINABANK OF CHINA
    BANK_OF_INDIA_INDONESIABANK OF INDIA INDONESIA
    BANK_OKE_INDONESIABANK OKE INDONESIA
    BANK_PANINBANK PANIN
    BANK_PANIN_DUBAI_SYARIAHBANK PANIN DUBAI SYARIAH
    BANK_PANIN_SYARIAHBANK PANIN SYARIAH
    BANK_PAN_INDONESIA_/PANINBANK PAN INDONESIA /PANIN
    BANK_PEMBANGUNAN_DAERAH_SULAWESI_SELATANBANK PEMBANGUNAN DAERAH SULAWESI SELATAN
    BANK_PERMATABANK PERMATA
    BANK_PERMATA_SYARIAHBANK PERMATA SYARIAH
    BANK_PIKKOBANK PIKKO
    BANK_PRIMA_MASTERBANK PRIMA MASTER
    BANK_QNB_INDONESIABANK QNB INDONESIA
    BANK_RABOBANK RABO
    BANK_RAKYAT_INDONESIA_AGRONIAGABANK RAKYAT INDONESIA AGRONIAGA
    BANK_RESONA_PERDANIABANK RESONA PERDANIA
    BANK_RESONA_PERDANIA_BANKBANK RESONA PERDANIA BANK
    BANK_ROYAL_INDONESIABANK ROYAL INDONESIA
    BANK_SAHABAT_SAMPOERNABANK SAHABAT SAMPOERNA
    BANK_SBI_INDONESIABANK SBI INDONESIA
    BANK_SEABANK SEA
    BANK_SEABANK_INDONESIABANK SEABANK INDONESIA
    BANK_SHINHAN_INDONESIABANK SHINHAN INDONESIA
    BANK_SINARMASBANK SINARMAS
    BANK_SINARMAS_SYARIAHBANK SINARMAS SYARIAH
    BANK_STANDARD_CHARTEREDBANK STANDARD CHARTERED
    BANK_SULSELBARBANK SULSELBAR
    BANK_SULSELBAR_SYARIAHBANK SULSELBAR SYARIAH
    BANK_SUMITOMO_MITSUIBANK SUMITOMO MITSUI
    BANK_SYARIAH_BRIBANK SYARIAH BRI
    BANK_SYARIAH_BUKOPINBANK SYARIAH BUKOPIN
    BANK_SYARIAH_INDONESIABANK SYARIAH INDONESIA
    BANK_SYARIAH_INDONESIA_(BSI)BANK SYARIAH INDONESIA (BSI)
    BANK_SYARIAH_MANDIRIBANK SYARIAH MANDIRI
    BANK_TOKYO_MITSUBISHI_UFJBANK TOKYO MITSUBISHI UFJ
    BANK_UOBBANK UOB
    BANK_UOB_INDONESIABANK UOB INDONESIA
    BANK_VICTORIA_INTERNATIONALBANK VICTORIA INTERNATIONAL
    BANK_VICTORIA_SYARIAHBANK VICTORIA SYARIAH
    BANK_WOORI_SAUDARA_INDONESIABANK WOORI SAUDARA INDONESIA
    BANK_WOORI_SAUDARA_INDONESIA_1906BANK WOORI SAUDARA INDONESIA 1906
    BANK_YUDHA_BAKTIBANK YUDHA BAKTI
    BANK_YUDHA_BAKTI_(BANK_NEO_COMMERCE)BANK YUDHA BAKTI (BANK NEO COMMERCE)

    POST payment for unified order placement#

    POST HTTP_HOST/api/payOut/unifiedOrder
    Body request parameters
    {
      "address": "Mumbai",
      "amount": "40",
      "customerAccountNumber": "922010002523675",
      "customerContact": "15221113201",
      "customerEmail": "xxxx@gmail.com",
      "customerName": "xxxx",
      "mchNo": "80001",
      "mchOrderNo": "2022071201011",
      "notifyUrl": "http://www.yourcompany.com/notify",
      "wayCode": "BANK_BCA"
    }

    Request parameters#

    NameLocationTypeRequiredDescription
    X-API-KEYheaderstringYpublic key
    X-API-NONCEheaderstringYrequest time (timestamp, accurate to milliseconds)
    X-API-SIGNATUREheaderstringYsignature (refer to signature algorithm)
    mchNobodystringYmerchant number
    mchOrderNobodystringYmerchant order number (customized by merchant, cannot be repeated)
    wayCodebodystringYpayment code (refer to [payment code](#payment code))
    amountbodystringYthe amount (no decimals. It cannot be zero and must meet the amount standard.)
    currencybodystringYcurrency(IDR)
    notifyUrlbodystringYnotification address
    customerNamebodystringYusername
    customerContactbodystringYmobile phone number
    customerAccountNumberbodystringYuser accountNumber
    customerEmailbodystringYuser email
    {
      "code": 0,
      "data": {
        "mchOrderNo": "M1655535407",
        "payOrderId": "P1551409540398772225"
      },
      "msg": "SUCCESS",
      "sign": "3045022100c3998421fd646521777d0c736753704931f801331dec55f109258dd8a93083c402207c11e37d70477b30ad9e0c42072a3fb5af1a78809ca7f 8023672451e62e8f69f"
    }

    Return results#

    Note: When the code return is not 0, the data returned is null.
    NameTypeDescription
    mchOrderNostringMerchant order number (returned after successful request)
    payOrderIdstringPlatform order number (returned after successful request)

    Collection order inquiry#

    POST to obtain collection order information#

    POST HTTP_HOST/api/payInInfo
    Body request parameters
    {
        "mchNo": "M1655535407",
        "mchOrderNo": "lin1231241241414"
    }

    Request parameters#

    NameLocationTypeRequiredDescription
    X-API-KEYheaderstringYpublic key
    X-API-NONCEheaderstringYRequest time (timestamp, accurate to milliseconds)
    X-API-SIGNATUREheaderstringYsignature (refer to signature algorithm)
    mchNobodystringYmerchant number
    payOrderIdbodystringNPlatform order number (choose one of platform order number and merchant order number)
    mchOrderNobodystringNMerchant order number (choose one of platform order number and merchant order number)
    Return to example
    {
      "code": 0,
      "data": {
        "currency": "IDR",
        "fee": "0",
        "mchNo": "M1655535407",
        "mchOrderNo": "",
        "orderAmount": "10000",
        "payAmount": "10000",
        "payOrderId": "P1547429458697129178",
        "state": 2
      },
      "msg": "SUCCESS"
    }

    Return results#

    NameTypeDescription
    payOrderIdstringPayment order number
    mchNostringMerchant number
    mchOrderNostringMerchant order number
    orderAmountstringoriginal transaction amount of bill
    payAmountstringPayment amount
    currencystringthree-digit currency code
    statestringPayment status: 0-Order generated, 1-Payment in progress, 2-Payment successful, 3-Payment failed, 4-Cancelled, 5-Refunded, 6-Order closed, 7-Queue, 8 -We reject, 9-Partial payment
    feestringMerchant fee

    Payment order inquiry#

    POST Get payment order information#

    POST HTTP_HOST/api/payOutInfo
    Body request parameters
    {
          "mchNo": "M1655535407",
          "mchOrderNo": "lin1231241241414"
    }

    Request parameters#

    NameLocationTypeRequiredDescription
    X-API-KEYheaderstringYpublic key
    X-API-NONCEheaderstringYRequest time (timestamp, accurate to milliseconds)
    X-API-SIGNATUREheaderstringYsignature (refer to signature algorithm)
    mchNobodystringYmerchant number
    payOrderIdbodystringNPlatform order number (choose one of platform order number and merchant order number)
    mchOrderNobodystringNMerchant order number (choose one of platform order number and merchant order number)
    Return to example
    {
      "code": 0,
      "data": {
        "currency": "IDR",
        "fee": "0",
        "mchNo": "M1655535407",
        "mchOrderNo": "",
        "orderAmount": "10000",
        "payAmount": "10000",
        "payOrderId": "P1547429458697138178",
        "state": 2
      },
      "msg": "SUCCESS"
    }

    Return results#

    NameTypeDescription
    payOrderIdstringPayment order number
    mchNostringMerchant number
    mchOrderNostringMerchant order number
    orderAmountstringoriginal transaction amount of bill
    payAmountstringPayment amount
    currencystringthree-digit currency code
    statestringPayment status: 0-order generated, 1-payment in progress, 2-payment successful, 3-payment failed, 8-rejected
    feestringMerchant fee

    Transaction history#

    POST Get transaction history (final data-success/failure)#

    POST HTTP_HOST/api/transInfo
    Body request parameters
    {
      "mchNo": "M1658240182",
      "bizType": 1,
      "startTime": 1656604800,
      "endTime": 1667145600,
      "pageNumber": 1,
      "pageSize": 20
    }

    Request parameters#

    NameLocationTypeRequiredDescription
    X-API-KEYheaderstringYpublic key
    X-API-NONCEheaderstringYRequest time (timestamp, accurate to milliseconds)
    X-API-SIGNATUREheaderstringYsignature (refer to signature algorithm)
    mchNobodystringYmerchant number
    bizTypebodynumberNBusiness type: 1-Collection on behalf of others 2-Payment on behalf of others 3-USDT withdrawal 4-Withdrawal
    startTimebodynumberNStart time (server 0 time zone timestamp, accurate to seconds)
    endTimebodynumberNEnd time (server 0 time zone timestamp, accurate to seconds)
    pageNumberbodynumberYpage number
    pageSizebodynumberYpage size (max 50)
    Return to example
    {
      "code": 0,
      "data": {
        "current": 1,
        "hitCount": false,
        "optimizeCountSql": true,
        "orders": [
          
        ],
        "pages": 22,
        "records": [
          {
            "amount": "190000",
            "bankCard": "123456789",
            "bankName": "",
            "bizType": 1,
            "createdAt": 1683945480,
            "currency": "IDR",
            "mchFeeAmount": "10000",
            "mchName": "DW-IDR Test",
            "mchNo": "M1683793693",
            "mchOrderNo": "id95220230300258",
            "mobilePhone": "17760797979",
            "orderAmount": "200000",
            "payOrderId": "P1657213573143552002",
            "payWay": "qris",
            "payWayType": "qris",
            "payerName": "DW",
            "state": 2,
            "successTime": 1683945670
          },
          {
            "amount": "190000",
            "bankCard": "123456789",
            "bankName": "",
            "bizType": 1,
            "createdAt": 1683948198,
            "currency": "IDR",
            "mchFeeAmount": "10000",
            "mchName": "DW-IDR Test",
            "mchNo": "M1683793693",
            "mchOrderNo": "IDR48220230300454",
            "mobilePhone": "17760797979",
            "orderAmount": "200000",
            "payOrderId": "P1657224974603972609",
            "payWay": "ewallet",
            "payWayType": "ewallet",
            "payerName": "DW",
            "state": 2,
            "successTime": 1683949857
          }
        ],
        "searchCount": true,
        "size": 3,
        "total": 66
      },
      "msg": "SUCCESS",
      "sign": "3046022100d4670c5466807b6b62635030e5c10acd2855e3428b4e9ff45e5c9648d4d28288022100a3cca3d4bbc6d994e66ada5e1d0fb095fabc4a92d622 a2074a1b10fc4c530830"
    }

    Return results#

    NameTypeDescription
    amountstringSettlement quantity (when collection is made, it is the upper-point quantity (handling fee is deducted), when payment/withdrawal is made, it is the bill quantity (handling fee is not deducted))
    bankCardstringBank card number
    bankNamestringBank name
    bizTypenumberBusiness type: 1-Collection on behalf of others 2-Payment on behalf of others 3-USDT withdrawal 4-Withdrawal
    createdAtnumberOrder creation time (0 time zone timestamp, accurate to seconds)
    currencystringCurrency
    mchFeeAmountstringhandling fee
    mchNamestringMerchant name
    mchNostringMerchant number
    mchOrderNostringMerchant order number
    mobilePhonestringMobile phone number
    orderAmountstringOrder amount
    payOrderIdstringPayment serial number
    payWaystringPayment method name
    payWayTypestringPayment method
    payerNamestringUser name
    statenumberOrder status: 2-successful 3-failed 8-(payment) rejected 9-partial payment (payment amount is less than the order amount)
    successTimenumberis

    MERCHANT BALANCE INFOMATION QUERY#

    POST to obtain merchant balance information#

    POST HTTP_HOST/api/balanceInfo
    Body request parameters
    {
        "mchNo": "M1655535407"
    }

    Request parameters#

    NameLocationTypeRequiredDescription
    X-API-KEYheaderstringYpublic key
    X-API-NONCEheaderstringYRequest time (timestamp, accurate to milliseconds)
    X-API-SIGNATUREheaderstringYsignature (refer to signature algorithm)
    mchNobodystringYmerchant number
    Return to example
    {
      "code": 0,
      "data": {
        "availableAmount": "294876",
        "frozenAmount": "1986",
        "mchNo": "M1658240182"
      },
      "msg": "SUCCESS",
      "sign": "3045022100e659480ea76d87c26e0054bda5a788737d41f26d4dec365fba936028248785140220540c9bb2b9fe6fc928dc2ae4c531ee00a82615bc37b77b02 ca41cffeeaddc627"
    }

    Return results#

    NameTypeDescription
    availableAmountstringAvailable balance
    frozenAmountstringfrozen balance
    mchNostringMerchant number

    Callback notification#

    Submission method: POST#

    When receiving point-to-point communication from the server, the interface returns "OK" (without double quotes, OK is in capital letters), otherwise point-to-point notifications will be sent repeatedly (default 16 times).
    OK

    Content-Type#

    application/json

    Verify signature#

    Use the TarsPay public key to verify the signature of [return data](#return description).

    Request parameters#

    NameTypeRequiredDescription
    bizTypenumberYBusiness type: 1-Collection 2-Payment
    payOrderIdstringYpayment order number
    mchNostringYmerchant number
    mchOrderNostringYMerchant order number (customized by merchant, cannot be repeated)
    orderAmountstringYoriginal transaction amount of bill
    payAmountstringYpayment amount
    currencystringYthree-digit currency code
    statenumberYpayment status: 2-payment successful, 3-payment failed, 9-partial payment (collection)
    feestringYmerchant fee
    failReasonstringNFailure reason
    Callback signature verification description: X-RESP-SIGNATURE request header carries signature
    Signature rules: After JSONizing the request parameters, put the obtained signature in the header, and obtain the signature directly from the response header. To verify the signature, use verifyEcdsaSignature() in the ECSDAKit tool class below.
    Example:
    OrderNotifyDTO.class

    Signature tool class#

    Maven dependencies#

    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.64</version>
        <scope>compile</scope>
    </dependency>

    ECSDAKit#

    Utils#

    java demo#

    php demo#

    Download link

    Error coding table#

    Error codeError description
    -1System error
    5003001Missing parameter
    5003002Merchant or APIKey does not exist
    5003003Merchant disabled
    5003004Merchant not certified
    5003005Merchant api key does not exist
    5003005Merchant or api key does not exist
    5003006api key expired
    5003007ip error
    5003008Signature error
    5003009Payment method not supported
    5003010Order status error
    5003011Merchant order number already exists
    5003012URL format error
    5003013Channel error
    5003014Merchant rate configuration is not initialized
    5003015Channel does not exist
    5003017Failed to create collection order
    5003018Failed to check collection order
    5003010Failed to create payment order
    5003020Failed to query payment
    5004006Insufficient merchant balance
    500321Amount format is incorrect
    500322URL not supported
    500323Remote client error
    500324Order expired
    500326Error in querying channel balance
    500327Wrong payment method
    下一页
    Vietnam🇻🇳
    Built with