Billing Agreement Customer Information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to prefill in the customer details specifically on Billing Agreements through the REST API? This would seem like a standard supported feature, but I am unable to find the documentation anywhere. Utilizing the API documentation and the new v2.0-beta SDK our transactions are properly executing and billing agreements are active.
The below JSON is passed to PayPal with the payor information via AgreementCreateRequest. The information itself is correct and the JSON objects are valid. Should this be located elsewhere or is this not specifically supported by Billing Agreements?
{ "name":"Product Name", "description":"Product Description", "start_date":"2018-04-04T2:52:56Z", "payer":{ "payment_method":"paypal", "payer_info":{ "first_name":"John", "last_name":"Doe", "email":"email-address-removed", "billing_address":{ "line1":"1234 Main Street", "line2":"", "city":"Atlanta", "state":"GA", "country_code":"US", "postal_code":"30326" } } }, "plan":{ "id":"P-5M7848894Y828350BRTNMNLA" } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For further clarification, this is related to the Express Checkout. Customers are redirected to PayPal to the billing agreement approval URL at which point they are forced to refill in all fields that were passed to PayPal upfront.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MTS_Andre Thanks for the reply. I am indeed referring to the Agreement Checkout. However, passing the information in the JSON structure with the shipping address is ignored and does not solve the issue.
JSON sent from PayPal\v1\BillingAgreements\AgreementCreateRequest()
{ "name":"Product Name", "description":"Product Description", "start_date":"2018-04-04T2:52:56Z", "payer":{ "payment_method":"paypal", "payer_info":{ "first_name":"John", "last_name":"Doe", "email":"email-address-removed", "billing_address":{ "line1":"1234 Main Street", "line2":"", "city":"Atlanta", "state":"GA", "country_code":"US", "postal_code":"30326" }, "shipping_address":{ "line1":"1234 Main Street", "line2":"", "city":"Atlanta", "state":"GA", "country_code":"US", "postal_code":"30326" } } }, "plan":{ "id":"P-5M7848894Y828350BRTNMNLA" }, "shipping_address":{ "line1":"1234 Main Street", "line2":"", "city":"Atlanta", "state":"GA", "country_code":"US", "postal_code":"30326" } }
Result is still only a partially filled form with the following missing from the original sent information:
- First Name
- Last Name
I'm assuming this is being pulled from outside the payer_info object?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand, can you send a screenshot of the form that is now returning (with missing details) and one where you eventually highlight where they should be? So to have an idea we are on the same page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure.
JSON Structure for Billing Agreement
$client = new PayPalHttpClient($credentials); $body = '{ "name": "' . $buyer['title'] . '", "description": "' . $buyer['description'] . '", "start_date": "' . date('Y-m-d\Tg:i:s\Z', strtotime('+1 days')) . '", "payer": { "payment_method": "paypal", "payer_info": { "first_name": "' . $buyer['first_name'] . '", "last_name": "' . $buyer['last_name'] . '", "email": "' . $buyer['email'] . '", "billing_address": { "line1": "' . $buyer['billing']['line1'] . '", "line2": "' . $buyer['billing']['line2'] . '", "city": "' . $buyer['billing']['city'] . '", "state": "' . $buyer['billing']['state'] . '", "country_code": "' . $buyer['billing']['country_code'] . '", "postal_code": "' . $buyer['billing']['postal_code'] . '" }, "shipping_address": { "line1": "' . $buyer['billing']['line1'] . '", "line2": "' . $buyer['billing']['line2'] . '", "city": "' . $buyer['billing']['city'] . '", "state": "' . $buyer['billing']['state'] . '", "country_code": "' . $buyer['billing']['country_code'] . '", "postal_code": "' . $buyer['billing']['postal_code'] . '" } } }, "plan": { "id": "' . $plan_id . '" } }'; $request = new AgreementCreateRequest();
Buyer Array for Billing Agreement
Array ( [user_id] => 1 [company] => [first_name] => John [last_name] => Die [email] => email-removed [title] => Product Title [description] => Product Description [billing] => Array ( [line1] => 1234 Main Street [line2] => [city] => Atlanta [state] => GA [country_code] => US [postal_code] => 30326 ) )
JSON sent from AgreementCreateRequest
{ "name": "Product Title", "description": "Product Description", "start_date": "2018-04-06T11:58:03Z", "payer": { "payment_method": "paypal", "payer_info": { "first_name": "John", "last_name": "Die", "email": "email-removed", "billing_address": { "line1": "1234 Main Street", "line2": "", "city": "Atlanta", "state": "GA", "country_code": "US", "postal_code": "30326" }, "shipping_address": { "line1": "1234 Main Street", "line2": "", "city": "Atlanta", "state": "GA", "country_code": "US", "postal_code": "30326" } } }, "plan": { "id": "P-13P40544TB028345SS2DWOFY" } }
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Paypal NVP/SOAP API - Pay in 4 instalment payments in NVP/SOAP APIs
- can we assign a unique detail to every subscription creation? in NVP/SOAP APIs
- Integrating buttons into my website 2024 in PayPal Payments Standard
- Enable PayPal Billing Address Request on sandbox account in REST APIs
- Is it possible to set multiple billing agreements in SetExpressCheckout? in NVP/SOAP APIs