PayPal
Last updated: April 29, 2022
Start accepting PayPal payments and open your business to thousands of online shoppers.
Information
To start accepting PayPal payments, please contact your Account Manager.
Model | GW only |
---|---|
Payment flow | Redirect |
Payment method type | Wallet |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
PayPal payments follow a two-step process:
You can find the full list, as well as complete request and response examples, in our API reference.
post
https://api.checkout.com/payments
1{2"amount": 100,3"currency": "EUR",4"source": {5"type": "paypal",6"invoice_number": "CKO00001",7"logo_url": "https://www.example.com/logo.jpg",8"stc": {9"property_name1": "property 1",10"property_name2": "property 2",11"property_name3": "property 3"12}13}14}
If you receive a 202 Success
response containing a status
field set to Pending
, your request was successful.
1{2"id": "pay_ks2zlgzmff7ejnbvkpdw5n4liq",3"status": "Pending",4"customer": {5"id": "cus_ho2i3q5rgl4e7ed3uox4ez4a5m"6},7"_links": {8"self": {9"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq"10},11"redirect": {12"href": "https://www.sandbox.paypal.com/checkoutnow?token=EC-45B75666L8055651R&useraction=commit"13}14}15}
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.
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.
Note
The cko-session-id
expires 15 minutes after being created.
Use the details below to set up your request.
You can find the full list, as well as complete request and response examples, in our API reference.
get
https://api.checkout.com/payments/{payment_id}
1{2"id": "pay_ks2zlgzmff7ejnbvkpdw5n4liq",3"requested_on": "2019-07-17T07:24:12Z",4"source": {5"type": "paypal"6},7"amount": 100,8"currency": "EUR",9"payment_type": "Regular",10"status": "Captured",11"approved": true,12"risk": {13"flagged": false14},15"customer": {16"id": "cus_ho2i3q5rgl4e7ed3uox4ez4a5m"17},18"_links": {19"self": {20"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq"21},22"actions": {23"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq/actions"24},25"refund": {26"href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq/refunds"27}28}29}
Note
To start testing, you'll need to:
- create a test account, and
- contact your Account 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 select Confirm. You should then be redirected to your predefined success URL.