Receipts API for PayPal Here SDK

SDKDeprecated


Important: PayPal Here is deprecated. PayPal doesn't accept new integrations but continues to support existing integrations.

When transactions are ran as authorizations, the SDK does not present a receipt UI to send a receipt to the customer. Therefore, since this UI is not provided, PayPal provides a way to obtain the EMV compliant information that you would include on your own receipt that's provided to the customer.

Note: As an alternative to using the Receipts API, you can simply provide a link to PayPal's web receipt and also be compliant. An example web receipt link is https://www.paypal.com/receipt/?id={paypal_invoice_id}.

Request

  1. cURL
  2. PHP
  3. Java
1curl -X GET https://api-m.paypal.com/v1/sales/transactions/{paypal_invoice_id}/receipt
2-H 'Authorization: Bearer {access_token}'
3-H 'Content-Type: application/json'

Provide a PayPal invoice ID and an Authorization header in your GET request:

ParameterDescription
authorization request headerThe access token for the merchant in which you're trying to obtain the receipt from.
paypal_invoice_idThis is the invoice ID assigned by PayPal for the transaction, for example: INV2-B3AD-S2B2-A72B-GQAP.

Response

There are more fields in the response than what's shown below, but what's outlined below are the required parameters to be made available to your customers so that you are compliant.

ParameterDescription
idReceipt ID. For PayPal Here, this is set to the PayPal Invoice ID.
receipt_itemsAll of the purchased item information. All available fields within this object are required.
receipt_paymentAll of the necessary payment information.
The following fields are NOT required: authorization_response_code
icc_application_cryptogram
icc_application_cryptogram_label
icc_application_PAN_number
transaction_status_information
issuer_application_data
terminal_verification_results
All other fields are required.
merchant_infoAll of the merchant's business information. All available fields within this object are required.
receipt_detailsDetails about the receipt.

Note: The value of ICC (Integrated Circuit Card) is what you will see returned for the payment method name of a Chip transaction. This MUST be translated to Chip Read when it's displayed to your customer.

Example of a full response

1{
2 "id": "INV2-ACSD-T3LG-8L7A-W7R4",
3 "receipt_items": {
4 "items": [
5 {
6 "name": "Item",
7 "quantity": 1,
8 "unit_price": {
9 "currency": "USD",
10 "value": "1.0"
11 },
12 "calculated_price": {
13 "currency": "USD",
14 "value": "1.0"
15 },
16 "taxes": [ ],
17 "discounts": [ ],
18 "additional_fees": [ ],
19 "customer_data": [ ]
20 }
21 ],
22 "taxes": [ ],
23 "sub_total": {
24 "currency": "USD",
25 "value": "1.00"
26 },
27 "discounts": [ ],
28 "total": {
29 "currency": "USD",
30 "value": "1.0"
31 }
32 },
33 "receipt_payment": {
34 "payment_status": "CANCELLED",
35 "payment_type": "AUTHORIZATION",
36 "payment_time": "0",
37 "authorized_amount": {
38 "currency": "USD",
39 "value": "1.0"
40 },
41 "payment_card": {
42 "card_scheme": "CREDIT",
43 "card_number": "2677",
44 "authorization_code": "087202",
45 "card_soft_description": "PP*PAYDIANTPAY",
46 "icc_info": {
47 "pin_present":false,
48 "signature_verified":false,
49 "authorization_response_code": "00",
50 "authorization_response_code_label": "APPROVED",
51 "icc_application_cryptogram": "606C700D55FB5C0A",
52 "icc_application_cryptogram_label": "TC",
53 "icc_application_identifier": "A0000000041010",
54 "icc_application_PAN_number": "01",
55 "terminal_id": "7688",
56 "transaction_status_information": "E800",
57 "issuer_application_data": "011060700222000014E100000000000000FF",
58 "terminal_verification_results": "0000008000"
59 }
60 },
61 "payment_method": [
62 {
63 "name": "ICC",
64 "amount": {
65 "currency": "USD",
66 "value": "1.0"
67 }
68 }
69 ],
70 "payment_location": {
71 "latitude":42.3388173,
72 "longitude":-71.2535543
73 },
74 "customer_data": [ ]
75 },
76 "merchant_info": {
77 "account_id": "BN33NU7YGPY78",
78 "business_name": "Paydiant, Paypal",
79 "business_address": {
80 "line1": "275 Grove Street",
81 "city": "Aurbandale",
82 "country_code": "US",
83 "postal_code": "02466",
84 "state": "MA"
85 },
86 "email_address": "paydiantconnectors@gmail.com",
87 "country": "US",
88 "preferred_language": "en_US",
89 "time_zone": "America/Los_Angeles",
90 "customer_data": [ ]
91 },
92 "store_info": { },
93 "buyer_info": {
94 "address": { }
95 },
96 "receipt_details": {
97 "order_id": "sdk2test68797",
98 "create_time": "1519325030",
99 "is_seller_receipt":true,
100 "customer_data":[ ]
101 },
102 "links":[
103 {
104 "href": "SELF",
105 "rel": "https://api-m.paypal.com/v1/sales/transactions/INV2-ACSD-T3LG-8L7A-W7R4/receipt",
106 "method": "GET"
107 }
108 ]
109 }

Next

Go live.