Prefill customer data in order forms
Overview
Use 2Checkout's order form prefill feature to pre-populate forms in the ordering interface with customer data already stored in your shopping cart platform.
Scenarios
You're using the secure.2checkout.com domain - Send the details to be auto-filled via a form using either GET or POST to https://secure.2checkout.com/order/pf.php.
You're using a custom domain such as store.YourDomain.com - Use the custom domain when sending the details with either GET or POST to https://store.YourDomain.com/order/pf.php.
Workflow
2Checkout captures the sent parameters and redirects the customer to the link set by the "URL" parameter.
Parameters
Required
URL
The GET request created either in the Generate Sales Links area or dynamically. Use URL-encoding (RFC 1738) for the value of the URL parameter when working with custom-built links.
MERCHANT
Your 2Checkout Merchant Code ( view)
AUTOMODE
(optional) Send this parameter with value = 1 to skip to the credit card details page, provided all billing information is sent as described below. If any of the fields below are incomplete, the regular form will be shown in order for the customer to fill in the missing fields.
Optional: billing information
BILL_FNAME
Client first name
BILL_LNAME
Client last name
BILL_COMPANY
Company name for billing
BILL_FISCALCODE
Company Unique registration code (VAT ID)
BILL_EMAIL
E-mail address
BILL_PHONE
Phone number
BILL_FAX
Fax number
BILL_ADDRESS
Customer/Company physical address
BILL_ADDRESS2
Customer/Company address (second line)
BILL_ZIPCODE
Customer/Company zip code
BILL_CITY
City
BILL_STATE
State/County
BILL_COUNTRYCODE
Country code (two letter code)
Optional: delivery information
DELIVERY_FNAME
Client first name
DELIVERY_LNAME
Client last name
DELIVERY_COMPANY
Company name for delivery
DELIVERY_PHONE
Phone number
DELIVERY_ADDRESS
Client/company address (for delivery)
DELIVERY_ADDRESS2
Client/company address (second line)
DELIVERY_ZIPCODE
Client/company zip code
DELIVERY_CITY
City
DELIVERY_STATE
State/County
DELIVERY_COUNTRYCODE
Country code (NL for Netherlands)
URL encoded string
Not encoded:
Encoded:
Example: Submitting customer email in the buy-link
Encrypt prefilled data
Send the data using either GET or POST.
Cryptographic Standard
Advanced Encryption Standard (AES), used with 256-bit keys, in GCM (Galois/Counter Mode), with a random and unique 'Initialization vector (IV)' 96-bit.
Encryption Key
Derive the encryption key from the secret key of your account from Integrations > Webhooks & API page, using a SHA256 HMAC and a cryptographically strong random nonce.
A cryptographic nonce is a random number that is used in communication protocols to assist maintain the privacy of communications. It is a single-use, generated using a cryptographically-strong, high-entropy, random-number generator.
Hash
Generate a keyed hash value using the HMAC method and the SHA2/ SHA3 hashing algorithm of the unencrypted URL (Buy Link) and your account's secret key.
GET request
Build your URL using this format:
All encrypted parameters are first Base64-encoded and then URL-encoded.
Encrypted Prefill Example — PHP
Encrypted Prefill Example — C#
Last updated
Was this helpful?