Syntax

listPurchases( from='-24h', to='now' , search=[], sort_by='date', sort_order='asc', $show_transactions=false, $page_no=1, $page_size=1000 )

Gives back a list of your sales.

By default the function returns all sales you get a commission for. This includes joint ventures.

To only return your sales as a vendor or affiliate, use the parameter search[roles] - see below.

Important

This is list is different from the list you may retrieve via the Digistore backoffice unter reports - purchases.

In the backoffice, you'll get a list of purchases, where you are the vendor (or affiliate - depending on the selected view).

This api function returns a list of purchases, where you get a commission for. 

You may restrict this to purchases where you are the vendor by using the parameter search[role]=vendor.

But you cannto restrict the list in the backoffice to purchases, where you get a commission for.

This means, you cannot compare those two lists.

Access rights

Read access or full access required.

Arguments

fromPoint of time. Search for the date of order creation.

Note: To search for transaction date, use listTransactions()!

Example values are:

  • “2014-02-28 23:11:24”
  • "2021-10-08T07:20:11-05:00" (Iso 8601 format)
  • “now” for the current time
  • “-3d” for the point of time 3 days ago
  • “start” for the first available date (that means, the date the Digistore24-account was created).

Default value for ‘from' is ‘-24h', so the point of time 24h ago.

topoint of time - see'from'.

search – Array with the following possible elements:

  • role: Search for purchases with a certain role. Possible values:
    - vendor
    - affiliate
    - other
    Separate multiple values by commas, e.g.:
    search[role]=vendor,affiliate
  • product_id: Single product-ID or multiple product-ID's separated by comma. Finds purchases, where the main product fits those product-ID's.
  • first_name
  • last_name
  • email: searches for buyers with this data Example: search[first_name]=helm finds purchases with buyer first name Wilhelm, Wilhelmine or Helmut 
  • has_affiliate: Boolean – searches for purchases with/without affiliate
  • affiliate_name: search for the name of the affiliate
  • order_type:search for test and real orders. Values are:
    • live - list orders real payments
    • test - list orders with test payments
  • pay_method: searches for purchases with single payment method or multiple payment methods. Multiple values are separated by comma. For the possible payment methods see api-function: getGlobalSettings() – there value of type[pay_method]
  • billing_type: searches for purchases with single billing type (i.e. subscription, single payment). Multiple values are separated by comma. For the possible values see api-function: getGlobalSettings() – there value of type[search_billing_type]
  • transaction_type: search by transaction type (payment, refund, chargeback, refund_request) Multiple values are separated by comma. For the possible values see API-function: getGlobalSettings() – there values of type[search_transaction_type]
  • currency: searches for purchases with single currencies (i.e. EUR). For the possible values see api-function: listCurrencies().
  • purchase_id: Searches purchases with this order-ID. Separate multiple order-ID's with commas.

Note: Probably you want to use from=start when using search criterias, because the search only happens in the selected timespan.

sort_by – Gives the sorting of the list. Possible values are:

  • date (Standard) – sorted by date of the payment (not the purchase!)
  • earning – sorted by earning amount
  • amount – sorted by gross amount of the payment

The sort value "product_name" is deprecated and will be removed in the future.

sort_order – possible values are

  • asc (Standard) – the sorting is ascending (that means the smallest value stands at the beginning)
  • desc – the sorting is descending (that means the biggest value stands at the beginning)

The default value is ‘now', so the date of today (current date).

load_transactions - add a list of transactions to each purchases. Increases the loading time. Default is: false

page_no – Page number, that should be shown. The numbering starts with 1.

page_size – Number of entries on a page. Default is 500.

Return data

purchase_list: list with orders

For purchases, where you are the affiliate, the campaignkey, click_id and the sub_ids are also returned.

[click_id] => some_click_id
 [sub_ids] => Array
 (
 [sid1] => a_sub_id
 [sid2] => some_other_sub_id
 [sid3] =>
 [sid4] =>
 [sid5] =>
 )