PayPal v2 introduces the PayPal Checkout, featuring a RESTful API solution that includes standard checkout, PayPal Express, and the innovative PayPal Vault functionality. These versatile and powerful payment solutions are designed to enhance the e-commerce experience for both merchants and their customers. By allowing customers to quickly complete transactions using their PayPal accounts, this integration helps reduce cart abandonment and speeds up the payment process.
PayPal v2 streamlines authentication and approval steps, ensuring a secure, efficient, and user-friendly checkout experience for your e-commerce platform. Beyond the standard checkout, the platform also offers the flexibility to use the JavaScript SDK to render PayPal buttons and respond to various PayPal events.
We offer the flexibility to implement payment options across multiple pages:
PayPal Checkout v2 manages the standard checkout process. For more details about the Product page and Shopping Cart page, please refer to our PayPal Express v2 implementation guide.
PayPal allows the configuration of the initiation script via Query parameters to help define specific content or actions based on the data being passed. Each piece of data sent contains:
In this example, the script includes the following query parameters:
<script src="https://www.paypal.com/sdk/js?client-id=Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&merchant-id=LXXXXXXXXXXXXX¤cy=EUR&intent=authorize&locale=de_DE&commit=true&vault=false&disable-funding=card,sepa,bancontact&enable-funding=paylater"></script>
For debug purpose you can also add the parameter
debug: true/false
Merchants have two options for rendering the PayPal button: they can opt for a dynamic PayPal button or use the standard JavaScript SDK to create buttons and respond to key events (such as onApprove, onError, onCancel, and onShippingChange).
The JavaScript Button Renderer offers a simple and efficient way to integrate the PayPal button into your website, enhancing both functionality and user experience. To ensure the PayPal button operates smoothly and provides a seamless checkout process, you'll need to prepare the following components:
|
The display of payment and shipping details may change based on the shipping address retrieved from PayPal. Therefore, you have the option to modify or update your order after being redirected from PayPal back to the merchant's site.
Before making specific API requests for PayPal v2, you should familiarize yourself with the general Payone Server API interface definition as outlined in Channel Server API - Platform - PAYONE docs.
In this section we will describe the request chain specific remarks for PayPal Checkout v2 integration.
POST Request - Pre-/ Authorization
request
required
|
Fixed Value: preauthorization / authorization
|
mid
required
|
your merchant ID, 5-digit numeric
|
aid
required
|
your subaccount ID, 5-digit numeric
|
portalId
required
|
your Portal ID, 7-digit numeric
|
key
required
|
your key value, alpha-numeric
|
clearingtype
required
|
Fixed Value: wlt
|
amount
required
|
Format NUMERIC(1..10)
Permitted values max. +/- 19 999 999 99
Specifies the total gross amount of a payment transaction. Value is given in smallest currency unit, e.g. Cent of Euro; Pence of Pound sterling; Öre of Swedish krona. The amount must be less than or equal to the amount of the corresponding booking. |
currency
required
|
Fixed Value EUR
|
narrative_text
optional
|
Format CHAR(1..81)
Dynamic text element on account statements (3 lines with 27 characters each) and credit card statements. |
add_paydata[redirection_mode] is a required parameter if the JavaScript SDK is used.
add_paydata[redirection_mode]
required
|
Fixed Value: DIRECT_TO_MERCHANT
This parameter is utilized exclusively when the JavaScript SDK is implemented and the payment method is not PayPal Express. It signifies the specific redirection value to be used after the customer completes the transaction with PayPal. |
customerid optional
|
Format CHAR(1..20)
Permitted Symbols [0-9, a-z, A-Z, .,-,_,/] Merchant's customer ID, defined by you / merchant to refer to the customer record. "customerid" can be used to identify a customer record.
If "customerid" is used then stored customer data are loaded automatically. |
userid optional
|
Format NUMERIC(6..12)
PAYONE User ID, defined by PAYONE |
salutation optional
|
Format CHAR(1..10)
The customer's salutation |
title optional
|
Format CHAR(1..20)
Samples
Dr / Prof. / Dr.-Ing. Title of the customer |
firstname optional
|
Format CHAR(1..50)
First name of customer; optional if company is used, i.e.: you may use "company" or "lastname" or "firstname" plus "lastname" |
lastname
required
|
Format CHAR(2..50)
Last name of customer; optional if company is used, i.e.: you may use "company" or "lastname" or "firstname" plus "lastname" |
company optional
|
Format CHAR(2..50)
Comany name of customer; optional if company is used, i.e.: you may use "company" or "lastname" or "firstname" plus "lastname" |
street optional
|
Format CHAR(1..50)
Street number and name (required: at least one character) |
addressaddition optional
|
Format CHAR(1..50)
Samples
7th floor / c/o Maier Specifies an additional address line for the invoice address of the customer. |
zip optional
|
Format CHAR(2..50)
Permitted Symbols [0-9][A-Z][a-z][_.-/ ]
Postcode |
city optional
|
Format CHAR(2..50)
City of customer |
country
required
|
Fixed Value DE
|
email optional
|
Format CHAR(5..254)
Mandatory if "add_paydata[shopping_cart_type]=DIGITAL" Permitted Symbols RFC 5322 Special Remark email validation: Max. length for email is 254 characters. Validation is set up in the following way: Username = Max. 63 characters Domain Name = Max. 63 characters "@" and "." is counted as a character as well; in case of a total of three suffixes, this would allow a total of 254 characters. email-address of customer |
telephonenumber optional
|
Format CHAR(1..30)
Phone number of customer |
birthday optional
|
Format DATE(8), YYYYMMDD
Samples
20190101 / 19991231 Date of birth of customer |
language optional
|
Format LIST
Permitted values ISO 639-1 (Language)2-letter-codes
Language indicator (ISO 639) to specify the language that should be presented to the customer (e.g. for error messages, frontend display). If the language is not transferred, the browser language will be used. For a non-supported language English will be used. |
vatid optional
|
Format CHAR(1..50)
VAT identification number. Used for b2b transactions to indicate VAT number of customer. |
gender optional
|
Format LIST
Permitted values f / m / d
Gender of customer (female / male / diverse* ) * currently not in use |
personalid optional
|
Format CHAR(1..32)
Permitted Symbols [0-9][A-Z][a-z][+-./()]
Person specific numbers or characters, e.g. number of passport / ID card |
ip
optional
|
Format CHAR(1..39)
Customer's IP-V4-address (123.123.123.123) or IP-V6-address |
shipping_firstname required
|
Format CHAR(1..50)
First name of delivery address |
||||||||
shipping_lastname
required
|
Format CHAR(1..50)
Surname of delivery address |
||||||||
shipping_company
optional
|
Format CHAR(2..50)
Company name of delivery address |
||||||||
shipping_street optional
|
Format CHAR(2..50)
Street number and name of delivery address |
||||||||
shipping_zip
required
|
Format CHAR(2..50)
Postcode of delivery address |
||||||||
shipping_addressaddition optional
|
Format CHAR(1..50)
Specifies an additional address line for the delivery address of the customer, e.g. "7th floor", "c/o Maier". |
||||||||
shipping_country optional
|
Format LIST
Permitted values ISO 3166 2-letter-codes
Samples
DE / GB / US Specifies country of address for the customer. Some countries require additional information in parameter "state" |
||||||||
shipping_state
optional
|
Format LIST
Permitted values ISO 3166-2 States (regions) 2-letter-codes
|
wallettype required
|
Fixed Value: PAL
|
successurl
required
|
Format CHAR(2..255)
Scheme <scheme>://<host>/<path> <scheme>://<host>/<path>?<query> scheme-pattern: [a-zA-Z]{1}[a-zA-Z0-9]{1,9}
URL for "payment successful" |
errorurl
required
|
Format CHAR(2..255)
Scheme <scheme>://<host>/<path> <scheme>://<host>/<path>?<query> scheme-pattern: [a-zA-Z]{1}[a-zA-Z0-9]{1,9}
URL for "faulty payment" |
backurl
required
|
Format CHAR(2..255)
Scheme <scheme>://<host>/<path> <scheme>://<host>/<path>?<query> scheme-pattern: [a-zA-Z]{1}[a-zA-Z0-9]{1,9}
URL for "Back" or "Cancel" |
it[n] optional
|
Required for physical goods in order to ensure PayPal seller protection |
||||||||||
id[n]
optional
|
Format CHAR(1..32)
Array Array elements [n] starting with [1]; serially numbered; max [400]
Permitted Symbols [0-9][a-z][A-Z], .,-,_,/
Required for physical goods in order to ensure PayPal seller protection International Article Number (EAN bzw. GTIN) Product number, SKU, etc. of this item |
||||||||||
pr[n]
optional
|
Format NUMERIC(10) max. 19 999 999 99
Array elements [n] starting with [1]; serially numbered; max [400]
Required for physical goods in order to ensure PayPal seller protection Unit gross price of the item in smallest unit! e.g. cent. Value negative for refund like -1500 for refund of 15 EUR |
||||||||||
no[n]
optional
|
Format NUMERIC(6)
Array elements [n] starting with [1]; serially numbered; max [400] Required for physical goods in order to ensure PayPal seller protection Quantity of this item |
||||||||||
de[n]
optional
|
Format CHAR(1..255)
Array elements [n] starting with [1]; serially numbered; max [400] Required for physical goods in order to ensure PayPal seller protection Description of this item. Will be printed on documents to customer. |
||||||||||
va[n]
optional
|
Format NUMERIC(4)
VAT rate (% or bp) Array elements [n] starting with [1]; serially numbered; max [400] |
status
required
|
Permitted Values
REDIRECT
ERROR
|
Format NUMERIC(9..12)
The txid specifies the payment process within the PAYONE platform |
|
Format NUMERIC(6..12)
PAYONE User ID, defined by PAYONE |
|
Format CHAR(2..2000)
Redirect URL → zMerchant system has to redirect customer to this URL to complete payment |
Format NUMERIC(1..6)
In case of error the PAYONE Platform returns an error code for your internal usage. |
|
Format CHAR(1..1024)
In case of error the PAYONE Platform returns an error message for your internal usage. |
|
Format CHAR(1..1024)
The customermessage is returned to your system in order to be displayed to the customer. (Language selection is based on the end customer's language, parameter "language") |
Host: api.pay1.de Content-Type: application/x-www-form-urlencoded
Payload
mid=23456
portalid=12345123
key=abcdefghijklmn123456789
api_version=3.11
mode=test (set to „live“ for live-requests)
request=preauthorization
encoding=UTF-8
aid=12345
clearingtype=wlt
reference=Ref123456
language: de,
wallettype: PAL,
currency: EUR,
lastname: PM-Tester,
firstname: Paul,
country: DE,
amount: 1500,
successurl: https: //success.com,
errorurl: https: //error.com,
backurl: https: //back.com,
shipping_firstname: Peter,
shipping_lastname: Pan,
shipping_zip: 13587,
shipping_city: Berlin,
shipping_country: DE,
shipping_street: Mustergasse5,
email: email@email.de,
add_paydata[redirection_mode]: DIRECT_TO_MERCHANT,
userid: 27975892,
it[n]: goods,
it[n+1]: shipment,
id[n]: 1001,
id[n+1]: 1002,
pr[n]: 1000,
pr[n+1]: 500,
de[n]: Schuhe,
de[n+1]: Versand,
no[n]: 1,
no[n+1]: 1,
va[n]: 19,
va[n+1]: 19
RESPONSE
status: REDIRECT,
txid: 1202914664,
userid: 27975892,
redirecturl: https: //www.sandbox.paypal.com/checkoutnow?token,
add_paydata[orderId]: 94765686BK5419036,
add_paydata[workorderid]: PP2AADTNKQR0BEZH
POST Request - genericpayment – add_paydata[action] = confirm_order_status
request
required
|
Fixed Value: preauthorization / authorization
|
mid
required
|
your merchant ID, 5-digit numeric
|
aid
required
|
your subaccount ID, 5-digit numeric
|
portalId
required
|
your Portal ID, 7-digit numeric
|
key
required
|
your key value, alpha-numeric
|
mode
required
|
Fixed Value: test/live
Can be either test environment (test) or live environment (live) |
reference
optional
|
Format CHAR(2..255)
A unique ID that will be displayed in your shop backend and for the customer |
currency
required
|
Format LIST
Permitted values ISO 4217 (currencies) 3-letter-codes
Samples
EUR / USD / GBP |
workorderid
required
|
Format CHAR(1..50)
The ID is unique. The returned workorderid is mandatory for the following requests of PayPal Express Checkout. The workorderid is a technical id returned from the PAYONE platform to identify a workorder. A workorder is a part of a payment process (identified by a txid). The workorderid is used for the genericpayment request. |
language
optional
|
Format LIST
Permitted values ISO 639-1 (Language)2-letter-codes
Language indicator (ISO 639) to specify the language that should be presented to the customer (e.g. for error messages, frontend display). If the language is not transferred, the browser language will be used. For a non-supported language English will be used. |
wallettype
required
|
Fixed Value PAL
|
successurl
required
|
Format CHAR(2..255)
Scheme <scheme>://<host>/<path> <scheme>://<host>/<path>?<query> scheme-pattern: [a-zA-Z]{1}[a-zA-Z0-9]{1,9}
URL for "payment successful" |
errorurl
required
|
Format CHAR(2..255)
Scheme <scheme>://<host>/<path> <scheme>://<host>/<path>?<query> scheme-pattern: [a-zA-Z]{1}[a-zA-Z0-9]{1,9}
URL for "faulty payment" |
backurl
required
|
Format CHAR(2..255)
Scheme <scheme>://<host>/<path> <scheme>://<host>/<path>?<query> scheme-pattern: [a-zA-Z]{1}[a-zA-Z0-9]{1,9}
URL for "Back" or "Cancel" |
add_paydata[action]
required
|
Fixed Value: confirm_order
|
status
required
|
Permitted Values
OK / ERROR
|
workorderid
|
Format AN(1..16)
The ID is unique. The returned workorderid is mandatory for the following requests of PayPal Express Checkout. The workorderid is a technical id returned from the PAYONE platform to identify a workorder. A workorder is a part of a payment process (identified by a txid). The workorderid is used for the genericpayment request. |
---
errorcode
|
Format NUMERIC(1..6)
In case of error the PAYONE Platform returns an error code for your internal usage. |
errormessage
|
Format CHAR(1..1024)
In case of error the PAYONE Platform returns an error message for your internal usage. |
customermessage
|
Format CHAR(1..1024)
The customermessage is returned to your system in order to be displayed to the customer. (Language selection is based on the end customer's language, parameter "language") |
Host: api.pay1.de Content-Type: application/x-www-form-urlencoded
Payload
mid: 18323,
portalid: 2013285,
key: 1856f15989f3df533f77f294a6871c2a,
clearingtype: wlt,
mode: test,
encoding: UTF-8,
request: genericpayment,
reference: jv-1727774862,
aid: 18324,
language: de,
wallettype: PAL,
add_paydata[action]: confirm_order_status,
workorderid: PP2AADTBNQ9BCL80,
currency: EUR,
successurl: https: //paypal.mirage.zznza.pay1-test.de/success.php,
errorurl: https: //paypal.mirage.zznza.pay1-test.de/error-php,
backurl: https: //paypal.mirage.zznza.pay1-test.de/error-php
RESPONSE
status=OK
workorderid: PP2AADTBNQ9BCL80
POST Request - Capture
request
required
|
Fixed Value: capture
|
mid
required
|
your merchant ID, 5-digit numeric
|
aid
required
|
your subaccount ID, 5-digit numeric
|
portalId
required
|
your Portal ID, 7-digit numeric
|
key
required
|
your key value, alpha-numeric
|
txid
required
|
Format NUMERIC(9..12)
The txid specifies the payment process within the PAYONE platform |
sequencenumber
optional
|
Format NUMERIC(1..3)
Permitted values 0..127
Sequence number for this transaction within the payment process (1..n), e.g. PreAuthorization: 0, 1. Capture: 1, 2. Capture: 2 Required for multi partial capture (starting with the 2nd capture) |
amount
required
|
Format NUMERIC(1..10)
Permitted values max. +/- 19 999 999 99
Specifies the total gross amount of a payment transaction. Value is given in smallest currency unit, e.g. Cent of Euro; Pence of Pound sterling; Öre of Swedish krona. The amount must be less than or equal to the amount of the corresponding booking. |
currency
required
|
Fixed Value EUR
|
narrative_text
optional
|
Format CHAR(1..81)
Dynamic text element on account statements (3 lines with 27 characters each) and credit card statements. |
Permitted Values
APPROVED
PENDING
ERROR
|
Format NUMERIC(9..12)
The txid specifies the payment process within the PAYONE platform |
|||||||
add_paydata[capture_id] |
Format CHAR(16)
The capture ID can be used for multiple captures and refunds, to connect a specific refund to a specific capture |
||||||
Format LIST
Provides information about whether a settlement of balances has been carried out. |
Format NUMERIC(9..12)
The txid specifies the payment process within the PAYONE platform |
|
Format NUMERIC(6..12)
PAYONE User ID, defined by PAYONE |
Format NUMERIC(1..6)
In case of error the PAYONE Platform returns an error code for your internal usage. |
|
Format CHAR(1..1024)
In case of error the PAYONE Platform returns an error message for your internal usage. |
Host: api.pay1.de
Content-Type: application/x-www-form-urlencoded
Payload
mid=23456 (your mid)
portalid=12345123 (your portalid)
key=abcdefghijklmn123456789 (your key)
api_version=3.10
mode=test (set to „live“ for live-requests)
request=capture
encoding=UTF-8
id[n]: 1001001,
id[n+1]: 1001002,
it[n]: goods,
it[n+1]: shipment,
no[n]: 1,
no[n+1]: 1,
pr[n]: 20000,
pr[n+1]: 500,
de[n]: Testartikel1,
de[n+1]: Transport,
va[n]: 19,
va[n+1]: 19,
amount: 20500,
currency: EUR,
sequencenumber: 1,
settleaccount: auto,
txid: 1202830913
RESPONSE
status: APPROVED,
txid: 1202830913,
add_paydata[capture_id]: TX2AAD7XN4UFGG9X,
settleaccount: yes
POST Request - Debit
request
required
|
Fixed Value: debit
|
mid
required
|
your merchant ID, 5-digit numeric
|
aid
required
|
your subaccount ID, 5-digit numeric
|
portalId
required
|
your Portal ID, 7-digit numeric
|
key
required
|
your key value, alpha-numeric
|
txid
required
|
Format NUMERIC(9..12)
The txid specifies the payment process within the PAYONE platform |
||||||
sequencenumber
required
|
Format NUMERIC(1..3)
Permitted values 0..127
Sequence number for this transaction within the payment process (1..n), e.g. PreAuthorization: 0, 1. Capture: 1, 2. Capture: 2 Required for multi partial capture (starting with the 2nd capture) |
||||||
amount
required
|
Format NUMERIC(1..10)
Permitted values max. +/- 19 999 999 99
Specifies the total gross amount of a payment transaction. Value is given in smallest currency unit, e.g. Cent of Euro; Pence of Pound sterling; Öre of Swedish krona. The amount must be less than or equal to the amount of the corresponding booking. |
||||||
currency
required
|
Fixed Value EUR
|
||||||
narrative_text
optional
|
Format CHAR(1..81)
Dynamic text element on account statements (3 lines with 27 characters each) and credit card statements. |
||||||
add_paydata[capture_id]
optional
|
Fixed Char(1..16)
The capture ID can be used for multiple captures and refunds, to connect a specific refund to a specific capture |
||||||
use_customerdata
optional
|
Format LIST
Use account details from debtor's master data |
||||||
transaction_param
optional
|
Format CHAR(1..50)
Permitted Symbols [0-9][A-Z][a-z][.-_/] Optional parameter for merchant information (per payment request) |
Permitted Values
APPROVED
PENDING
ERROR
|
txid
|
Format NUMERIC(9..12)
The txid specifies the payment process within the PAYONE platform |
||||||
settleaccount
|
Format LIST
Provides information about whether a settlement of balances has been carried out. |
errorcode
|
Format NUMERIC(1..6)
In case of error the PAYONE Platform returns an error code for your internal usage. |
errormessage
|
Format CHAR(1..1024)
In case of error the PAYONE Platform returns an error message for your internal usage. |
customermessage
|
Format CHAR(1..1024)
The customermessage is returned to your system in order to be displayed to the customer. (Language selection is based on the end customer's language, parameter "language") |
Host: api.pay1.de
Content-Type: application/x-www-form-urlencoded
Payload
mid=23456
portalid=12345123
key=abcdefghijklmn123456789
api_version=3.10
mode=test (set to „live“ for live-requests)
request=capture
encoding=UTF-8
request: refund,
aid: 54321,
sequencenumber: 2,
txid: 1202830913,
amount: -20500,
currency: EUR
RESPONSE
status: APPROVED,
txid: 1202830913