Authorise for PayPal Payment

First we need to authorise the PayPal payment. The procedure is much like credit card payment. We start with an API call to the endpoint for PayPal authorisation:

POST /api/v2/Smart/Transactions/STX_xxx/prepare/paypal HTTP/1.1
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
"callback_urls": {
"success_url": "",
"failure_url": ""

This are the parameters:




Your URL to direct the customer to after successful authorization or conclusion.


Your URL to direct the customer when the authorization failed, or he canceled the process.

If everything is fine, the API responds with 200 OK and the object representation. The status is still created (or processing) and there is an iframe_url:

HTTP/1.1 200 OK
Content-Type: application/json
"object": "smart.transactions",
// ...
"transactions": [
"object": "payment.transactions",
"id": "PCI_DGV8C350XMXP2PDBHQS63W5000W9NN"
// ...
"updated": "2020-11-13T10:39:13+01:00",
"status": "created",
// ...
"payment_method": "paypal",
"trans_id": "40000537",
"iframe_url": "",
// ...

Now you need to direct the user to the iframe_url. This takes him to the PayPal page. After finishing the process there, he is directed back either to you success_url or to the failure failure_url.

When the user arrives at the success URL, the Smart Transaction is updated too. It has status approved now, and can be captured now. If auto_capture was enabled for this Smart Transaction, the status would be ok, received or collection. The payment ist alreay captured, and you can save the next API call.

When the user arrives at the failure URL, the Smart Transaction has status failed, and you must repeat the payment process.