Get a purchase
const url = 'https://api.getdpd.com/v2/purchases/1';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/1 \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”The purchase.
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"}