Integrating PayPal Express Checkout button¶
The PayPal Express Checkout button offers your customers another way to pay, and it complements your existing PayPal payment flow. It will provide a one-click checkout solution without the need of asking the billing and shipping addresses. This allows you to place the button on any page in your webshop, like the product page.
We recommend you to use the button that we provide in the Mollie Resources pack. This button is recognizable to customers and improves checkout conversion. Of course it’s also possible to design and use your own button, according to the PayPal brand guidelines.
The button can be used when your account is fully setup at PayPal and Mollie. Make sure that your account is a PayPal Business account and that you linked your PayPal account to Mollie as described in our help center article.
Using the button requires the Orders API. You can use your existing integration with the Orders API with only some small tweaks. You can use the following steps as a guideline for the basic integration:
Place the button on the intended page, like a product page.
Your website creates an order via the Orders API after the consumer clicks the button. Make sure you set method to
paypalso that the
billingAddressfield will not be required anymore.
billingAddressstays required for every other method. If you set another method, or no method at all, your request will result in an HTTP status code
422 Unprocessable Entity.
Redirect your customer to the
checkoutURL which you can find in the response of the Create Order API. The customer will select the address where the product(s) needs to be send to and completes the payment.
Mollie will receive the address from PayPal and adds it to the order. The consumer will be redirected back to your website while we call your webhook, if set, to inform you about the latest order state.
You can retrieve the shipping address by calling the Get order API and finish your order to ship the product(s).