Follow

Refunds API call

You can use the Refunds API call to retrieve information for a particular refund, or for multiple refunds, filtered by date, contact, or event. You can also create, edit, or delete a refund.

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.

Retrieving a specific refund

Syntax
GET [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/[refundID]
Example
GET https://api.wildapricot.org/v2/Accounts/58293/Refunds/1029973

Retrieving multiple refunds

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

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

Syntax
GET [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/?[filterCriteria]
Example:
GET https://api.wildapricot.org/v2/Accounts/58293/Refunds?contactId=725191&StartDate=2016-11-20  

Parameters

The following parameters are used within the Refunds API call:

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

version
The 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 is returned by the Accounts API call.

refundID
The unique identifier for a refunds. Refund IDs are returned by the Refunds API call.

filterCriteria
The criteria used to filter the search results. This is a required parameter. For details, see Filtering the results (below).

Each API call must include an authentication information that verifies your account and prevents others from accessing your data. For more information, see API access options.

Filtering the results

When retrieving information for multiple refunds, 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 refund ids. You can combine multiple filter criteria to further narrow the results.

Specifying a contact or event

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

Syntax
GET [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/?contactId=[contactID]&eventId=[eventID]
Example:
GET https://api.wildapricot.org/v2/Accounts/58293/Refunds?contactId=725191&eventId=11769

Specifying a start or end document date

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

Syntax
GET [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/?StartDate=[date]&EndDate=[date]

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

Example:
GET https://api.wildapricot.org/v2/Accounts/58293/Refunds/?StartDate=2016-11-01&EndDate=2016-11-30

Specifying a set of refund IDs

You can filter the refunds by specifying a set of refund IDs.

Syntax
GET [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/?ids=[id1],[id2],[id3]...

where id is the unique identifier of a refund.

Example:
GET https://api.wildapricot.org/v2/Accounts/58293/Refunds/?ids=25291887,25291888

Retrieving just refund IDs

You can retrieve just the refund 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 refund IDs will be listed by document date in descending order.

Example
GET https://api.wildapricot.org/v2/Accounts/58293/Refunds?eventId=11769&idsOnly=true

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.

https://api.wildapricot.org/v2/Accounts/58293/Refunds?eventId=11769&$skip=0&$top=20
https://api.wildapricot.org/v2/Accounts/58293/Refunds?eventId=11769&$skip=20&$top=20
https://api.wildapricot.org/v2/Accounts/58293/Refunds?eventId=11769&$skip=40&$top=20

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

The Refunds API call retrieves the following information for each refund.

Comment
Any internal notes entered for the refund.

Contact
The contact to whom the refund was made. For each contact, the contact ID and contact URL are returned.

CreatedBy
The contact who created the refund (if manually created).

CreatedDate
The date the refund was created.

DocumentDate
The date and time the refund was made.

ID
The unique identifier of the refund.

PublicComment
Any comments entered for the payer.

SettledValue
The previously settled amount of the payment.

Tender
The method used to refund the payment. For each tender, the tender name, tender ID, and tender URL are returned.

UpdatedBy
The contact who updated the refund.

UpdatedDate
The date the refund was last updated.

URL
The address of the URL call for the refund.

Value
The amount of the refund.

Sample JSON response

[
{
"Tender": {
"Id": 1196720,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Tenders/1196720",
"Name": "PayPal"
},
"Comment": "Payment recorded in error",
"PublicComment": "Refunded in full",
"SettledValue": 0,
"Value": -20,
"DocumentDate": "2016-11-21T11:13:28-05:00",
"Contact": {
"Id": 29976949,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Contacts/29976949"
},
"CreatedDate": "2016-11-21T11:13:28",
"CreatedBy": {
"Id": 29976949,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Contacts/29976949"
},
"UpdatedDate": null,
"UpdatedBy": null,
"Id": 25291887,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Refunds/25291887"
}
]

Sample XML response

<Refund xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://api.wildapricot.org">
<Id>25291887</Id>
<Url>http://api.wildapricot.org/v2/accounts/203011/Refunds/25291887</Url>
<Contact>
<Id>29976949</Id>
<Url>http://api.wildapricot.org/v2/accounts/203011/Contacts/29976949</Url>
</Contact>
<CreatedBy>
<Id>29976949</Id>
<Url>http://api.wildapricot.org/v2/accounts/203011/Contacts/29976949</Url>
</CreatedBy>
<CreatedDate>2016-11-21T11:13:28</CreatedDate>
<DocumentDate xmlns:d2p1="http://schemas.datacontract.org/2004/07/System">
<d2p1:DateTime>2016-11-21T16:13:28Z</d2p1:DateTime>
<d2p1:OffsetMinutes>-300</d2p1:OffsetMinutes>
</DocumentDate>
<UpdatedBy i:nil="true" />
<UpdatedDate i:nil="true" />
<Value>-20.0000</Value>
<Comment>Payment recorded in error</Comment>
<PublicComment>Refunded in full</PublicComment>
<SettledValue>0.0000</SettledValue>
<Tender>
<Id>1196720</Id>
<Url>http://api.wildapricot.org/v2/accounts/203011/Tenders/1196720</Url>
<Name>PayPal</Name>
</Tender>
</Refund>

Creating a new refund

You can use the Refunds API call to create a new refund.

Syntax
POST [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds
{
"[refundField]": [refundFieldValue],
"[refundField]": [refundFieldValue],
...
}

where refundField is a field returned by the Refunds API call.

Example
POST https://api.wildapricot.org/v2/Accounts/58293/Refunds
{
"EventId": 51258,
"Tender": {
"Id": 1196720,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Tenders/1196720",
"Name": "PayPal"
},
"Comment": "Payment recorded in error",
"PublicComment": "Refunded in full",
"SettledValue": 0,
"Value": -20,
"DocumentDate": "2016-11-21T11:13:28-05:00",
"Contact": {
"Id": 29976949,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Contacts/29976949"
},
"CreatedDate": "2016-11-21T11:13:28",
"CreatedBy": {
"Id": 29976949,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Contacts/29976949"
}
}

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

Updating a refund

You can update an existing refund using a Refunds API call.

Syntax
PUT [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/[efundID]
{
"Id": refundID,
"[refundField]": [refundFieldValue],
"[refundField]": [refundFieldValue],
...
}

where refundField is a field returned by the Refunds API call.

The refund ID must be specified both as a field and within the requesting URL. All other refund fields are optional.
Example
PUT https://api.wildapricot.org/v2/Accounts/58293/Refunds/1029973
{
"Id": 1029973,
"Value": -40,
"UpdatedDate": "2016-11-21T11:13:28",
"UpdatedBy": {
"Id": 29976949,
"Url": "https://api.wildapricot.org/v2/accounts/203011/Contacts/29976949"
}
}

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

Deleting a refund

You can use a Refunds API call to delete an existing refund.

Syntax
DELETE [baseAPIaddress]/[version]/Accounts/[accountID]/Refunds/[refundID]

where refundID is the ID of the refund you want to delete.

Example
DELETE https://api.wildapricot.org/v2/Accounts/58293/Refunds/1029973

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

0 Comments

Please sign in to leave a comment.

Search: WildApricot.com 

About results ( seconds) Sort by: 
Sorry, an error occured when performing search.