addCgInvoice

Overview

The addCgInvoice command generates an invoice or receipt for an existing transaction that has been processed through the Hyp platform. This command integrates with the EZcount invoicing system to create legally compliant invoices for Israeli tax purposes, including proper VAT handling, discount management, and itemized billing.

Invoice generation is crucial for businesses that need to provide customers with official documentation for their transactions, enabling proper accounting, tax compliance, and professional customer communication. The invoice can be delivered via email, SMS, or accessed through a generated URL.

Use cases

  • Post-transaction invoice generation: Create invoices after successful payment transactions (see Issuing Invoices)

  • Receipt issuance: Generate official receipts for completed payments for tax compliance

  • Multi-item invoicing: Create detailed invoices with multiple line items, descriptions, and prices

  • VAT/tax documentation: Properly handle Israeli VAT requirements and other tax considerations

  • Discount documentation: Document discounts and promotional pricing in official invoices

  • Customer communication: Send invoice links to customers via email or SMS automatically

  • Accounting integration: Generate invoices that integrate with business accounting systems

  • Retroactive invoice creation: Issue invoices for past transactions

Request structure

For a comprehensive overview of the API request format and authentication, see API Request & Response General Structure.

Send a standard Hyp API request to your assigned server endpoint with the addCgInvoice command in the int_in parameter.

XML payload structure

Required parameters

invoiceAtranId - Transaction identifier for invoice

Type: String (Numeric) Required: Yes Description: The transaction ID (tranId) of the payment transaction for which to generate an invoice

Example: 123456789

Usage Notes:

  • Must reference a valid, completed transaction

  • Transaction must exist in the system

  • Can be obtained from transaction response or inquiry

invoice - Invoice details container

Type: Complex Object Required: Yes Description: Container element for all invoice-specific parameters and details

Contains: All invoice configuration parameters, items, customer details, and delivery options

Invoice parameters (within the invoice element)

invoiceCreationMethod - Invoice creation method

Type: String (Enum) Required: Yes Description: Specifies how the invoice should be created

Valid Values: post (asynchronous), wait (synchronous) Example: wait

Usage Notes:

  • post - Asynchronous invoice creation with immediate response

  • wait - Synchronous invoice creation, waits for completion

  • Use wait for immediate confirmation of invoice creation

invoiceDate - Invoice date

Type: String (Date, YYYY-MM-DD format) Required: Yes Description: The date for the invoice

Default: Current date if empty Example: 2025-01-01

Usage Notes:

  • Use YYYY-MM-DD format

  • Leave empty to use the current date

  • Cannot be a future date

invoiceSubject - Invoice subject line

Type: String (Alpha Numeric and Space, max 255) Required: Yes Description: Subject line or title for the invoice

Example: Monthly Subscription Invoice

Usage Notes:

  • Maximum 255 characters

  • Supports Hebrew characters

  • Appears as the main invoice title

Item parameters

invoiceItemCode - Item code (makat)

Type: String (Numeric, max 500) Required: Yes Description: Product or service code identifier

Example: 11010

Usage Notes:

  • Used for inventory tracking

  • Maximum 500 characters

  • For multiple items, separate with pipe symbol (|)

invoiceItemDescription - Item description

Type: String (Alpha Numeric and Space, max 500) Required: Yes Description: Description of the product or service

Example: Premium Monthly Subscription

Usage Notes:

  • Clear, customer-friendly descriptions are recommended

  • Supports Hebrew characters

  • For multiple items, separate with pipe symbol (|)

  • Maximum 500 characters

invoiceItemQuantity - Item quantity

Type: String (Numeric, XXX.XX format) Required: Yes Description: Number of units for this line item

Example: 1, 3, 2.5

Usage Notes:

  • Supports decimal quantities for partial units

  • Must be greater than 0

  • For multiple items, separate with pipe symbol (|)

invoiceItemPrice - Unit price in agorot/cents

Type: String (Numeric, max 500) Required: Yes Description: Price per unit in currency subunits (agorot for ILS)

Example: 10000 (represents 100.00 ILS)

Usage Notes:

  • Price is per unit before quantity multiplication

  • VAT/tax calculated separately if applicable

  • For multiple items, separate with pipe symbol (|)

  • Must match transaction amount validation rules

invoiceItemMaam - Item VAT indicator

Type: String (Numeric, 0|1) Required: No Description: Per-item VAT inclusion indicator

Valid Values: 0 (without VAT), 1 (with VAT) Example: 1

Usage Notes:

  • Controls VAT display for individual items

  • For multiple items, separate with pipe symbol (|)

  • Must match the count of other item parameters

Multiple items support

Creating invoices with multiple items is supported by using pipe-separated (|) values in the following fields:

  • invoiceItemCode

  • invoiceItemDescription

  • invoiceItemQuantity

  • invoiceItemPrice

  • invoiceItemMaam

Example for two items:

Important: All item fields must have the same number of pipe-separated values.

Optional invoice parameters

invoiceDiscount - Invoice discount amount

Type: String (Numeric) Required: No Description: Fixed discount amount in agorot/cents

Default: 0 Example: 1000 (represents 10.00 ILS discount)

