Skip to content

Get a purchase

GET
/purchases/{id}
curl --request GET \
--url https://api.getdpd.com/v2/purchases/1 \
--header 'Authorization: Basic <credentials>'
id
required
integer

The purchase.

Media typeapplication/json
object
id
integer
created_at

UNIX timestamp (seconds).

integer
updated_at

UNIX timestamp (seconds).

integer
storefront_id
integer
salt

Unique hash code.

string
status
  • ACT Active: completed and paid.
  • PND Pending payment.
  • RFD Refunded, in part or in full.
  • ERR Error verifying the payment.
  • CAN Canceled.
  • HLD Held by fraud or blacklist checks.
string
Allowed values: ACT PND RFD ERR CAN HLD
currency
string
subtotal
string
discount
string
tax
string
shipping
string
total

Subtotal + discount + tax + shipping

string
processor_fee

The payment processor’s fee. Not recorded for every processor, and not part of total.

string
buyer_email
string
buyer_firstname
string
buyer_lastname
string
customer
object
id
integer
firstname
string
lastname
string
email
string
receives_email

Whether the customer gets your product update emails.

boolean
created_at

UNIX timestamp (seconds).

integer
updated_at

UNIX timestamp (seconds).

integer
customer_notes
string
custom_fields
Array<object>
object
label
string
response
string
shipping_firstname
string
shipping_lastname
string
shipping_street
string
shipping_street2
string
shipping_city
string
shipping_state

State or province code.

string
shipping_zip_code
string
shipping_country_code
string
shipping_country

Full country name.

string
shipping_phone
string
shipping_vatin

VAT identification number.

string
shipping_business_name
string
shipping_carrier

UPS, FedEx and so on.

string
shipping_tracking_number
string
requires_shipping
boolean
tangibles_to_ship

Goods not shipped yet. 0 when everything has shipped, null when nothing needed shipping.

integer | null
billing_firstname
string
billing_lastname
string
billing_street
string
billing_street2
string
billing_city
string
billing_state
string
billing_zip_code
string
billing_country_code
string
billing_card_type
string
billing_card_number

The last digits of the card, padded with asterisks.

string
line_items
Array<object>
object
id
integer
purchase_id
integer
product_id
integer
price
string
quantity
integer
subtotal

Price × quantity

string
tax
string
discount
string
total

Subtotal + tax + discount

string
product_name
string
download_limit

How many times it may be downloaded. 0 is unlimited.

integer
download_count
integer
expires_at

UNIX timestamp (seconds).

integer
product_keys

The product keys delivered with this line item.

Array<string>
has_all_keys

Whether every key was generated.

boolean
coupons
Array<object>
object
name
string
code
string
discount_amount

A percentage or an amount of money, depending on discount_type.

string
discount_type
string
Allowed values: money percent
ip_address

The IP address the customer checked out from.

string
marketing_optin

Whether the customer opted in to marketing emails.

boolean
transactions
Array<object>
object
id
integer
purchase_id
integer
action

Depends on the gateway. Usually AuthorizeAndCapture.

string
amount
string
currency

ISO 4217 currency code.

string
gateway
string
is_success
boolean
reference

The gateway’s reference, such as a Stripe charge ID.

string
message

The gateway’s response message, such as “Approved”.

string
created_at

UNIX timestamp (seconds).

integer
updated_at

UNIX timestamp (seconds).

integer

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.

Media typeapplication/json
object
status
string
Allowed value: NOTFOUND

Example

{
"status": "NOTFOUND"
}