Worldpay WPG

Gateway Website:
Developer Documentation:

Default Currency: USD

Gateway Endpoints
This implementation of Worldpay WPG forwards requests to the below endpoints.

Supported Parameters:
* denotes a required field

Field NameTypeWorldpay WPG MappingNotes
testModebooleanN/ARoutes between Test and Production endpoints. All requests sent to the TokenEx test environment are sent to the Worldpay WPG test endpoint. This field value is honored in the TokenEx production environment.
TokenEx Test: always true.
TokenEx Prod: defaults to false.
Basic Auth username
Merchant's Worldpay WPG
password*stringBase Auth passwordMerchant's Worldpay WPG
Must have a unique value per order- i.e. the order code must not have been used previously.
Can be up to 64 characters in length, or 25 characters if you are connecting to the US domestic acquiring platform. Recommend a minimum of 9 and a maximum of 20 for onward processing. Spaces, quotation marks, code brackets (< and >) and pipes ("|") are not allowed.
merchantId*stringpaymentService.merchantCodeSame value as username.
Transaction amount in whole units. Example: $10.00 USD should be sent as 1000.
ISO 4217 three-letter alphabetic code for the currency.
Defaults to "USD".
creditCard.numberstringpaymentDetails.CARD-SSL.cardNumberCard's PAN or TokenEx token
creditCard.FullNamestringpaymentDetails.CARD-SSL.cardHolderNameCardholder's full name. digit year. or 2 digit month.
creditCard.CVVstringpaymentDetails.CARD-SSL.cvc3 or 4 digit Card Verification Code. If the CVV has been associated with a TokenEx token, send a non-numeric value here, such as "cvv". The CVV associated with the token will be retrieved and forwarded.
billingAddress.address1stringpaymentDetails.CARD-SSL.cardAddress.address.address1First line of the street address.
billingAddress.address2stringpaymentDetails.CARD-SSL.cardAddress.address.address2Second line of the street address.
billingAddress.citystringpaymentDetails.CARD-SSL.cardAddress.address.cityCity or locality.
billingAddress.statestringpaymentDetails.CARD-SSL.cardAddress.address.stateState or province.
billingAddress.zipstringpaymentDetails.CARD-SSL.cardAddress.address.zipZIP code or postal code.
billingAddress.countrystringpaymentDetails.CARD-SSL.cardAddress.address.countryCustomer country. Input Alpha 3. Is converted to Alpha 2.
orderInfo.InvoiceNumberstringpurchase.invoiceReferenceNumberInvoice number associated with a transaction.
orderInfo.CustomerIdstringpurchase.customerReferenceCustomer reference for the purchase
orderInfo.DiscountAmountintpurchase.discountAmount.amount.valueThe amount of discount for the order.
orderInfo.ShippingAmountintpurchase.shippingAmount.amount.valueThe shipping cost for the order.
orderInfo.DutyAmountintpurchase.dutyAmount.amount.valueThe duty on the total purchase amount for the order.
tax.CardAcceptorTaxIdstringpurchase.cardAcceptorTaxId9 digits for US domiciled merchants.
tax.Amountintpurchase.salesTax.Amount.ValueAmount of sales tax for the order.
tax.Exemptbooleanpurchase.taxExemptSet to true if salesTax is 0.

Example Payloads

    "testMode": true,
    "gateway": "WorldpayWPG",
    "username":"<Your Worldpay WPG API Login ID>",
    "password":"<Your Worldpay WPG Transaction Key>",
  	"merchantId": "<Your Worldpay WPG API Login ID>",
    "amount": 900,
    "creditCard": {
        "number": "4111111111111111",
        "expMonth": 6,
        "expYear": 2024,
        "firstName": "John",
        "lastName": "Doe",
        "cvv": "123"
    "billingAddress": {
        "phone": "555-555-5555",
        "email": "[email protected]",
        "name": "John Doe",
        "company": "Test Co.",
        "address1": "123 Someplace Lane, Suite #40A",
        "city": "Edmond",
        "state": "OK",
        "zip": "74100",
        "country": "USA"
    "orderInfo": {
        "invoiceNumber": "INV12233566",
        "customerId": "CUST00000001",
        "discountAmount": 0,
        "shippingAmount": 100,
        "dutyAmount": 0
    "tax": {
        "cardAcceptorTaxId": "VAT1999292",
        "amount": 2400,
        "exempt": false
    "testMode": true,
    "gateway": "WorldpayWPG",
    "username":"<Your Worldpay WPG API Login ID>",
    "password":"<Your Worldpay WPG Transaction Key>",
    "tokenExTransactionCode": "<TokenExTransactionCode from a previous Authorize response>",
    "amount": 900
    "testMode": true,
    "gateway": "WorldpayWPG",
    "username":"<Your Worldpay WPG API Login ID>",
    "password":"<Your Worldpay WPG Transaction Key>",
    "tokenExTransactionCode": "<TokenExTransactionCode from a previous Capture or Purchase response>",
    "amount": 900
    "testMode": true,
    "gateway": "WorldpayWPG",
    "username":"<Your Worldpay WPG API Login ID>",
    "password":"<Your Worldpay WPG Transaction Key>",
    "tokenExTransactionCode": "<TokenExTransactionCode from a previous Auhtorize, Capture, or Purchase response>"

Gateway Response Fields:

Field NameTypeWPG Response MappingNotes
ApprovedbooleanlastEventIf primary request returns "AUTHORISED" or OK element is present.
ProviderTransactionCodestringRequest's order.OrderCodeThe order code from the request is echoed in the response from WPG and is the value used for transaction modification.