Hosted Payment Pages (HPP) API (1)

Our low-code integration to take payments securely.

Authentication Header

  Authorization: {your_credentials}

Replace {your_credentials} with your base64-encoded Basic Auth username and password given to you by your Implementation Manager.

You must use the Authorization header for any request you send to our Hosted Payment Pages APIs, unless you are using client certificate authenticating with SSL/TLS.

Accept Header

  Accept: application/vnd.worldpay.payment_pages-v1.hal+json

We use the Accept header to identify which version of our API you are using. You must use the Accept header for any request you send to our Hosted Payment Pages APIs.

DNS Whitelisting Whitelist the following URLs:

  • https://try.access.worldpay.com/
  • https://access.worldpay.com/

Please ensure you use DNS whitelisting, not explicit IP whitelisting.

Download OpenAPI description
Overview
License Worldpay
Languages
Servers
Try
https://try.access.worldpay.com/
Live
https://access.worldpay.com/

Create a new transaction

Request

Headers
WP-CorrelationIdstring^[0-9a-zA-Z_-]{1,64}$required

Used to identify individual requests made to our API.

User-Agentstring

The name of the client calling the API.

Bodyapplication/vnd.worldpay.payment_pages-v1.hal+json

The transaction to create

billingAddressobject

An object containing the billing address information.

address1string[ 0 .. 85 ] characters

Address line 1

address2string[ 0 .. 85 ] characters

Address line 2

address3string[ 0 .. 85 ] characters

Address line 3

citystring[ 0 .. 50 ] characters

Address city

countryCodestring

The supported ISO 3166-1 alpha-2 country code

firstNamestring[ 1 .. 22 ] characters

The customer's first name

lastNamestring[ 1 .. 22 ] characters

The customer's last name

postalCodestring[ 0 .. 15 ] characters

Required for all countries except the following: * IE

statestring[ 0 .. 50 ] characters

Address state or region

createTokenobject

An object that instructs us to create a token for the payment details supplied.

descriptionstring[ 1 .. 255 ] characters^([^&<]*)$

A description of your token. If not supplied, a default description is created for you.

namespacestring[ 1 .. 64 ] characters

A namespace is used to group up to 16 cards, e.g. for one customer. A card can exist in more than one namespace.

optInstringrequired

Used to choose how the customer could opt into their payment details being tokenized.

SILENT - (default value) The card details are always saved (you must already have their consent to do this)

NOTIFY - The card details are always saved (you must already have their consent to do this) and your customer will see this within our hosted payment pages

ASK - The card details are saved if your customer provides their consent. This adds a "Save payment details" tickbox to the page, which they tick to opt-in, or ignore to opt-out.

Enum"SILENT""NOTIFY""ASK"
typestringrequired

The type of token to be created.

Value"worldpay"
customerAgreementobject

Contains specific customer agreements for the transaction. If this is present, then the creationToken must also be present

storedCardUsagestringrequired

How the card is being used.

Enum ValueDescription
first

Use this when storing a card.

subsequent

Use this when taking payment with a previously stored card.

typestringrequired

The processing arrangement agreed with your customer.

Value"cardOnFile"
customisation_idstring= 21 characters^[A-Za-z0-9\_\-]*$

A unique value that identifies which customization should be use for this transaction. Set it to null to use the default customization.

descriptionstring[ 0 .. 128 ] characters

An optional text, when supplied is displayed to your customer on payment pages.

expiryinteger(int64)[ 300 .. 2592000 ]

Allows you to configure the duration, in seconds, your customer can access the payment link.

Default 3600
fraudobject
typestring

You can use this to disable FraudSight for this request.

Value"disabled"
hostedCustomizationobject

Add CSS options for each payment to customize the look and feel of the payment page.

backgroundColorstring[ 0 .. 20 ] characters^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$

