Make a payment

Initiate a payment with input details you collected from the shopper.


Use the /payments endpoint to start a payment transaction. Here, you send in the payment request parameters (such as currency and transaction value), together with the input details as collected from the shopper.

Adyen will then process the payment and return a result in the response. This result indicates whether the payment has reached a final state (authorised/refused), or you should perform additional steps to complete the payment such as 3D Secure and iDEAL.

Card payments

For initiating a card payment, you can submit raw card data, if you are PCI-compliant at Level 1 or 2.

{
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "reference":"Your order number",
   "amount":{
      "currency":"EUR",
      "value":1000
   },
   "paymentMethod":{
      "type":"scheme",
      "number":"4111111111111111",
      "expiryMonth":"08",
      "expiryYear":"2018",
      "holderName":"John Smith",
      "cvc":"737"
   },
   "returnUrl":"https://your-company.com/..."
}
{
   "pspReference":"8515232733321252",
   "resultCode":"Authorised",
   "additionalData":{
      "liabilityShift":"false",
      "refusalReasonRaw":"AUTHORISED",
      ...
   }
}

Alternatively, you can make use of Secured Fields, as shown in the example below:

{
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "reference":"Your order number",
   "amount":{
      "currency":"EUR",
      "value":1000
   },
   "paymentMethod":{
      "type":"scheme",
      "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
      "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
      "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
      "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH..."
   },
   "returnUrl":"https://your-company.com/..."
}
{
   "pspReference":"8515232733321252",
   "resultCode":"Authorised",
   "additionalData":{
      "liabilityShift":"false",
      "refusalReasonRaw":"AUTHORISED",
      ...
   }
}

Card with 3D Secure

If 3D Secure is required to a card payment, you will get a response with redirect information, as shown in the example below.

{
   "browserInfo":{
      "userAgent":"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008052912 Firefox/3.0",
      "acceptHeader":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
   },
   "additionalData":{
      "executeThreeD":"true"
   },
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "reference":"Your order number",
   "amount":{
      "currency":"EUR",
      "value":1000
   },
   "paymentMethod":{
      "type":"scheme",
      "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
      "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
      "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
      "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH..."
   },
   "returnUrl":"https://your-company.com/..."
}
{
   "resultCode":"RedirectShopper",
   "details":[
      {
         "key":"MD",
         "type":"text"
      },
      {
         "key":"PaRes",
         "type":"text"
      }
   ],
   "paymentData":"Ab02b4c0!BQABAgBKNFnhRjSn4jZPsP7nywoY...",
   "redirect":{
      "data":{
         "PaReq":"eNpVUttygjAQ/RXbDyAJl4LMmg6VztQH1LH63GHCjtApAQNU9O...",
         "TermUrl":"app://",
         "MD":"djIhMFQxMHpFRHlyY3BOSHJ1UUNmZnk1Zz09IZ3a9YOyDsr30Ni+jrj0M3pyy..."
      },
      "method":"POST",
      "url":"https://test.adyen.com/hpp/3d/validate.shtml"
   }
}

iDEAL payments

Certain payment methods, such as iDEAL, require the shopper to complete a payment in an external app or website. In this case, the response will contain a redirect object with the information required to perform the redirect. Use this to redirect the shopper to the given URL using either the POST or GET method.

After the shopper has completed the payment, they will be redirected to the returnUrl that you passed in the request to /payments. This return URL is appended with a URL query, which you will need to submit to the /payments/details endpoint.

{
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "reference":"Your order number",
   "amount":{
      "currency":"EUR",
      "value":1000
   },
   "paymentMethod":{
      "type":"ideal",
      "idealIssuer":"0721"
   },
   "returnUrl":"https://your-company.com/..."
}
{
   "resultCode":"RedirectShopper",
   "details":[
      {
         "key":"returnUrlQueryString",
         "type":"text"
      }
   ],
   "paymentData":"Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...",
   "redirect":{
      "method":"GET",
      "url":"https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal&countryCode=NL..."
   }
}

See also