Set Custom Values to PayPal's Billing Agreements created via API - paypal

Is it possible to set custom values while creating an agreement using PayPal's Billing Agreements API? I would like these values to be returned by the IPN system.
For example, I want to pass a "purchase id" to the agreement.

using PayPal's Billing Agreements API
Be more specific, there are several classic or REST APIs this could be referring to. Each have their own API reference on https://developer.paypal.com
In general there are two parameters you can use, which will be named slightly differently depending on the API request you are using to actually create the transaction or recurring profile:
invoice or invoice_id :: by default must be unique, never before used for a successful transaction on your account, prevents accidental/duplicate payments
custom or custom_id :: can be anything

Related

API calls required to obtain buyer's e-mail

I'm using PayPal Express checkout with BigCommerce with a sandbox account. Via the BigCommerce API, only one field is supplied, which is also listed via the http://www.sandbox.paypal.com interface as the "Unique Transaction ID" under "Details":
<payment_provider_id>0P192574JB861364C</payment_provider_id>
The orders are going from BigCommerce into an ERP system that, for PayPal Express orders, expects the PayPal username (e-mail) to be provided.
Via the PayPal REST API (or otherwise), is there a way derive the e-mail used during the transaction via the transaction ID?
If so, which API call(s) would be necessary to get the e-mail?
Thanks.
The GetTransactionDetails of the classic NVP/SOAP APIs will let you get the buyer's e-mail with only a transaction ID.
Info is here: https://developer.paypal.com/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/

PayPal REST Subscriptions API not showing price in order summary

I am testing the PayPal REST API for subscriptions in the sandbox environment, and have noticed that, when going to the approval URL returned after creating an agreement, no price is shown under the order summary pane on the left of the page. A description is shown but no price/tax etc.
The plan id is passed to the call to create an agreement, which contains the information that I would expect to see as a user when approving the payment. Is this a bug or is there something that I am supposed to enable in the merchant account, or perhaps something additional that needs to be sent when creating the agreement? I've read other posts regarding this on stack overflow (although they predate the creation of the subscriptions REST API) talking about passing a transaction field, but this isn't valid in the subscriptions create agreement schema.
Your observations are (currently) correct. As REST API based Billing Plans are based on Express Checkout Recurring Payments, you're going to see a similar behavior.
Right now, there are two options:
You populate the description with more agreement details.
You pass a regular description and make sure the customer is aware of the billing terms before your execute the agreement.
Going forward, we're likely going to include this info in some later updates. I'm following up with that to make sure a user story is filed for this.

Paypal REST API: add a payment experience to a billing agreement

If you want to customise your store when using the payment endpoint, that's fine, you can create a payment experience and then pass the payment_experience_id to the payment endpoint.
But what if you're using the billing agreement endpoint? I notice there's no payment_experience_id field, so how do you customise the store? Can't find anything about this in the API docs.
In the PayPal standard & express payment payment reference docs, e.g.:
https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
... see the fields PAGESTYLE for the direct equivalent of the REST payment experience (a group of setting that you set up at an account level and apply to the payment experience as a set), or the fields HRDIMG, PAGEFLOWCOLOR, CARTBORDERCOLOR, LOGOIMG, and BRANDNAME fto override any single piece of the experince for a particular payment.

Retrieving Billing Type in PayPal Express Checkout for recurring payments

I'm setting up a payment engine for a custom framework using PayPal Express Checkout. One of the business requirements is adding support for recurring payments. I've found documentation on how to implement this at https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECRecurringPayments
The thing I don't quite understand is how to retrieve the value of BillingType from the API after I've set it via SetExpressCheckout to "RecurringPayments". It doesn't seem to appear anywhere in the response data I get back from neither GetExpressCheckoutDetails nor DoExpressCheckoutPayment. I need this to know whether I need to create a recurring payments profile or not. So as far as I can tell my only option is to store the value of BillingType in my database and query it again after DoExpressCheckoutPayment. This works for me but I find it odd that this data would not be returned at all by the API. Am I missing something? Or is there another way of correctly implementing recurring payments?
Not all data you send in a request is returned in a response. You already have what you're passing to them...there's really no need for them to pass it back.
You could use session variables to save the data instead of the database, or you could log all of your API requests and refer to those logs when you need to see what you sent, but again, your application is what's telling PayPal whether or not the payment should include billing agreement information...not the other way around.

Which Paypal API for preapproved payments?

I'm trying to implement PayPal on a completely custom shopping cart and have been unable to figure out which API for recurring payments we need.
We ship a physical product every 2, 3, 4, 6 months so shipment and payment have to both happen together. In addition it must be easy for the user to change their shipment date - or add or remove items to their regular shipments without too much stress (either on their part or mine).
I've generally looked at Paypal's recurring billing as more suited to software based subscriptions and I don't think this is the API I need. I'd like to just bill the customer via a billing agreement and then initiate the shipment.
The way Skype does it seems to be ideal - they establish a billing agreement (shown in my PayPal account under 'My account > Profile > Pay List'
but I cannot seem to find that in the SOAP API document.
What is the API I need to create a billing agreement that I can trigger whenever I want. Can this be done with Express Checkout API ?
The API you are looking for is called reference transactions. This allows you to set up a billing agreement with a customer, get back a token, and then use that token to issue charges in the future. It can be done via the Express Checkout API.
You have to contact PayPal customer support to get this activated for your account before you can use it.