Skip to main content
Aria Knowledge Central

gen_einvoice_m Sample Call and Response

This example generates and sends the e-invoice document for a single invoice, using the gen_einvoice_m method from the release 74 Core API definition (plsql_m_r74.yml).

This example includes every required field, plus auth_key and include_einvoice_data, to show a complete, successful response. It does not cover the do_write field, which lets you preview the effects of the call without making the change, or the einvoice_directive values of 2 and 3, which generate a document without sending it or resend an existing document.

Sample call

{
  "rest_call": "gen_einvoice_m",
  "output_format": "json",
  "client_no": 10023,
  "auth_key": "a1s2d3f4g5h6j7k8l9z0x1c2v3b4n5m6",
  "acct_no": 5567234,
  "invoice_no": 8891432,
  "einvoice_directive": 1,
  "include_einvoice_data": 1
}

The acct_no field identifies the account by its Aria-assigned account number. You could supply client_acct_id instead, using your own client-defined account identifier, but do not send both fields in the same call, since acct_no and client_acct_id are alternative ways to identify the same account.

The invoice_no field identifies the invoice to generate the e-invoice document for. You could supply einvoice_seq_no instead to resend one specific, previously generated document, but Aria requires einvoice_seq_no only when einvoice_directive equals 3. Because this example generates a new document, it supplies invoice_no and omits einvoice_seq_no.

The einvoice_directive value of 1 tells Aria to generate the e-invoice document and send it. A value of 2 generates the document without sending it, and a value of 3 resends an existing document.

Setting include_einvoice_data to 1 requests that the generated e-invoice XML payload be returned in the response. Omit this field, or set it to 0, when you need only confirmation that the call succeeded.

The rest_call and output_format fields sit outside the method's own documented arguments. Aria's REST gateway uses rest_call to identify which method to invoke, and output_format to determine the shape of the response. This example requests a JSON response.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "einvoice_seq_no": 3312,
  "einvoice_status_ind": 1,
  "einvoice_data": "88914322026-08-15Sent"
}

An error_code of 0 and an error_msg of OK indicate that the call succeeded. The einvoice_seq_no field identifies this specific e-invoice document. Record it if you later need to resend this exact document rather than whichever document is latest for the invoice.

The einvoice_status_ind value of 1 indicates that the document reached a Done status. Other possible values indicate a Pending, Partial, Failed, or Not Eligible status.

The einvoice_data field contains a shortened, illustrative e-invoice XML payload rather than a complete document. This example does not model a failed generation attempt, in which einvoice_status_ind would return a Failed status.

TOP
  • Was this article helpful?