Syntax

getPurchase( purchase_id )

Gives back details for the selected order.

Access rights

Read access or full access required.

Arguments

purchase_id – the Digistore24 order id. Or a comma seperated list of order ids.

If specified, the current exchange rates into this currency are also displayed.

Return data

Order-informations, for example:

 [other_amounts] => 0.00
[other_vat_amounts] => 0.00
[id] => L4F5DWT5
[amount] => 10.00
[currency] => EUR
[number_of_installments] => 0
[vat_country] => DE
[vat_amount] => 1.60
[vat_rate] => 19.00
[created_at] => 2014-02-25 22:51:09
[billing_type] => single_payment
[billing_type_msg] => Einmalzahlung
[billing_status] => aborted
[billing_status_msg] => Zahlungen abgebrochen
[renew_url] => https://digistore24.com/renew/DJURWR4K/8PDBM7DV
[receipt_url] => https://digistore24.com/receipt/DJURWR4K/8PDBM7DV
[invoice_url] =>
[has_custom_forms] => N
[has_etickets] => N
[transaction_list] => Array
 (
 [0] => Array
 (
 [id] => 313113
 [amount] => 10.00
 [currency] => EUR
 [purchase_id] => L4F5DWT5
 [pay_method] => paypal
 [pay_method_msg] => PayPal
 [created_at] => 2014-02-25 22:51:43
 [type] => payment
 [type_msg] => Verkauf
 [invoice_url] => https://www.digistore24.com/invoice/DJURWR4K/313113/8PDBM7DV.pdf
 )

 [1] => Array
 (
 [id] => 313115
 [amount] => -10.00
 [currency] => EUR
 [purchase_id] => L4F5DWT5
 [pay_method] => paypal
 [pay_method_msg] => PayPal
 [created_at] => 2014-02-25 22:52:02
 [type] => refund
 [type_msg] => Rückgabe
 [invoice_url] => https://www.digistore24.com/invoice/DJURWR4K/313113/8PDBM7DV.pdf
 )
 ),
[buyer] => Array
 (
 [id] => 54321
 [created_at] => 2016-08-26 13:33:23
 [email] => claus@mail.com
 [first_name] => Claus
 [last_name] => Meyers
 [salutation] => Mr.
 [title] => Dr.
 [company] => Sample Ltd.
 [street] => Test street 17
 [street2] =>
 [zipcode] => 12345
 [city] => Test city
 [state] =>
 [country] => DE
 [phone_no] =>
 )

[items] => Array
 (
 [0] => Array
 (
 [product_name] => Ihr Weg in die Selbstständigkeit
 [product_id] => 20
 [quantity] => 1
 [variant_key] => deluxe
 [variant_name] => Deluxe Edition
 [no] => 1
 [count] => 1
 [id] => 3214324
 )
 )
[placeholders] => Array
 (
 )
[refund_policy] => stdClass Object
 (
 [purchase_id] => ZMZV26HF
 [reason_code] => default
 [refund_days] => 0
 [is_reminder_allowed] => N
 [policy_id] => 411
 [product_type_id] =>
 [delivery_type] =>
 [checkbox_text] => I acknowledge that there is no cancellation right for this event.
 ) 

multiple order ids

If multiple order ids are given, the result is an array - with one entry for each given order id.

billing_status

Following values are possible:

paying – payments active (for subscriptions or installment payments)

completed – payment done/completed (one time payments or installment payments)

aborted – payments cancelled (for subscriptions or installment payments)

unpaid – not paid (for subscriptions or installment payments: no payment received)

reminding – reminder emails for payment are being sent

createBuyUrl() and Placeholder

If the order happened over a URL of the function createBuyUrl() and if placeholders were used (Parameter placeholders), those will be given as field “placeholders”.

cancel_policy

The field purchase.cancel_policy contains information on how the buyer may terminate subscriptions payments.

Possible values are:

  • empty string - the payment can be cancelled at any time - after cancellation no further payments will be done
  • Xm_0- the subscription will run for X months - after that it may be cancelled at any time. Example:
    • 12m_0: minimum time is one year
  • Xm_Ym- the subscription will run for X months. After that - if not cancelled - it is extended by Y month. Example:
    • 12m_3m minimum time is one year. If not cancelled it is extended by 3 months.
  • YYYY-MM-DD_Xm - minimum runtime is until the given date - after that it will extend by X months. Example:
    • 2025-07-30_3m - the subscription will run until 2025 July 30th - after that it will be extended by 3 months if not cancelled.

The field purchase.can_cancel_before contains the date the termination becomes effected. E.g. in the last example can_cancel_before is 2025-07-30.


refund_policy

Contains details on the refund policy of the purchase.

  • reason_code: – possible values are:
    • business – the refund policy was applied, because the buyeris a business.
    • consumer – the refund policy was applied, because the buyeris a consumer.
    • common – wether the buyer is a consumer or not, has no effect on the refund policy.
    • vendor- due to the special nature of the vendor's product, a custom rule was applied. Wether the buyer is a consumer or not, has no effect on the refund policy
  • delivery_type: The refund policy was applied due to the delivery type of the product. Possible values are:
    • digital – Digital (Download / online membership)
    • shipping
    • service
    • event – e.g. a seminar
    • (no value) – the delivery type does not have an effect on the refund policy.
  • checkbox_text: If the buyer confirmed the recission of the right to refund by checking a checkbox, this field contains the text of the chockbox.


See also:

getpurchasetracking()