Get transaction by invoiceId in paypal api - paypal

I'm looking for the correct endpoint to use in the Paypal API for looking up a transaction by invoice id. We submit the invoice id to paypal when redirecting customers to PayPal for payment on their site. In order for us to resolve abandoned carts correctly, I need to look these invoice ids back up in paypal to see if there are completed transactions or not. Thanks.

You can use the TransactionSearch API, and use the INVNUM as the criteria to search by. The API Endpoint will depend on if you are trying this on live or sandbox, what type of format you are using, and what type of authentication you are using. You can find a list of the endpoints here.

Related

Integrating Paypal Payment and Invoicing APIs

I have been manually issuing invoices to charge my clients for services using Paypal.
Now I am creating an interface to allow them to purchase the services automatically on my website.
I also want to show them a history of their purchases. However, I cannot show a history of paid invoices using the Transaction Search API; I need to use the Invoicing > Search Invoices API.
I have used the Paypal Payments API to manage the payment side of new products, which now correctly produces an itemised transaction and allows the customer to checkout. But this does not produce an invoice.
How can I simultaneously produce an invoice (i.e which can be retrieved by the Invoicing API to show previous payments) and allow the customer to pay it? It seems like the Invoicing API works around the idea of sending an invoice to client by email, but this is unnecessary. I want them to pay it immediately (and already have the Payment API setup for this).
So what would a useful workflow be?: Use my Paypal Payment API to receive and authorise the payment, and on authorisation, use the Invoicing API to produce an invoice which reflects this and then updates the invoice status to paid? Or am I missing something easier here?
The Invoicing API is not meant to be mixed or used with any other API. It is for generating invoices to be sent by email or in link form.
General ecommerce payment processing (without invoice links) is entirely separate, there is no crossover. You should ensure you are using the current v2/checkout/orders API to receive new payments, not older v1 APIs.
As far as displaying a list of previous purchases to your customers, you shouldn't reply on PayPal for this (except perhaps in the case of invoices since this is part of the point of offloading invoice management to PayPal). But for normal web purchases, PayPal is not a database -- it is a payment processing service. Keep track of all your own order information, and simply store PayPal transaction IDs when they complete for your own accounting records -- but the ID you reference with the customer should be your own unique order ID, which you can pass to PayPal in your purchase_units[0].invoice_id when you create an order for checkout approval.

CyberSource: Retrieve Capture Token from PayPal Transaction Details

I'm trying to retrieve the capture request token from past PayPal transactions as I need that for refunding customers. We don't have that info anywhere on our systems anymore because, just don't even ask. It looks kind of like this:
AxjrrwSTQDiO3h+N6P5RABJPE8jCJjo7f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=
Is it possible to get that?
I looked at PayPal's Transaction Search API here and nothing in the response says that field exists:
https://developer.paypal.com/docs/api/transaction-search/v1/
I have also checked the built-in reports on PayPal but they don't give us that either.
Furthermore, I have tried the REST API with CyberSource and that doesn't provide the Token either:
https://developer.cybersource.com/api-reference-assets/index.html#transaction-details
I have the PayPal Generated Transaction ID, the dates, our reference numbers, etc. All I need is that Capture Request Token. I will then be able to refund customers using CyberSource.
Any help or ideas would be most appreciated.
That's a CyberSource token, so you won't find it anywhere within PayPal.
The PayPal REST API itself (no CyberSource) doesn't require it for refunds, only the transaction ID: https://developer.paypal.com/docs/api/payments/v2/#captures_refund

Is there any PayPal API that can retrieve button options from a transaction id?

I am trying to create some tools to manage our paypal account and I can't find a PayPal API that actually returns the purchase options when orders are made from PayPal buttons.
The REST APIs for sales and orders don't seem to return option names or option values.
The NVP API GetTransactionDetails only returned 2 of the 4 options I have set on the button.
Has anyone been able to retrieve this information through any API? I can see them when I look at transaction details on the PayPal site.

Retrieve transaction ID via rest API

My application uses PayPal java library to make payments. Everything works fine but I can't understand one thing. What exactly is transaction code? Let's say I make a payment and then approve it. As a result I receive the JSON object which has an ID (PAY-*) and transactions->related resources->sale->ID. Both of them I store in the DB in order to show later to user (in case he wants to refund the money). But if I see these payments from PayPal customer portal, in the descriptions of payment I see non of these ID's.. Transaction code is totally different! So which one of them should I store?
Thank you in advance
PayPal generally uses a transaction ID. It's a 16 character alphanumeric string. This will appear in both your API response and the PayPal site. Assuming REST is like Classic, the Transaction ID is how you will reference the payment for any future operations (capture, refund, etc).
Please note that if you're using Express Checkout (where the customer pays via PayPal account) they will have their own transaction ID for the exact same transaction.

Paypal REST API: is sale id the same as transaction id?

I'm trying to determine a way to issue a refund for the user's order using the PayPal REST API. After taking a look at this section, I see that in the documentation on the left PayPal uses the terms "id" and "sale_id", while in the example on the right I see {transactionId}. The docs seem to be using the term "sale id" and "transaction id" interchangeably. Should I believe the example, and go ahead and use the transaction id I received via IPN earlier to issue a refund for the order?
Yes. sale_id is the same as transaction id in your PayPal account and IPN messages.