inquireInvoice

Overview

The inquireInvoice command retrieves information about previously generated invoices from the EZcount system. This command allows merchants to fetch invoice data, download links, and status information for invoices created through the platform.

Polling Endpoint: This is essentially a polling endpoint that checks the status of invoice generation. Use it to monitor the progress of invoice creation, especially when invoices are generated asynchronously. It functions as a long-poll endpoint for tracking invoice completion status.

Use cases

Use inquireInvoice when you need to:

  • Retrieve the download link for a previously generated invoice

  • Check the status of an invoice created through addCgInvoice

  • Access invoice metadata such as invoice number and generation date

  • Obtain a merchant copy of the original customer invoice

  • Verify invoice details for reconciliation purposes

Request structure

For general API request structure and authentication, see API Request & Response General Structure.

The inquireInvoice command uses the following endpoint:

POST https://your-hyp-environment-url/xpo/Relay

HTTP request format

The request must be sent as a POST request with application/x-www-form-urlencoded content type, containing three required body parameters:

Parameter
Type
Description

user

string

Your merchant username for API authentication

password

string

Your merchant password for API authentication

int_in

string

XML payload containing the command and parameters (see structure below)

XML request structure

Required parameters

terminalNumber - string

The terminal number associated with your merchant account.

invoiceAtranId - string

The unique transaction ID returned when the invoice was created. This is the preferred and most reliable method for invoice identification.

Example: 119427572

Response structure

Success response example

Key Fields in Success Response:

  • invoiceResponseCode: 100 indicates successful invoice retrieval

  • invoiceResponseName: "Proper Invoice Request" confirms success

  • invoiceDocNumber: The invoice number in the EZcount system

  • invoiceDocUrl: Direct download link for the invoice PDF

  • invoiceCreationCode: 000 indicates no errors during creation

  • invoiceCreationDate: When the invoice was generated

Error response example

Key Fields in Error Response:

  • Note that result is still 000 (API call succeeded)

  • The actual error is in the invoice-specific fields:

    • invoiceResponseName: "Invoice not found" describes the error

    • invoiceCreationCode: 671 is the specific invoice error code

    • Most fields are empty when the invoice is not found

Code examples

Error codes

General API error codes

Code
Description
Solution

000

Success

Invoice information retrieved successfully

325

Invalid XML format

Check XML structure and ensure all required fields are present

405

SSL HTTPS customers are not permitted to access the system

Verify username and password are correct

414

An XML field or an INT_IN parameter is too short/long

Check field lengths match API requirements

Invoice module error codes

Note: Invoice-specific errors are returned in the invoiceResponseCode and invoiceResponseName tags.

CG Gateway invoice error codes

Code
Description
Solution

668

Cannot Create Invoice

Invoice creation failed - check request parameters

669

Currency not supported for invoice creation

Only ILS (Israeli Shekel) invoices are supported

670

Invoice Validation Failed

Check invoice data for invalid values

671

Invoice not found

Verify the invoice identifier is correct and exists

Invoice vendor response codes

Code
Description
Meaning

100

Success

Completed successfully

101

UsernameInvalid

Attempted transaction with invalid username

102

CompanyCodeAlreadyExists

Attempted to create a company with an existing company code

103

CompanyCodeDoesNotExist

Company code does not exist

104

CompanyCodeInvalidFormat

Company code format is not numeric

105

DocumentInvalidSubject

Subject line is invalid

106

DocumentDoesNotExit

Document number was not found

107

SendEmailAborted

E-mailing document failed

108

EmailInvalid

Invalid e-mail format

109

CultureInvalid

Invalid culture

110

KeyInvalid

Invalid key

111

AccountExpired

Account has expired

112

DocumentInvalidItemNumber

Multiple items in an invoice are in the wrong format

113

DocumentInvalidQuantity

Quantity format is not numeric

114

DocumentInvalidPrice

Price format is not numeric

116

DocumentDoesNotExistForSpecifiedCompany

The specified document doesn't exist or is incompatible with the company code provided

117

CurrencyConversionServiceNotAvailable

Currency conversion service is out of service

118

InvalidItemCode

Unacceptable item code

119

CurrencyInWrongFormat

Currency is not an integer

120

DocumentMissingItem

Quantity, price, description and code must match

121

DocumentInvalidDateFormatDDMMYY

Date format must be DDMMYY

122

PaymentAmountDoesntMatchInvoice

Total receivables must be positive

123

DocumentAmountInvalid

Amount must be double

124

CashInvalidAmount

Amount must be double

125

CheckInvalidAmount

Amount must be double

126

CCInvalidAmount

Amount must be double

127

TransInvalidAmount

Amount must be double

128

CheckInvalidDateFormatDDMMYY

Date format must be DDMMYY

129

CCInvalidDateFormatDDMMYY

Date format must be DDMMYY

130

TransInvalidDateFormatDDMMYY

Date format must be DDMMYY

131

PaymentTotalMustBeEqualToInvoiceTotal

Payment total must be equal to invoice total

132

TaxRateInTheDocsIsNotEqual

Tax rate in the docs is not equal

133

ClientCompanyNameAlreadyExists

Client company name already exists

134

ClientTicketAlreadyExists

Client ticket already exists

Currency Support: At this time, only ILS (Israeli Shekel) invoices are supported. Other currencies will be processed but no invoices will be created.

Language: Invoice vendor response messages are always returned in English.

Best practices

  1. Use invoiceAtranId when available - This is the most reliable identifier for invoice queries

  2. Store invoice identifiers - Keep track of invoiceAtranId returned from addCgInvoice for future queries

  3. Handle not found errors gracefully - Invoices may be deleted or expired in the EZcount system

  4. Use for reconciliation - Regular invoice queries help maintain accurate financial records

  5. Monitor invoice status - Check invoice status to ensure proper delivery to customers

Last updated

Was this helpful?