Data Verification / Verifying the Existence of Mobile Barcode

Application Scenarios

Merchants can call this API to check if the mobile barcode exists before issuing the e-invoice. A mobile barcode enables the consumer to record or save the information of e-invoice into. For the definition of the carrier please refer to the chapter 2: Glossary.

❗ Notes:
1. If the carrier number is a mobile barcode carrier, the mobile barcode verification API can be called first for checking. If there is an error in the mobile barcode, it may result in the invoice not being properly attributed to the account.
2. This API interacts with the Ministry of Finance’s system for data verification. However, the Ministry of Finance’s system may undergo unexpected maintenance activities, which can affect the stability and availability of the API. Therefore, it is advised not to use this API as the sole verification mechanism before issuing an invoice. It should be considered an auxiliary verification tool to avoid interrupting the normal issuance of invoices.

API URLs:

  • Stage: https://einvoice-stage.ecpay.com.tw/B2CInvoice/CheckBarcode
  • Production: https://einvoice.ecpay.com.tw/B2CInvoice/CheckBarcode

HTTPS format

  • Content Type :application/json
  • HTTP Method :POST

Request by Merchant (Json format)

PlatformID String(10)

  • This parameter is specifically designed for platform vendors collaborating with ECPay. It can only be utilized after applying for and activating the service.
  • If you are a general vendor, please leave the PlatformID empty.
  • When using this parameter, the MerchantID must be filled in with the specific store code bound to your PlatformID to prevent operation failures.
  • Please note that only the MerchantID of a bound sub-merchant can be used to avoid operational failures. For binding operations, please contact your business representative.

RqHeader Object
Required

Request header

Timestamp  Number
Required

  • Please convert the transmission time to a timestamp (GMT+8).
  • ECPay will use this parameter to convert the current time to Unix TimeStamp to verify the time interval of this connection.

❗ Special Notes

  • If ECPay receives the API call is more 10 minutes late than the timestamp sent by merchants, this request will be failed. Reference information is as follows:http://www.epochconverter.com/
  • Merchants are suggested to frequently synchronize the time zone of server to another server of the nearest time zone.

Data String
Required

  • Message payload
  • This is the encrypted data in JSON format.
    AES Encryption Description

Example

				
					{
    "MerchantID": "2000132",
    "RqHeader": {
        "Timestamp": 1525168923
    },
    "Data": "..."
}

				
			

Message payload of Data(Json format) : please urlencode the JSON string firstly and then do AES encryption

BarCode String(7)
Required

  • A mobile barcode that a consumer has
  • Sequence format should be 1 code slash “/” followed by a combination of 7 numerals, English alphabets and special characters “+”, “-“, “.” Only half-width is acceptable.

❗ Special notes : Some mobile barcodes have a plus symbol (+), which might cause error when making API request. Please replace it with an empty character (i.e. space or blank).

Example

				
					{
   "MerchantID": 2000132,
   "BarCode": "/1234567"
}
				
			

Response format

  • Content Type :application/json
  • HTTP Method :POST

Response by ECPay (Json format)

PlatformID String(10)

MerchantID String(10)
Required

RpHeader Object

Response header

Timestamp  Number

Unix timestamp(GMT+8)

TransCode Int

  • Response code to indicate whether the payload is successfully accepted
  • Possible values:
    1: Payload (i.e. MerchantID, RqHeader, and Data) is successfully accepted by ECPay.
    Others: failed.

TransMsg String(200)

Response message to indicate whether the payload is successfully accepted

Data String

  • Message payload
  • Responde relevant data, this is the encrypted JSON format data。
    AES Encryption Description

Example

				
					{
    "MerchantID": "2000132",
    "RpHeader": {
        "Timestamp": 1525169058
    },
    "TransCode": 1,
    "TransMsg": "",
    "Data": "..."
}

				
			

Message payload of Data(Json format) : please do AES decryption to the Data firstly and then do urldecode.

RtnCode Int

  • Return codes to indicate whether the API is successfully executed or not.
  • Possible values:
    1: API is successfully executed.
    Others: failed.

❗ Special notes : 

  1. This field value represents the result of the call transaction operation and does not indicate the existence of a mobile barcode result.
  2. 9000001: Failed to call the Ministry of Finance API.
    This indicates that the Ministry of Finance system is currently under maintenance and unable to verify. Please try again later.

RtnMsg String(200)

Return messages to indicate whether the API is successfully executed or not.

IsExist String(1)

  • A response value to indicate whether the mobile barcode exists.
  • Possible values:
    Y: Exist
    N: Not exist

Example

				
					{
  "RtnCode": 1,
  "RtnMsg": "",
  "IsExist": "Y"
}
				
			

Copyright © Green World FinTech Service Co., Ltd. All rights reserved.

Green World