Skip to main content
Vindicia Knowledge Center

AutoBill.fetchInvoice

AutoBill.fetchInvoice

AutoBill.fetchInvoice

The fetchInvoice method generates and returns an Invoice, for the given invoiceId, as plain text or as a PDF. (It does not fetch a previously sent Invoice.)

Input

srd: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a method call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the srd. A null srd returns the complete response.

autobill: the AutoBill for the requested invoice.

invoiceId: the ID of the invoice.

asPDF: a Boolean flag, which, if set to true, returns the object as a PDF. Default is false.

statementTemplateId: the Merchant Identifier for a pre-defined statement template. If null, the template defined by the AutoBill will be used.

dunningIndex: the index number of the requested invoice. (If the invoice was the first issued to the customer, its dunningIndex is 0.) For more information, see Working with Invoices in the CashBox Programming Guide. 

language: the language of the invoice.

Output

return: an object of type Return that indicates the success or failure of the call.

invoice: the specified invoice, rendered as a PDF or as plain text. This field encodes both plain text and PDF as xsd:base64Binary.

Returns

In addition to those listed in Standard Return Codes, this call returns:

Return Code

Return String

400

One of the following:

  • Unable to load AutoBill: No match.
  • Unable to load AutoBill: error-description.
  • Unable to load TransactionBilling: error-description.
  • Unable to load StatementTemplate: error-description.
  • Failed to render invoice: error-description.

Example

$autobill = new AutoBill();
$autobill->setMerchantAutoBillId($abID); // for some $abID

$response = $autobill->fetchInvoice(

'inv-bac',
true, // PDF, please
null,
0,
'de-AT' // German in Austria

);

if ($response['returnCode'] == 200) {

$pdf = $response['data']->invoice;

}

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top