PayPal

The following details are required when creating a new order, for any payment method:

  • Currency
  • Amount
  • Payment method

Example of the HTTP headers for an order creation request:

POST /v1/orders/ HTTP/1.1
Authorization: Basic aHVudGVyMjo=
Content-Type: application/json

Example PayPal request body:

{
  "merchant_order_id": "EXAMPLE000",
  "amount": 995,
  "currency": "EUR",
  "description": "Example PayPal order",
  "return_url": "http://www.example.com/",
  "transactions": [
    {
      "payment_method": "paypal"
    }
  ]
}

Performing the redirect

To make the actual payment, the customer needs to visit the URL supplied in the returned payment_url field. This should be accomplished by using an HTTP redirect.

As soon as the customer visits the payment link, the order status will change from new to processing.