PayPal
Start accepting PayPal payments and open your business to thousands of online shoppers.
To start accepting PayPal payments, please contact your customer success manager.
Process a PayPal payment
PayPal payments follow a two-step process:
Step 1: Request a PayPal payment
The request
Use the details below to set up your request.
Endpoint live
Endpoint sandbox
Header parameters
Header | Value |
---|---|
|
|
|
|
Body parameters
Field name | Description |
---|---|
amount Integer required | The payment amount. |
| The three-letter ISO 4217 currency code. |
| Details about the payment source. |
| The type of payment source. Set this to |
| Your unique internal invoice number or tracking ID.\ Using the same value in the optional |
| The full name of the shipment's recipient, if applicable.\ If provided, the |
| The URL for your logo. Your logo will appear at the top of the cart review area.\ Use a graphic file format, such as .gif, .jpg or .png, and host the image on a secure (https) server. Character limit: 127 alphanumeric characters. Width: 190px. Height: 60px. |
| These details are used by PayPal to perform a pre-transaction risk management evaluation. The property names should match those you agreed with PayPal. |
Request example
{
"amount": 100,
"currency": "EUR",
"source": {
"type": "paypal",
"invoice_number": "CKO00001",
"logo_url": "https://www.example.com/logo.jpg",
"stc": {
"property_name1": "property 1",
"property_name2": "property 2",
"property_name3": "property 3"
}
}
}
The response
If you receive a 202 Success
response containing a status
field set to Pending
, your request was successful.
Response example
{
"id": "pay_ks2zlgzmff7ejnbvkpdw5n4liq",
"status": "Pending",
"customer": {
"id": "cus_ho2i3q5rgl4e7ed3uox4ez4a5m"
},
"_links": {
"self": {
"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq"
},
"redirect": {
"href": "https://www.sandbox.paypal.com/checkoutnow?token=EC-45B75666L8055651R&useraction=commit"
}
}
}
Step 2: Redirect the customer
Redirect your customer to the redirect
link’s href in the response. The customer will be redirected to a PayPal page where they can authorize the payment, before being transferred to your predefined success or failure URL.
Get details about a PayPal payment
You can use the payment_id
found in the payment response, or the cko-session-id
from the success/failure URL (e.g., https://www.checkout.com/order/succeeded?cko-session-id=**sid_vii64oquze5u3h2x6hh4rurc4y**) to retrieve details about the payment.
The
cko-session-id
expires 15 minutes after being created.
The request
Use the details below to set up your request.
Endpoint
Live
Sandbox
Header and path parameters
Header | Value |
---|---|
|
|
|
|
Path | Value |
---|---|
| The payment ID, found in the payment response, or the session ID from the success/failure URL. |
The response
Response example
{
"id": "pay_ks2zlgzmff7ejnbvkpdw5n4liq",
"requested_on": "2019-07-17T07:24:12Z",
"source": {
"type": "paypal"
},
"amount": 100,
"currency": "EUR",
"payment_type": "Regular",
"status": "Captured",
"approved": true,
"risk": {
"flagged": false
},
"customer": {
"id": "cus_ho2i3q5rgl4e7ed3uox4ez4a5m"
},
"_links": {
"self": {
"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq"
},
"actions": {
"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq/actions"
},
"refund": {
"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq/refunds"
}
}
}
Testing PayPal
To start testing, you'll need to:
- create a test account, and
- contact your customer success manager or integrations engineer to activate PayPal payments in the sandbox environment.
-
Create a PayPal transaction as above, following the redirect link in the response to PayPal's website.
-
Log in with your PayPal username and password.
-
Set the payment status – pending, paid, or refused – and then click "Confirm".
-
You should then be redirected to your predefined success URL.
Can we help?
Thanks for using Checkout.com. If you need any help or just have a question, please get in touch with our support team at [email protected].
Updated 5 months ago