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.
Server Endpoints: Use the server endpoint provided during merchant onboarding (e.g., https://your-hyp-environment-url/xpo/Relay).
XML payload structure
Required parameters
Invoice parameters (within the invoice element)
invoice element)Item parameters
Multiple items support
Creating invoices with multiple items is supported by using pipe-separated (|) values in the following fields:
invoiceItemCodeinvoiceItemDescriptioninvoiceItemQuantityinvoiceItemPriceinvoiceItemMaam
Example for two items:
Important: All item fields must have the same number of pipe-separated values.
Optional invoice parameters
Response structure
Successful response
A successful addCgInvoice response contains invoice generation details and access information:
Key Response Fields:
result:000indicates successful API callinvoiceCreationCode:000indicates successful invoice creationinvoiceResponseCode:100indicates proper invoice requestinvoiceDocNumber: System-generated invoice numberinvoiceDocUrl: Direct link to view/download invoiceinvoiceAtranId: Transaction ID for which the invoice was createdinvoiceCreationDate: Timestamp of invoice creation
Error response
Error responses include specific error codes and messages:
Code examples
Error codes
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
Related commands
doDeal- Process transactions that can later have invoices generatedinquireInvoice- Query invoice details and status after creationrefundCgInvoice- Create credit notes for refunds with invoice documentationRequest Structure - General API request format
Issuing Invoices - Complete guide to invoice generation
EZcount Configuration Required: Before using this command, ensure your terminal is properly configured with EZcount integration. Contact Hyp support for setup assistance.
Last updated
Was this helpful?