Home

Download this help site
(PDF 82MB)

Download

Invoices API V2 call 

Icon

Wild Apricot's API is intended for use by developers with technical expertise. If you need assistance, we provide support via email or through our Developers forum.

You can use the Invoices API call to retrieve information on a particular invoice, or for multiple invoices, filtered by date, contact, event, or unpaid invoices. You can also create, edit, void, or delete an invoice.

Retrieving information for a particular invoice

Syntax

Example:

Retrieving multiple invoices

You can use the Invoices API call to retrieve multiple invoices. You must include filter criteria to narrow the results. For details, see Filtering the results (below).

The invoice IDs will be listed by document date in descending order.

Syntax

Example:

Icon

If you want to retrieve voided invoices as well as active invoices, specify v2.1 as the API version.

Parameters

The following parameters are used within the Invoices API call:

Variable

Description

baseAPIaddress

The base address of the API. For more information, see API access options   .

versionThe version number of the API. Versions 2 and 2.1 are supported for this call. To retrieve a list of API versions, use the base API call.

accountID

The account identifier that appears on the Account and billing screen and is returned by the Accounts API call.

invoiceIDThe unique identifier for an invoice. Invoices IDs are returned by the Invoices API call.
filterCriteriaThe criteria used to filter the search results. This is a required parameter. For details, see Filtering the results (below).
Icon

Each API call must include an authentication information that verifies your account and prevents others from accessing your data. For more information, see Authenticating API access from a 3rd-party server or application or Authenticating API access from a Wild Apricot site page.

Filtering the results

When retrieving information for multiple invoices, you must include filter criteria. You can filter the results by specifying a contact or event, by specifying a start and/or end date, and by specifying a set of invoice ids. You can also filter the list to retrieve only unpaid invoices. You can combine multiple filter criteria to further narrow the results.

Specifying a contact or event

You can filter the invoices by specifying a particular contact and/or event.

Syntax

Example:

Specifying a start or end document date

You can filter the invoices by specifying a start date and/or an end date (using the DocumentDate field).

Syntax

where date is the start or end date of the range (using the yyyy-mm-dd date format).

Example:

Specifying a set of invoice IDs 

You can filter the invoices by specifying a set of invoice IDs. 

Syntax 

where id is the unique identifier of an invoice.

Example: 

Retrieving only unpaid invoices

You can filter the invoices to retrieve only invoices without settled payments.   

Syntax  

where id is the unique identifier of an invoice. 

Example:  

Retrieving just invoice IDs

You can retrieve just the invoice IDs that match the filter criteria by including the idsOnly parameter. This parameter is only available when you specify v2.1 as the API version. The invoice IDs will be listed by document date in descending order. 

Example 

Paging

Using the $skip and $top parameters, you can retrieve records in sets or pages. You use the $top parameter to specify the maximum number of records to be returned, and the $skip parameter to specify the number of records to skip. The $skip parameter is incremented each call to return the next set or page of records. 

 

Example  

You want to retrieve 50 records using an application that can only process 20 records at a time. Using the following calls, the application retrieves the first set of 20 records, then a second set of 20, and finally, the remaining 10 records.  

In this example, the $top specifies the maximum number of records to retrieve (20), and the $skip parameter is incremented from 0 to 20 to 40 to skip the recordsretrieved by the previous call(s).

Response fields

For each invoice, the Invoices API call retrieves the following information.

Field

Description

DocumentNumberThe invoice number.
IsPaidIndicates whether the invoice is fully paid.
PaidAmountThe sum paid towards the invoice.
OrderType

The invoice type. Possible values:

  • ChangeBillingPlan
  • ChangeBillingInfo
  • Donation
  • EventRegistration
  • MembershipApplication
  • MembershipLevelChange
  • MembershipRenewal
  • Undefined
OrderDetailsDetails of the individual items appearing on the invoice. This is a required array when adding an invoice. Within the OrderDetails array, the fields are Value, Notes, and Taxes. Notes are required and the sum of the Value fields must be positive.
MemoInternal notes on the invoice.
PublicMemoComments for the payer on the invoice.
ValueThe total amount of the invoice.
DocumentDateThe date and time the invoice was created.
ContactThe contact to whom the invoice is assigned. You must specify the contact when adding an invoice.
CreatedDateThe date the invoice was created.
CreatedByThe contact who created the invoice (if manually created).
UpdatedDateThe date the invoice was last updated.
UpdatedByThe contact who updated the invoice.
IDThe unique identifier of the invoice.
URLThe address of the URL call for the invoice.

Sample JSON response

Sample XML response

Creating a new invoice

You can use the Invoices API call to create a new invoice.

Syntax

where invoiceField is a field returned by the Invoices API call.

Example

 

Icon

The OrderDetails array, and the Contact ID are required when adding an invoice. Within the OrderDetails array, the fields are Value, Notes, and Taxes. Notes are required and the sum of the Value fields must be positive.

If successful, the call will return the new invoice ID.

Updating an invoice

You can update an existing invoice using an Invoices API call.

Syntax

where invoiceField is a field returned by the Invoices API call.

Icon

The invoice ID must be specified both as a field and within the requesting URL. All other fields are optional.

Example

If successful, the call returns an HTTP status code 200 without any data in the response body.

Voiding an invoice

You can perform a remote procedure call to void an invoice.

Syntax

where invoiceID is the unique identifier of an invoice returned by the Invoices API call.

Example 

Deleting an invoice

You can use an Invoices API call to delete an existing invoice.

Syntax

where invoiceID is the ID of the invoice you want to delete.

Example

If successful, the call returns HTTP 200 Success. If unsuccessful, returns HTTP 400 bad request.

Generating an invoice for an event registration

You can perform a remote procedure call to generate or regenerate an invoice for an event registration.

Syntax

where eventRegistrationsID is the unique identifier of an event registration returned by the EventRegistrations API call, and updateIfExists  is an optional parameter. If updateIfExists=true, then the invoice will be regenerated if it already exists. If updateIfExists=false and the invoice already exists, then Bad request will be returned. 

Example 

If this call is successful, it returns the ID of the new or updated invoice.

On this page:   

See also:

  • No labels