Pay with PayPal
Initiate a PayPal payment and instantly trigger the settlement process.
Take a sale
POST
your request to the paypal:sale
action link.
Sale example request
POST https://try.access.worldpay.com/payments/alternative/action/paypal/sale
PayPal sale request body:
Copied!
{
"transactionReference": "Memory265-13/08/1876",
"merchant": {
"entity": "MindPalaceLtd"
},
"instruction": {
"description": {
"line1": "order description"
},
"paymentInstrument": {
"type": "PAYPAL",
"shippingAddress": {
"firstName": "James",
"lastName": "Moriarty",
"street": "The Palatine Centre",
"postalCode": "DH1 3LE",
"city": "Durham",
"state": "County Durham",
"countryCode": "GB"
},
"billingAddress": {
"firstName": "Sherlock",
"lastName": "Holmes",
"shopperEmailAddress":"sherlock.holmes@example.com",
"address1": "221B Baker Street",
"address2": "Marylebone",
"address3": "Westminster",
"postalCode": "NW1 6XE",
"city": "London",
"state": "Greater London",
"countryCode": "GB"
}
},
"value": {
"currency": "GBP",
"amount": 1
}
}
}
{ "transactionReference": "Memory265-13/08/1876", "merchant": { "entity": "MindPalaceLtd" }, "instruction": { "description": { "line1": "order description" }, "paymentInstrument": { "type": "PAYPAL", "shippingAddress": { "firstName": "James", "lastName": "Moriarty", "street": "The Palatine Centre", "postalCode": "DH1 3LE", "city": "Durham", "state": "County Durham", "countryCode": "GB" }, "billingAddress": { "firstName": "Sherlock", "lastName": "Holmes", "shopperEmailAddress":"sherlock.holmes@example.com", "address1": "221B Baker Street", "address2": "Marylebone", "address3": "Westminster", "postalCode": "NW1 6XE", "city": "London", "state": "Greater London", "countryCode": "GB" } }, "value": { "currency": "GBP", "amount": 1 } } }
Parameter descriptions
Parameter | Required | Description |
---|---|---|
transactionReference | A unique transaction reference for this sale. | |
merchant.entity | Used to route the sale request in Access Worldpay, created as part of on-boarding. | |
instruction | An object containing all the payment information related to the sale request. | |
instruction.description.line1 | A field containing the order description. | |
instruction.paymentInstrument | An object containing customer details. | |
paymentInstrument.type | The type of payment instrument. The value must be "PAYPAL". | |
paymentInstrument.shippingAddress | An object containing the shipping address information. If included in the request, you must send atleast:
| |
paymentInstrument.shippingAddress.firstName | The customer's first name. | |
paymentInstrument.shippingAddress.lastName | The customer's last name. | |
paymentInstrument.shippingAddress.street | The street name of the shipping address. Mandatory if you include shippingAddress in the request. | |
paymentInstrument.shippingAddress.postalCode | The post code/ zip code of the shipping address. Mandatory if you include shippingAddress in the request. | |
paymentInstrument.shippingAddress.city | The city of the shipping address. Mandatory if you include shippingAddress in the request. | |
paymentInstrument.shippingAddress.state | The state of the shipping address. | |
paymentInstrument.shippingAddress.countryCode | TheshippingAddress in the request. | |
paymentInstrument.billingAddress | An object containing the billing address information. | |
paymentInstrument.billingAddress.firstName | The customer's first name. | |
paymentInstrument.billingAddress.lastName | The customer's last name. | |
paymentInstrument.billingAddress.shopperEmailAddress | The customer's email address. | |
paymentInstrument.billingAddress.address1 | First line of the billing address. | |
paymentInstrument.billingAddress.address2 | Second line of the billing address. | |
paymentInstrument.billingAddress.address3 | Third line of the billing address. | |
paymentInstrument.billingAddress.postalCode | The post code/ zip code of the billing address. | |
paymentInstrument.billingAddress.city | The city of the billing address. | |
paymentInstrument.billingAddress.state | The state of the billing address. | |
paymentInstrument.billingAddress.countryCode | The | |
instruction.value | An object containing the value of the sale. | |
instruction.value.currency | An identifier for the currency being used. | |
instruction.value.amount | An identifier for the amount being used. |
Sale response
Successful order
You receive:
- an HTTP code
201
- PayPal
orderId
(This is used in conjunction with your PayPal smart button to redirect a customer to their PayPal account) - an outcome
- links to
query your payment
Example response:
Copied!
{
"orderId": "orderId",
"outcome" : "pendingSale",
"_links": {
"action:events": {
"href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/ewogICJ2IiA6IDEsC"
},
"curies": [
{
"name": "action",
"href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
"templated": true
}
]
}
}
{ "orderId": "orderId", "outcome" : "pendingSale", "_links": { "action:events": { "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/ewogICJ2IiA6IDEsC" }, "curies": [ { "name": "action", "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}", "templated": true } ] } }
You receive an outcome
of pendingSale
. This doesn't mean that the payment has been fully processed. The customer must now complete their payment using the PayPal Smart Button.
Find out the latest status of your payment by using our notification or query service described in our
Note: In case of an error, you can get further information in our
Next steps