Accessing the "Ship To" Address from a Paid (with type PAYPAL) Invoice

khoanguyen_t
New Community Member

I'm currently using the Invoice v1 API in my web application to draft and send invoices to customers. Once the invoice is paid, I'm fetching the invoice details to send an email, however, the `shipping_info` is always blank or not even there.

 

So from what I can gather, most of our customers usually pay their invoices directly with PayPal itself. I tried using the `transaction_id` to fetch further info, but there doesn't seem to be any way to grab the `shipping_info` directly off the payment made for an invoice?

 

a snippet from a invoice response:

{"payments": [{
      "type": "PAYPAL",
      "transaction_id": "<transaction_id>",
      "transaction_type": "SALE"
    }]}

Using the `transaction_id` with `v1/payments/sale/<transaction_id>`:

{
  "id": "<transaction_id>",
  "state": "completed",
  "amount": {
    "total": "1.00",
    "currency": "USD",
    "details": {
      "subtotal": "1.00"
    }
  },
  "payment_mode": "INSTANT_TRANSFER",
  "protection_eligibility": "ELIGIBLE",
  "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
  "transaction_fee": {
    "value": "1.00",
    "currency": "USD"
  },
  "invoice_number": "INV2-0000-0000-0000-0000",
  "create_time": "2019-04-29T22:48:57Z",
  "update_time": "2019-04-29T22:48:57Z",
  "links": [
    {
      "href": "https://api.paypal.com/v1/payments/sale/<transaction_id>",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.paypal.com/v1/payments/sale/<transaction_id>/refund",
      "rel": "refund",
      "method": "POST"
    }
  ]
}

Curiously, the sandbox API actually returns `parent_payment` inside the response from requesting v1/payments/sale/<transaction_id>, which I have successfully used to grab the "Ship To" address.

 

I would really like to know if there's any way to get the `parent_payment` from an invoice sale transaction.

 

Thanks!

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.