Receipts

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 would be: `https://www.paypal.com/receipt/?id={paypal_invoice_id}'.

Request

curl -X GET https://api.paypal.com/v1/sales/transactions/{paypal_invoice_id}/receipt \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Content-Type: application/json'
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.paypal.com/v1/sales/transactions/{paypal_invoice_id}/receipt",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer {access_token}",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.paypal.com/v1/sales/transactions/{paypal_invoice_id}/receipt")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .build();

Response response = client.newCall(request).execute();

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

Parameter Description
authorization request header The access token for the merchant in which you're trying to obtain the receipt from.
paypal_invoice_id This 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.

Parameter Description
id Receipt ID. For PayPal Here, this is set to the PayPal Invoice ID.
receipt_items All of the purchased item information. All available fields within this object are required.
receipt_payment All 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_info All of the merchant's business information. All available fields within this object are required.
receipt_details Details 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

{  
  "id": "INV2-ACSD-T3LG-8L7A-W7R4",
  "receipt_items": {  
    "items": [  
      {  
        "name": "Item",
        "quantity": 1,
        "unit_price": {  
          "currency": "USD",
          "value": "1.0"
        },
        "calculated_price": {  
          "currency": "USD",
          "value": "1.0"
        },
        "taxes": [ ],
        "discounts": [ ],
        "additional_fees": [ ],
        "customer_data": [ ]
      }
    ],
    "taxes": [ ],
    "sub_total": {  
      "currency": "USD",
      "value": "1.00"
    },
    "discounts": [ ],
    "total": {  
      "currency": "USD",
      "value": "1.0"
    }
  },
  "receipt_payment": {  
    "payment_status": "CANCELLED",
    "payment_type": "AUTHORIZATION",
    "payment_time": "0",
    "authorized_amount": {  
      "currency": "USD",
      "value": "1.0"
    },
    "payment_card": {  
      "card_scheme": "CREDIT",
      "card_number": "2677",
      "authorization_code": "087202",
      "card_soft_description": "PP*PAYDIANTPAY",
      "icc_info": {  
        "pin_present":false,
        "signature_verified":false,
        "authorization_response_code": "00",
        "authorization_response_code_label": "APPROVED",
        "icc_application_cryptogram": "606C700D55FB5C0A",
        "icc_application_cryptogram_label": "TC",
        "icc_application_identifier": "A0000000041010",
        "icc_application_PAN_number": "01",
        "terminal_id": "7688",
        "transaction_status_information": "E800",
        "issuer_application_data": "011060700222000014E100000000000000FF",
        "terminal_verification_results": "0000008000"
      }
    },
    "payment_method": [  
      {  
        "name": "ICC",
        "amount": {  
          "currency": "USD",
          "value": "1.0"
        }
      }
    ],
    "payment_location": {  
      "latitude":42.3388173,
      "longitude":-71.2535543
    },
    "customer_data": [ ]
  },
  "merchant_info": {  
    "account_id": "BN33NU7YGPY78",
    "business_name": "Paydiant, Paypal",
    "business_address": {  
      "line1": "275 Grove Street",
      "city": "Aurbandale",
      "country_code": "US",
      "postal_code": "02466",
      "state": "MA"
    },
    "email_address": "paydiantconnectors@gmail.com",
    "country": "US",
    "preferred_language": "en_US",
    "time_zone": "America/Los_Angeles",
    "customer_data": [ ]
  },
  "store_info": { },
  "buyer_info": {  
    "address": { }
  },
  "receipt_details": {  
    "order_id": "sdk2test68797",
    "create_time": "1519325030",
    "is_seller_receipt":true,
    "customer_data":[ ]
  },
  "links":[  
    {  
      "href": "SELF",
      "rel": "https://api.paypal.com/v1/sales/transactions/INV2-ACSD-T3LG-8L7A-W7R4/receipt",
      "method": "GET"
    }
  ]
}

Next

Going live

Feedback