List purchases
const url = 'https://api.getdpd.com/v2/purchases?status=ACT&date_min=2024-01-01&date_max=2024-12-31&total=19.99&total_op=eq';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.getdpd.com/v2/purchases?status=ACT&date_min=2024-01-01&date_max=2024-12-31&total=19.99&total_op=eq' \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”ACTActive: completed and paid.PNDPending payment.RFDRefunded, in part or in full.ERRError verifying the payment.CANCanceled.HLDHeld by fraud or blacklist checks.
Customer email address. Matches the start of the address, not case sensitive.
Matches the start of the name, not case sensitive.
Matches the start of the name, not case sensitive.
Created after this date (anything PHP’s strtotime() accepts).
Created before this date (anything PHP’s strtotime() accepts).
Purchase total, compared with total_op.
How to compare total.
Only purchases with physical goods that haven’t shipped yet.
Page number, 100 records per page. Leave it off to try to get every record.
Responses
Section titled “Responses”The matching purchases.
object
UNIX timestamp (seconds).
UNIX timestamp (seconds).
Unique hash code.
ACTActive: completed and paid.PNDPending payment.RFDRefunded, in part or in full.ERRError verifying the payment.CANCanceled.HLDHeld by fraud or blacklist checks.
Subtotal + discount + tax + shipping
The payment processor’s fee. Not recorded for every processor, and not part of total.
object
Whether the customer gets your product update emails.
UNIX timestamp (seconds).
UNIX timestamp (seconds).
object
State or province code.
Full country name.
VAT identification number.
UPS, FedEx and so on.
Goods not shipped yet. 0 when everything has shipped, null when nothing needed shipping.
The last digits of the card, padded with asterisks.
object
Price × quantity
Subtotal + tax + discount
How many times it may be downloaded. 0 is unlimited.
UNIX timestamp (seconds).
The product keys delivered with this line item.
Whether every key was generated.
object
A percentage or an amount of money, depending on discount_type.
The IP address the customer checked out from.
Whether the customer opted in to marketing emails.
object
Depends on the gateway. Usually AuthorizeAndCapture.
ISO 4217 currency code.
The gateway’s reference, such as a Stripe charge ID.
The gateway’s response message, such as “Approved”.
UNIX timestamp (seconds).
UNIX timestamp (seconds).
Example
[ { "status": "ACT", "subtotal": "19.99", "discount": "19.99", "tax": "19.99", "shipping": "19.99", "total": "19.99", "processor_fee": "19.99", "line_items": [ { "price": "19.99", "subtotal": "19.99", "tax": "19.99", "discount": "19.99", "total": "19.99" } ], "coupons": [ { "discount_type": "money" } ], "transactions": [ { "amount": "19.99" } ] }]The username or API password is wrong.
Nothing found: the record doesn’t exist or isn’t yours, the list is empty, or the page is past the last one.
object
Example
{ "status": "NOTFOUND"}