PayPal Payments Standard and Button Manager: Getting Started
- The Buy Now button is deprecated. For new integrations, see the PayPal Checkout Overview.
- The Donate button is deprecated. For new integrations, see the Create a Donate button.
- The Add to Cart button is deprecated. For new integrations, see the Solution Providers page.
- The Subscribe button is deprecated. For new integrations, see the Subscriptions Overview.
Get up and running with this service:
PayPal Payments Standard is the simplest of the PayPal payment services: it helps you add a no-frills payment button, donation button, and so on to a web page. The person who clicks the payment button is redirected from the merchant site to PayPal and then back to the merchant site.
This guide is about the Button Manager API of PayPal Payments Standard.
This guide does not explain how to create buttons manually. This brief summary describes the options for creating a button without the API:
- Create an HTML form from scratch. To understand which variables control the button per your needs, see HTML Form Basics for PayPal Payments Standard.
- Visit the PayPal site and confirm that you are ready to accept payments. Select the button type that you like, provide various facts about your site and the item or service you are selling, and PayPal generates HTML code for you. Then, copy this HTML code and embed it in your web page where you want the PayPal button to appear.
You can make calls in these formats:
|Request method||Request format||Response format|
|HTTP POST||Name/value pairs||Name/value pairs|
|HTTP POST||SOAP (1.1, 1.2)||SOAP|
Make your first call
The following example calls
BMCreateButton in the Sandbox to create an button through the specified app (signified by combo of USER, PWD, SIGNATURE). The button is associated with details stored at PayPal.com regarding the item for sale.
Obtain the endpoint for the service and environment you are addressing. The example below uses the Sandbox endpoint for a name-value pair format by using a Signature authentication:
For the list of endpoints including the SOAP endpoints, see NVP/SOAP API endpoints.
Provide the authentication. For the following sample call, set authentication credentials through the parameters that you pass to the call.
// Sandbox API credentials for the API Caller account USER : // user id PWD : // password SIGNATURE : // signature VERSION : // the release version of the API
Provide parameters needed by the specific call being made. For this example, see also the BMCreateButton (SOAP) reference.
METHOD : BMCreateButton BUTTONCODE : HOSTED BUTTONTYPE : CART BUTTONSUBTYPE : PRODUCTS BUTTONCOUNTRY : US L_BUTTONVAR1 : item_name%3Dshoehorn L_BUTTONVAR2 : amount%3D1464.46 L_BUTTONVAR3 : tax=%3D21 L_BUTTONVAR4 : item_number%3D123456
You can now make a call.
Make the call. For an example, see Try It.
Evaluate the response.
For the following Try It example, you might get something like the following, which has been split to multiple lines for readability:
ACK=Success // a URL-encoded HTML form that you could embed in a web page &WEBSITECODE=%3cform%20target%3d%22paypal%22%20action%3d%22 https%3a%2f%2fwww%2esandbox%2epaypal%2ecom%3d%22 ... // a URL you could include in an email (or any document supporting external links) &EMAILLINK=https%3a%2f%2fwww%2esandbox%2epaypal%2ecom%2fcgi%2dbin%2fwebscr ... // the ID of the PayPal-hosted button (with its information about the item available for purchase) &HOSTEDBUTTONID=3PGCSXEGMJZJY // additional artifacts of a job run &TIMESTAMP=2011%2d08%2d11T07%3a40%3a46Z&CORRELATIONID=53ed2d7aea58a&VERSION=51%2e0&BUILD=2020243
And, to make it readable for your insight, let's URL-decode bits of it.
WEBSITECODE=<form target="paypal" action="https://www.sandbox.paypal.com" ... &EMAILLINK=https://www.sandbox.paypal.com/cgi-bin/webscr...
Copy this cURL command:
curl https://api-3t.sandbox.paypal.com/nvp \ -s \ --insecure \ -d USER=platfo_1255077030_biz_api1.gmail.com \ -d PWD=1255077037 \ -d SIGNATURE=Abg0gYcQyxQvnf2HDJkKtA-p6pqhA1k-KTYE0Gcy1diujFio4io5Vqjf \ -d VERSION=51.0 \ -d METHOD=BMCreateButton \ -d BUTTONCODE=HOSTED \ -d BUTTONTYPE=CART \ -d BUTTONSUBTYPE=PRODUCTS \ -d BUTTONCOUNTRY=US \ -d L_BUTTONVAR1=item_name%3Dshoehorn \ -d L_BUTTONVAR2=amount%3D1464.46 \ -d L_BUTTONVAR3=tax=%3D21 \ -d L_BUTTONVAR4=item_number%3D123456
Run the cURL command. If necessary, download the free cURL executable.
To confirm that you set up your sandbox accounts correctly, try the same example with your own credentials:
Set up your sandbox environment.
To make test calls, you need a Sandbox account, test users, and PayPal API credentials. If you have not yet set these up, see PayPal sandbox Testing Guide.
Substitute your own Sandbox credentials and user-specific inputs in the Try It example and rerun it to confirm that you set up your Sandbox and users correctly.
- Main WSDL: https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl
- Referenced XSD: https://www.paypalobjects.com/wsdl/eBLBaseComponents.xsd
- Referenced XSD: https://www.paypalobjects.com/wsdl/CoreComponentTypes.xsd
- Referenced XSD: https://www.paypalobjects.com/wsdl/EnhancedDataTypes.xsd