Menu

Creating a direct order

Example direct card request

Copied!
curl https://api.worldpay.com/v1/orders 
-H "Authorization:your-service-key" 
-H "Content-type: application/json" 
-X POST -d '{
    "paymentMethod": {
        "name": "cardholder-name",
        "expiryMonth": 2,
        "expiryYear": 2020,
        "issueNumber": 1,
        "startMonth": 2,
        "startYear": 2016,
        "cardNumber": "4444 3333 2222 1111",
        "type": "Card",
        "cvc": "123"
    },
    "orderType": "your-order-type-option",
    "amount": 500,
    "currencyCode": "GBP",
    "orderDescription": "Order description",
    "customerOrderCode":"my-customer-order-code",
    "settlementCurrency": "GBP",
    "name": "name",
    "billingAddress": {
        "address1": "18 Linver Road",
        "postalCode": "SW6 3RB",
        "city": "London",
        "countryCode": "GB"
    },
    "deliveryAddress": {
        "firstName": "John",
        "lastName": "Smith",
        "address1": "address1",
        "address2": "address2",
        "address3": "address3",
        "postalCode": "postCode",
        "city": "Reading",
        "state": "Berkshire",
        "countryCode": "GB",
        "telephoneNumber": "02079460761"
    },
    "shopperEmailAddress": "email address",
    "shopperIpAddress": "195.35.90.111",
    "shopperSessionId": "123"
}'

Example response

Copied!
{
    "orderCode": "worldpay-order-code",
    "token": "your-token",
    "orderDescription": "your-order-description",
    "amount": 500,
    "currencyCode": "GBP",
    "customerOrderCode":"my-customer-order-code",
    "paymentStatus": "SUCCESS",
    "paymentResponse": {
        "type": "ObfuscatedCard",
        "name": "name",
        "expiryMonth": 2,
        "expiryYear": 2020,
        "cardType": "VISA_CREDIT",
        "maskedCardNumber": "  ** 1111",
        "billingAddress": {
            "address1": "18 Linver Road", 
            "postalCode": "SW6 3RB", 
            "city": "London", 
            "countryCode": "GB"
        },
        "cardSchemeType": "consumer",
        "cardSchemeName": "VISA CREDIT",
        "cardIssuer": "LLOYDS BANK PLC",
        "countryCode": "GB",
        "cardClass": "credit",
        "cardProductTypeDescNonContactless": "unknown",
        "cardProductTypeDescContactless": "unknown",
        "prepaid": "false"
    },
    "deliveryAddress": {
        "firstName": "John",
        "lastName": "Smith",
        "address1": "address1",
        "address2": "address2",
        "address3": "address3",
        "postalCode": "postCode",
        "city": "Reading",
        "state": "Berkshire",
        "countryCode": "GB"
    },
    "shopperEmailAddress": "email address",
    "environment": "TEST",
    "riskScore":: {
        "value": "1" 
    }
}

Example direct APM request

Copied!
curl https://api.worldpay.com/v1/orders 
-H "Authorization:your-service-key" 
-H "Content-type: application/json" 
-X POST -d '{
    "paymentMethod": {
        "type": "APM",
        "apmName": "paypal",
        "shopperCountryCode": "GB",
        "apmFields": {
          "attribute1": "value1"
        }
    },
    "orderType": "your-order-type-option",
    "amount": 500,
    "currencyCode": "GBP",
    "orderDescription": "Order description",
    "customerOrderCode":"my-customer-order-code",
    "settlementCurrency":"GBP"    "name": "name",
    "billingAddress": {
        "address1": "18 Linver Road",
        "postalCode": "SW6 3RB",
        "city": "London",
        "countryCode": "GB"
    },
    "deliveryAddress": {
        "firstName": "John",
        "lastName": "Smith",
        "address1": "address1",
        "address2": "address2",
        "address3": "address3",
        "postalCode": "postCode",
        "city": "Reading",
        "state": "Berkshire",
        "countryCode": "GB"
    },
    "shopperEmailAddress": "email address",
    "shopperIpAddress": "195.35.90.111",
    "shopperSessionId": "123"
}'

A new order can be created using a token, which the WorldPay.js library added to your checkout form, or you can supply the card details in the order request itself, without a token.

Create a Direct order through a POST on the Order API. Instead of specifying a token, include the paymentMethod object in the order request.