Invoicing for Refunds
To issue an invoice for a refund or cancellation transaction, use the refundCgInvoice command.
Send a standard Hyp API request and, in the int_in parameter, include an XML payload for the refundCgInvoice command:
<ashrait>
<request>
<version>2000</version>
<language>ENG</language>
<command>refundCgInvoice</command>
<refundCgInvoice>
<invoiceAtranId>{refundTransactionId}</invoiceAtranId>
<invoice>
...
</invoice>
</refundCgInvoice>
</request>
</ashrait>invoiceAtranId should contain the transaction ID (tranId) from the response of the refund transaction you're issuing an invoice for. If you don't have the transaction ID, perform a transaction inquiry to obtain it.
What you include in the invoice element of the payload depends on whether you want to reuse the invoice parameters from the original debit transaction invoice.
If you do want to reuse the original debit invoice parameters, such as item properties, date, and email address, then add createInvoice with a value of 1 inside the invoice element:
<ashrait>
<request>
<version>2000</version>
<language>ENG</language>
<command>refundCgInvoice</command>
<refundCgInvoice>
<invoiceAtranId>{refundTransactionId}</invoiceAtranId>
<invoice>
<createInvoice>1</createInvoice>
</invoice>
</refundCgInvoice>
</request>
</ashrait>If you want to create a refund invoice that uses new invoice parameters (for example, when performing a partial refund), set createInvoice to 2 and include the new invoice parameters in the invoice element. The set of supported invoice parameters is the same as in the addCgInvoice command:
The response structure is similar in both scenarios and matches the one returned after sending the addCgInvoice command:
Last updated
Was this helpful?