List Purchases By Customer

This function is used to retrieve a list of purchase objects for a given customer ID.

Path Parameters

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

This call supports string filtering (Read More) and datetime/numeric range filtering (Read More)
&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, Reversed, Cancelled
IsEarnedImmediatelyBooleanTargetOrderQuantityDecimal Range
IsTrackingItemsBooleanTaxableAmountDecimal Range

This call supports pagination (Read More)
&pageSize=100&pageNumber=0
This call supports sorting (Read More)
&sortOrder=Ascending or &sortOrder=Descending
&sortExpression=expression

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,
    "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."
        }
    ]
}
Language
Authorization