POST Request - genericpayment – add_paydata[action] = setexpresscheckout

For PayPal ECS the request type genericpayment is mandatory. With the first genericpayment the workorderid will be generated from the PAYONE platform and will be sent to you in the response. The ID is unique. The returned workorderid is mandatory for the following requests of PayPal Express Checkout.

Process Description:

  1. First of all you have to use the request “genericpayment” with “add_paydata[action]=setexpresscheckout”
  2. With “setexpresscheckout” you initiate the transaction at PayPal and get an unique “workorderid” from the PAYONE platform
  3. After the successful request you do another “genericpayment” request with “add_paydata[action]=getexpresscheckout details” to get the shipping and email address of the customer
  4. To charge the customers PayPal account you have to do a request “preauthorization/capture” or an “authorization” with the unique “workorderid”
  5. After completing step 4 you will get the “txid” which is used for further steps like “capture”, “debit” or “refund”

It is mandatory to send the shipping address in the “authorization” or “preauthorization” request if the data is different to the received shipping address from the “genericpayment[action]=getexpresscheckoutdetails”. Otherwise you don’t have the PayPal seller-protection. With “genericpayment[action]=getexpresscheckoutdetails” you only get the customer shipping address from PayPal. Use shipping address also as billing address. Your customer should have an option to change billing address while checking out. If you want to use multi partial capture, you need to set settleaccount to yes or auto, to be able to send another capture afterwards. Do not use settleaccount=no.

Account Parameters
request
required
Fixed Value: genericpayment
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
Common Parameters
clearingtype
required
Fixed Value: wtl
wallettype
required
Fixed Value: PPE

PPE: PayPal

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

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.

The amount must be less than or equal to the amount of the corresponding booking.

currency
required
Format LIST
Permitted values ISO 4217 (currencies) 3-letter-codes
Samples

EUR

USD

GBP

narrative_text
optional
Format CHAR(1..81)

Dynamic text element on account statements (3 lines with 27 characters each) and credit card statements.

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 PARAMETERs
add_paydata[action]
required
AN..255

Set to "setexpresscheckout"

add_paydata[request_billing_address]
optional
AN..255

Set to “1” if you want to receive customers billing address. Don’t send this parameter, if you don’t want to receive billing address.

Your PayPal account needs to be activated by PayPal in order to receive the billing address. Please consult your PayPal CSM for further details.

Response Parameters
Permitted Values
APPROVED
ERROR
Response Data (Redirect)
workorderid
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.

redirecturl

Redirect URL

add_paydata[token]
Express Checkout Token for use with “Magnes Library” (Fraud)
Response parameters (error)
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
                    
add_paydata[action]=setexpresscheckout
aid=52078
amount=5900
api_version=3.10
backurl=https://yourdomain.dev/api/payone/?type=back
clearingtype=wlt
currency=EUR
de[1]=Beanie
de[2]=Versandkostenpauschale
encoding=UTF-8
errorurl=https://yourdomain.dev/api/payone/?type=error
id[1]=woo-beanie
id[2]=1
it[1]=goods
it[2]=shipment
key=19539eb4b369b29f314b51368076475a
mid=14648
mode=test
no[1]=3
no[2]=1
portalid=2037267
pr[1]=1800
pr[2]=500
request=genericpayment
successurl=https://yourdomain.dev/api/payone/?type=paypal-express-get-checkout
va[1]=0
va[2]=0
wallettype=PPE              
RESPONSE
                        
status=REDIRECT
workorderid=PP2ABD5RCLH4MT7G
redirecturl=https://www.sandbox.paypal.com/webscr?useraction=continue&cmd=_express-checkout&token=EC-66E91029A1865552E
add_paydata[token]=EC-66E91029A1865552E  
POST Request - genericpayment – add_paydata[action] = getexpresscheckoutdetails

This call is used to gather the Information about the customer from PayPal. The received shipping address must be displayed in the shop in case of ECS although the value of shipping address will be sent to PayPal again with the last call. 

Account Parameters
request
required
Fixed Value: genericpayment
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
common Parameters
clearingtype
required
Fixed Value wtl
wallettype
required
Fixed Value PPE

PPE: Paypal

mode
required
Fixed Value: test/live

PPE: Paypal

workorderid
required
Format CHAR(1..50)

With the first genericpayment the workorderid will be generated from the PAYONE platform and will be sent to you in the response. The ID is unique. The returned workorderid is mandatory for the following requests of PayPal Express Checkout.

reference
optional
Permitted Symbols [0-9][a-z][A-Z], .,-,_,/

Merchant reference number for the payment process (case insensitive)

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.

The amount must be less than or equal to the amount of the corresponding booking.

currency
required
Format LIST
Permitted values ISO 4217 (currencies) 3-letter-codes
Samples

EUR

USD

GBP

add_paydata Parameters
add_paydata[action]
required
AN..255

Set to "getexpresscheckoutdetails"

not add_paydata[payment_action]
optional
Fixed Value SALE

To initiate a "final sale" transaction (PaymentAction=Sale). By default - without this parameter - the transaction is initiated as an authorization, which is e.g. not suitable for some industries.

Response Parameters
Permitted Values
OK
ERROR
Response Data (OK)
 workorderid
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.

Format CHAR(1..50)

Unique PayPal Customer Account identification number.

Permitted values

verified

unverified

PayPal payer status.

The criteria for a PayPal account to become "verified" varies from country to country, but usually depend on adding or confirming either a bank or a card. Before that is done an account is "unverified".

Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)
Format CHAR(1..50)