Usage Notes:

  • Cannot be used together with invoiceDiscountRate

  • Applied to total invoice amount

  • Reduces taxable amount

invoiceDiscountRate - Invoice discount percentage

Type: String (Percentage, XXX.XX format) Required: No Description: Percentage discount rate

Default: 0.00 Example: 10.00 (represents 10% discount)

Usage Notes:

  • Cannot be used together with invoiceDiscount

  • Applied to total invoice amount

  • Use decimal format (10.00 for 10%)

invoiceTaxRate - Tax rate percentage

Type: String (Percentage, XXX.XX format) Required: No Description: Tax rate to apply to invoice items

Example: 17.00 (represents 17% VAT)

Usage Notes:

  • Specify as percentage (17.00 for 17%)

  • Leave empty to use system default

  • 0 for tax-exempt transactions

invoiceComments - Invoice comments

Type: String (Alpha Numeric and Space, max 255) Required: No Description: Additional comments or notes for the invoice

Example: Thank you for your business

Usage Notes:

  • Maximum 255 characters

  • Supports Hebrew characters

  • Appears on the invoice as additional information

companyInfo - Customer information

Type: String (Alpha Numeric and Space, max 255) Required: Yes Description: Customer full details and information

Example: John Smith, ABC Company

Usage Notes:

  • Used for invoice addressing

  • Supports Hebrew characters

  • Maximum 255 characters

  • Required for proper invoice generation

sendMail - Email delivery flag

Type: String (Numeric, 0|1) Required: No Description: Whether to automatically send invoice by email

Valid Values: 0 (don't send), 1 (send email) Default: 0 Example: 1

Usage Notes:

  • Requires valid mailTo parameter

  • Sends an invoice link automatically

  • Email template configured in EZcount

mailTo - Customer email address

Type: String (Email format, max 80 characters) Required: Yes (when sendMail=1) Description: Email address for invoice delivery

Format: [email protected] Example: [email protected]

Usage Notes:

  • Must be a valid email format

  • Required when sendMail is set to 1

  • Invoice link will be sent to this address

  • Maximum 80 characters

isItemPriceWithTax - Price includes tax indicator

Type: String (Numeric, 0|1) Required: Yes Description: Indicates whether item prices include tax

Valid Values: 0 (price without tax), 1 (price with tax) Example: 1

Usage Notes:

  • Affects tax calculation method

  • Must be consistent for all items

  • Required for proper tax handling

ccDate - Payment date

Type: String (Date, YYYY-MM-DD format) Required: Yes Description: The date when payment was processed

Example: 2025-01-01

Usage Notes:

  • Use YYYY-MM-DD format

  • Should match the transaction date

  • Required for invoice generation

invoiceSignature - Digital signature

Type: String (Binary base 64 data) Required: No Description: Digital signature for the invoice

Usage Notes:

  • Binary base 64 encoded data

  • Currently not supported (FFU - For Future Use)

  • Leave empty if not used

invoiceType - Invoice document type

Type: String (Enum) Required: No Description: Type of financial document to create

Valid Values: tax, taxreceipt, receipt, receiptdonation, order, pricequote, incomesplitting, contributionwithinco, invoicetransaction, transactionaccount Default: Taken from terminal configuration Example: tax

Usage Notes:

  • Only supported when the invoice vendor is EZcount

  • When absent, the type is taken from the configuration

  • Choose based on business requirements

DocNotMaam - Tax field display indicator

Type: String (Numeric, 0|1) Required: No Description: Controls whether tax fields are displayed on invoice

Valid Values: 1 (tax included), 2 (tax not included) Default: 1 Example: 1

Usage Notes:

  • Value 1: tax fields included in display

  • Value 2: tax fields not included in display

  • When DocNotMaam=1, isItemPriceWithTax should be 0

  • Default behavior when absent is DocNotMaam=1

Response structure

Successful response

A successful addCgInvoice response contains invoice generation details and access information:

Key Response Fields:

  • result: 000 indicates successful API call

  • invoiceCreationCode: 000 indicates successful invoice creation

  • invoiceResponseCode: 100 indicates proper invoice request

  • invoiceDocNumber: System-generated invoice number

  • invoiceDocUrl: Direct link to view/download invoice

  • invoiceAtranId: Transaction ID for which the invoice was created

  • invoiceCreationDate: Timestamp of invoice creation

Error response

Error responses include specific error codes and messages:

Code examples

Error codes

Error Code
Description
Resolution

000

Success

Invoice created successfully

003

Invalid merchant

Verify terminal number and merchant configuration

044

Invalid terminal

Check terminal configuration and invoice permissions

456

Amount mismatch

Ensure invoice items total matches transaction amount

457

Transaction not found

Verify transaction ID exists and belongs to terminal

458

Invoice already exists

Check if invoice was already created for this transaction

459

EZcount not configured

Terminal must be configured with EZcount integration

099

General error

Check parameters and contact support if needed

Amount Validation: The system validates that the sum of all invoice items (after discounts and including VAT) matches the original transaction amount. Ensure your calculations are accurate to avoid rejection.

Last updated

Was this helpful?