Background color for the payment page in hex format. You can use three digit or six digit codes (e.g. #FFO or #DD99CC).

buttonsobject

Defines hover and focus styling for buttons on the HPP page

colorstring[ 0 .. 20 ] characters^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$

Text color for the payment page in hex format. You can use three digit or six digit codes (e.g. #FFO or #DD99CC).

fontsobject

Defines font styling options for text displayed on the payment pages, including the list of preferred font families

inputsobject

Defines custom styling for input fields when hovered over or focused

pageobject

Represents styling and customizations applied to the entire payment page, including colors, fonts, and borders.

hostedPropertiesobject

Add properties customization to allow merchants specify the look of the payment page.

applePayButtonStylestring[ 0 .. 20 ] characters

Change the color displayed on the Apple Pay button.

applePayButtonTypestring[ 0 .. 20 ] characters

Change the text displayed on the Apple Pay button.

disableStrictUrlsstring[ 0 .. 20 ] characters

When set to true/false, append the additional information after/before the result URL query string.

googlePayButtonColourstring[ 0 .. 20 ] characters

Change the color displayed on the Google Pay button.

googlePayButtonLabelstring[ 0 .. 20 ] characters

Change the text displayed on the Google Pay button.

maskCardDetailsstring[ 0 .. 20 ] characters

Hidden card and CVC number as they are typed.

passBackErrorReasonsstring[ 0 .. 20 ] characters

Append error reasons to the result URL.

paymentButtonLabelstring[ 0 .. 20 ] characters

Options to change the payment button text.

sendUrlParametersstring[ 0 .. 20 ] characters

Send url parameters in the callback.

showBillingAddressstring[ 0 .. 20 ] characters

Displays the billing address of the customer on the payment pages. Options available are: SHOW, HIDE, and EDIT.

showCancelButtonstring[ 0 .. 20 ] characters

Display the cancel button that lets customer cancel the payment.

showCardIconsstring[ 0 .. 20 ] characters

Display logos for card payments on the payment page.

showCardholderNamestring[ 0 .. 20 ] characters

Display the card holder name on the payment page.

showChangePaymentMethodButtonstring[ 0 .. 20 ] characters

Display the change payment method button to let customer return to the payment method selection page.

showContactDetailsstring[ 0 .. 20 ] characters

Displays the contact details of the customer on the payment pages. Options available are: SHOW, HIDE, and EDIT.

showCountryListstring[ 0 .. 20 ] characters

Displays a drop-down list of countries on the payment pages.

showFooterstring[ 0 .. 20 ] characters

Display the worldpay copyright information footer on the payment page.

showHeaderstring[ 0 .. 20 ] characters

Display the selected logo and associated space around the logo

showLanguageListstring[ 0 .. 20 ] characters

Displays a drop-down list of languages on the payment pages.

showPaymentDetailsHeaderstring[ 0 .. 20 ] characters

Display the payment header on the payment page.

showPoweredByWorldpaystring[ 0 .. 20 ] characters

The "Powered by Worldpay" logo (referring to "worldpay" on the payment pages) is displayed while content is being displayed on a payment page.

showShippingAddressstring[ 0 .. 20 ] characters

Displays the shipping address of the customer on the payment pages. Options available are: SHOW, HIDE, and EDIT.

localestring

A BCP 47 locale tag, from the specified list. If set to null or absent from the request, will default to English (en).

Enum"ar""bg""bs""ca""cs""cy""da""de""en""el"
merchantobjectrequired

An object that contains information about the merchant.

entitystring[ 1 .. 32 ] characters^([A-Za-z0-9]+[A-Za-z0-9 ]*)?$required

Used to route the request in Access Worldpay, created as part of on-boarding.

narrativeobjectrequired

The text that appears on your customer's statement. Used to identify the merchant.

line1string^[a-zA-Z0-9\-\.\,\ ]*$required

line1 is used to provide basic details about the merchant.

paymentInstrumentTokenPaymentInstrument (object)
One of:

An object that contains the payment type and details.

typestringrequired

The type of instrument.

hrefstringrequired

The URL to an Access token. We return this after token creation via the API or webhook callback.

resultURLsobject

An object containing the different URLs we redirect your customers to when we receive the payment result. We recommend that you provide us with your custom result URLs.

cancelURLstring

When your customer cancels a transaction, we redirect that customer to the cancel URL.

errorURLstring

When we receive the payment result for an erroneous payment, we redirect your customer to the error URL.

expiryURLstring

When a customer leaves the payment transaction uncompleted within the maximum allowed time frame, we redirect your customer to the expiry URL.

failureURLstring

When a payment fails, we redirect your customer to the failure URL.

pendingURLstring

When we receive the payment result for a pending payment transaction, we redirect your customer to the pending URL.

successURLstring

When we receive the payment result for a successful payment, we redirect your customer to the success URL.

riskDataobject

Data used for fraud and risk protection.

accountobject

Object containing all customer account related risk data.

customobject

An object containing all data that can be used to configure manual fraud rules.

shippingobject

Object containing all data related to how the order will be shipped.

transactionobject

Object containing all customer transaction related risk data.

settlementobject

A value when specified allows you to turn auto settlement off. The default behavior is "true" and there is nothing to specify.

autoboolean
cancelOnobject

Optional object to control skip auto-cancel behavior for CVC mismatch.

threeDSobject

An object containing 3DS authentication preferences, which you can use to turn 3DS off.

typestring

The 3DS type.

Value"disabled"
transactionReferencestring[ 1 .. 64 ] characters^[a-zA-Z0-9\-\_\/\!\@\#\$\%\(\)\*\=\.\:\;\?\[...required

A unique reference generated by you that is used to identify a payment throughout its lifecycle.

valueobjectrequired

The payment amount.

amountinteger(int64)>= 1required

The payment amount. This is a whole number with an exponent e.g. if exponent is two, 250 is 2.50.

currencystring
application/vnd.worldpay.payment_pages-v1.hal+json
{ "transactionReference": "MyTransaction123", "merchant": { "entity": "POxxxxxxxxx" }, "narrative": { "line1": "Mind Palace Ltd" }, "value": { "currency": "GBP", "amount": 123 }, "description": "Optional text displayed on HPP to your customer", "billingAddress": { "firstName": "John", "lastName": "Watson", "address1": "221B Baker Street", "address2": "Marylebone", "address3": "Westminster", "postalCode": "NW1 6XE", "city": "London", "state": "Greater London", "countryCode": "GB" }, "resultURLs": { "successURL": "https://mindpalace-website/result/success", "pendingURL": "https://mindpalace-website/result/pending", "failureURL": "https://mindpalace-website/result/failure", "errorURL": "https://mindpalace-website/result/error", "cancelURL": "https://mindpalace-website/result/cancel", "expiryURL": "https://mindpalace-website/result/expiry" }, "riskData": { "shipping": { "firstName": "James", "lastName": "Moriarty", "address": { "city": "Durham", "address1": "The Palatine Centre", "address2": "Durham University", "address3": "Stockton Road", "state": "County Durham", "countryCode": "GB", "postalCode": "DH1 3LE", "phoneNumber": "01189998819999197253" }, "method": "verifiedAddress", "nameMatchesAccountName": false, "email": "james.moriarty@example.com", "timeFrame": "nextDay" }, "custom": { "string1": "foo", "number1": "1", "string2": "foo", "number2": "1", "string3": "foo", "number3": "1", "string4": "foo", "number4": "1", "string5": "foo", "number5": "1", "string6": "foo", "number6": "1", "string7": "foo", "number7": "1", "string8": "foo", "number8": "1", "string9": "foo", "number9": "1" }, "account": { "dateOfBirth": "1835-04-01", "history": { "createdAt": "1876-06-01", "modifiedAt": "1876-08-13", "paymentAccountEnrolledAt": "1876-06-01", "passwordModifiedAt": "1876-06-01" }, "type": "guestUser", "previousSuspiciousActivity": false, "email": "sherlock.holmes@example.com" }, "transaction": { "firstName": "James", "lastName": "Moriarty", "phoneNumber": "01189998819999197253", "preOrderDate": "1876-08-13", "reorder": false, "history": { "attemptsLastYear": 3, "completedLastSixMonths": 4, "attemptsLastDay": 2, "shippingAddressFirstUsedAt": "1876-06-01", "addCardsLastDay": 1 }, "giftCardsPurchase": { "totalValue": { "amount": 10000, "currency": "GBP" }, "quantity": 1 } } }, "paymentInstrument": { "type": "card/tokenized", "href": "https://try.access.worldpay.com/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ" }, "customerAgreement": { "type": "cardOnFile", "storedCardUsage": "first" }, "expiry": "600" }

Responses

Transaction creation was successful

Bodyapplication/vnd.worldpay.payment_pages-v1.hal+json
_linksobject

The next action link, where merchants can perform certain actions (e.g., querying a payment).

selfobject
urlstring

The URL where your customer can be redirected to, to complete their payment.

Response
application/vnd.worldpay.payment_pages-v1.hal+json

Successful response

{ "url": "https://payments.worldpay.com/app/hpp/integration/transaction/xxxxxxxxxxxxxxxxxxxx&cs=yyyyyy", "_links": { "self": { "href": "https://access.worldpay.com/paymentQueries/payments?transactionReference=174420000000000" } } }