Billing street

If add_paydata[request_billing_address] is set to “1” in “setexpresscheckout”-request, you’ll receive billing address parameters in “getexpresscheckoutdetails”-response

Format CHAR(1..50)

Billing city

Format ISO 3166   

Billing country

Format CHAR(1..50)

Billing zip

Format CHAR(1..50)

Billing name (Paypal sends firstname and lastname separated by a space.)

Sample Value +49 1721234567   

Buyer's phone number

Response parameters (error)
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                    

add_paydata[action]=getexpresscheckoutdetails
add_paydata[request_billing_address]=x
aid=52078
amount=5900
api_version=3.10
backurl=https://yourdomain.dev/api/payone/?type=back
clearingtype=wlt
currency=EUR
de[1]=Beanie
de[2]=Versandkostenpauschale
encoding=UTF-8
errorurl=https://yourdomain.dev/api/payone/?type=error
id[1]=woo-beanie
id[2]=1
it[1]=goods
it[2]=shipment
key=19539eb4b369b29f314b51368076475a
mid=14648
mode=test
no[1]=3
no[2]=1
portalid=2037267
pr[1]=1800
pr[2]=500
request=genericpayment
successurl=https://yourdomain.dev/api/payone/?type=paypal-express-get-checkout-callback
va[1]=0
va[2]=0
wallettype=PPE
workorderid=PP2ABD5RCLH4MT7G              
RESPONSE

status=OK
workorderid=PP2ABD5RCLH4MT7G
add_paydata[shipping_street]=Badensche Str. 24
add_paydata[zip]=10715
add_paydata[country]=DE
add_paydata[payerstatus]=verified
add_paydata[shipping_state]=Berlin
add_paydata[telephonenumber]=017885775296
add_paydata[city]=Berlin
add_paydata[shipping_city]=Berlin
add_paydata[countrycode]=DE
add_paydata[payerid]=3LRYDUQ7AFUT8
add_paydata[lastname]=Payonetester
add_paydata[shipping_zip]=10715
add_paydata[street]=Badensche Str. 24
add_paydata[shipping_firstname]=Frank
add_paydata[shipping_country]=DE
add_paydata[shipping_lastname]=Payonetester
add_paydata[email]=test@payone.dev          
POST Request - Pre-/ Authorization

The default life time for the paydirekt checkout is 30 minutes. It is possible to set an expiry time for the checkout between 120 und 1800 seconds. Please contact the merchant service (Contact) if you want to limit the paydirekt checkout time.

Account Parameters
request
required
Fixed Value: preauthorisation/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
common Parameters
clearingtype
required
Fixed Value: wtl
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

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.

The amount must be less than or equal to the amount of the corresponding booking.

currency
required
Format LIST
Permitted values ISO 4217 (currencies) 3-letter-codes
Samples

EUR

USD

GBP

param
optional
Format CHAR(1..255)

Individual parameter (per payment process)

narrative_text
optional
Format CHAR(1..81)

Dynamic text element on account statements (3 lines with 27 characters each) and credit card statements.

customer_is_present
optional
Format LIST
Permitted Values

yes

no

Indicates whether customer is “present” and can enter their data in the shop (=yes). Or customer is not present and can not enter any data (=no).

PERSONAL DATA Parameters
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
Domain Suffixes = Max. 4 suffixes with max. 124 characters 
Example: username[63]@domain_name[63].suffix[60].suffix[60].suffix[4]

"@" 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

Delivery data Parameters
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
Samples US Samples CA
AK BC
AB AR
AL
Wallet PARAMETERS
wallettype
required
Fixed Value PPE
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"

Article Parameters
it[n]
optional
it[n] Comments
goods Goods
shipment Shipping Charges
handling Handling fee
voucher Voucher / discount
id[n]
optional
Format CHAR(1..32)
Array elements [n] starting with [1]; serially numbered; max [400]

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

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]

Response Parameters
Permitted Values
APPROVED
ERROR
Response Parameter (approved)
txid
Format NUMERIC(9..12)

The txid specifies the payment process within the PAYONE platform

Format NUMERIC(6..12)

PAYONE User ID, defined by PAYONE

Response Parameter (Error)
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    

aid=52078
amount=5900
api_version=3.10
backurl=https://yourdomain.dev/api/payone/?type=back&oid=1241400821
city=Berlin
clearingtype=wlt
country=DE
currency=EUR
de[1]=Beanie
de[2]=Versandkostenpauschale
email=frank@patsy.dev
encoding=UTF-8
errorurl=https://yourdomain.dev/api/payone/?type=error&oid=1241400821
firstname=Frank
id[1]=woo-beanie
id[2]=1
it[1]=goods
it[2]=shipment
key=19539eb4b369b29f314b51368076475a
lastname=Payonetester
mid=14648
mode=test
no[1]=3
no[2]=1
portalid=2037267
pr[1]=1800
pr[2]=500
reference=1241400821.1
request=authorization
shipping_city=Berlin
shipping_country=DE
shipping_firstname=Frank
shipping_lastname=Payonetester
shipping_street=Badensche Str. 24
shipping_zip=10715
street=Badensche Str. 24
successurl=https://yourdomain.dev/api/payone/?type=success&oid=1241400821
telephonenumber=017885775296
va[1]=0
va[2]=0
wallettype=PPE
workorderid=PP2ABD5RCLH4MT7G
zip=10715        
RESPONSE
                        
status=APPROVED
txid=1040922344
userid=699490528