Scenario
- Merchants (business entities) can use this API to look up information on whether the issued invoice has been confirmed, including output invoices and input invoices, and Green World will reply to the results as a return parameter.
- This will help Merchant to integrate the inquiry mechanism for confirmation of the issued invoice into the merchant’s website and provide a quick inquiry service.
API URL
- Stage:https://einvoice-stage.ecpay.com.tw/B2BInvoice/GetIssueConfirm
- Production:https://einvoice.ecpay.com.tw/B2BInvoice/GetIssueConfirm
HTTPS format
- Content Type :application/json
- HTTP Method :POST
Request by Merchant (Json format)
PlatformID String(10)
- Platform merchant ID
- This parameter is provided by ECPAY to the platform vendor for project cooperation, please bring in the MerchantID bound with the platform vendor.
- Please leave empty for general vendor.
- When the platform vendor uses the MerchantID field, it can only bring in the MerchantID that has been bound as a sub-store, otherwise it will cause a failure.
MerchantID String(10)
Required
RqHeader
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
MerchantID String(10)
Required
InvoiceCategory Int
Required
Possible values:
- 0: Output E-Invoices (Search the invoice issued to the Counterparty from the Merchant).
- 1: Input E-invoices (Search the invoice of the Counterparty to the Merchant)
InvoiceNumber String(10)
Required
Invoice Number
- If [RelateNumber] has no value, this parameter is required.
InvoiceDate String(20)
Required
Invoice Issue date
- The format is yyyy-mm-dd
- If [RelateNumber] has no value, this parameter is required.
RelateNumber String(20)
- If [InvoiceNumber] has no value, this parameter is required.
Buyer Identifier
Begin date of Invoice
- The format is yyyy-mm-dd
End date of Invoice Issuing date
- The format is yyyy-mm-dd
Beginning Invoice number.
- No E-invoices alphanumeric letters included.(Ex: 00000000)
Ending Invoice Number
- No E-invoices alphanumeric letters included.(Ex: 00000000)
Invoice Status
- 1: Issue
- 0: Reject
Cancel Status
- 1: Canceled
- 0: Not Canceled
Issue Confirm Status
- If this parameter has no value, it is not set.
- 1: Completed, if ExchangeMode=0
0: Issued and waiting confirmation - 1: Received issuing confirmation, if ExchangeMode=1
Upload Status
- 0: Not Uploaded
- 1: Uploaded
- 2: Upload Failed
Example
{
"MerchantID": "2000132",
"InvoiceCategory": 0,
"InvoiceNumber": "SA37758327",
"InvoiceDate": "2019-08-31",
"RelateNumber": "2019081602",
"Seller_Identifier": "",
"Buyer_Identifier": "",
"InvoiceDateBeign": "",
"InvoiceDateEnd": "",
"InvoiceNumberBegin": "",
"InvoiceNumberEnd": "",
"Issue_Status": "",
"Invalid_Status": "",
"ExchangeMode": "",
"ExchangeStatus": "",
"Upload_Status": ""
}
Response format
- Content Type :application/json
- HTTP Method :POST
Response by ECPay (Json format)
PlatformID String(10)
MerchantID String(10)
RpHeader
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.
RtnMsg String(200)
Return messages to indicate whether the API is successfully executed or not.
Example
{
"RtnCode": 1,
"RtnMsg": "Success",
"RtnData": "..."
}
Parameters in RtnData
Merchant ID
E-Invoice number
Upload_Status String(1)
E-Invoice upload status
- If [InvoiceCategory]=0, then this parameter has no value.
- 0:Not Uploaded
- 1:Uploaded
- 2:Upload Failed
Upload_Date String(20)
E-Invoice upload time
- Format is “yyyy-MM-dd HH:mm:ss”.
- If [InvoiceCategory]=0, then this parameter has no value.
Confirm Date
- 1. The format is yyyy-mm-dd
- 2. If not set, then this parameter has no value.
Example
{
"MerchantID": "2000132",
"InvoiceNumber": " SA37758327",
"InvoiceDate": "2019-08-31",
"Buyer_Identifier": "11456006",
"Seller_Identifier": "",
"ConfirmDate": "2019-09-02",
"Upload_Status": "",
"Upload_Date": "2019-09-01",
"ConfirmRemark": ""
}