List Purchases By Customer

Query, paginate, and sort purchase results for a customer.

This call supports querying, pagination, and sorting. For syntax and examples, see Pagination, Filtering, Sorting, and Event Suppression.\
&query=parameterName:Value

Parameter NameAcceptable ValuesParameter NameAcceptable Values
AmountDecimal RangeModifiedTimestampDate Range
CancellationTimestampDate RangeNameString
CreatedTimestampDate RangePricingModelTypeStandard, Tiered, Stairstep, Volume, Formula
CustomerIdIntegerProduct.CodeString
DescriptionStringProduct.NameString
EarningIntervalMonthly, YearlyProduct.DescriptionString
EarningNumberOfIntervalIntegerPurchaseTimestampDate Range
EarningTimingIntervalDaily, EarnImmediately, DoesNotEarn, Monthly, Yearly, IntervalQuantityDecimal Range
EarningTimingTypeStartOfInterval, EndOfInterval, DoesNotEarnSalesforceIdString
EffectiveTimestampDate RangeStatusDraft, Purchased, Cancelled
IsEarnedImmediatelyBooleanTargetOrderQuantityDecimal Range
IsTrackingItemsBooleanTaxableAmountDecimal Range

Use &pageSize=100&pageNumber=0 for pagination.\
Use &sortOrder=Ascending or &sortOrder=Descending with &sortExpression=expression for sorting.

Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{CustomerId}/Purchases" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//Path Parameter
int customerId = {CustomerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/" + customerId + "/Purchases");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic " + apiKey);
//Set request method
request.Method = "GET";
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  result = streamReader.ReadToEnd();
}
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI and Headers
r = requests.get('https://secure.fusebill.com/v1/customers/{id}/purchases', headers=headers)
print(r.content)
Response
[
  {
    "customerId": 12762177,
    "accountId": 98765,
    "code": "device",
    "effectiveTimestamp": "2019-11-11T19:39:55",
    "taxableAmount": 15,
    "amount": 15,
    "modifiedTimestamp": "2019-11-11T19:40:07.963",
    "salesforceId": "b045a250231VC4RCAW",
    "netsuiteLocationId": "12",
    "productId": 25309384,
    "name": "Fitness Tracker",
    "description": "Model 5000",
    "status": "Purchased",
    "quantity": 1,
    "targetOrderQuantity": null,
    "isTrackingItems": false,
    "pricingModelType": "Standard",
    "customFields": [],
    "discounts": [],
    "priceRanges": [
      {
        "min": 0,
        "max": null,
        "amount": 15,
        "conditionAmount": null,
        "variableAmount": null
      }
    ],
    "productItems": [],
    "couponCodes": [],
    "earningSettings": {
      "earningInterval": "",
      "earningNumberOfIntervals": null,
      "earningTimingInterval": "EarnImmediately",
      "earningTimingType": "StartOfInterval"
    },
    "id": 1616831,
    "uri": "https://secure.fusebill.com/v1/Purchases/1616831"
  }
]
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Bad request, the query is not valid.  Please check your request and try again."
        }
    ]
}
Path Params
int32
required

This is the Id value of the Customer for whom you wish to retrieve the list of Purchases.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Choose an example:
application/json