Payments/
Paying for an Order/
Adyen Payments

Adyen Payments

Adyen integration supports the following payment methods:

  • authorize
  • capture
  • purchase

POST Pay by token

https://api.moltin.com/v2/orders/:orderId/payments

Parameters

Path parameters

NameRequiredTypeDescription
orderIdRequiredstringThe Universally Unique Identifier (UUID) of the order that you want to pay for.

Headers

NameRequiredTypeDescription
AuthorizationRequiredstringThe Bearer token required to get access to the API.

Body

NameRequiredTypeDescription
paymentRequiredstringThe Adyen recurringDetailReference payment method identifier.
methodRequiredstringEnter purchase or authorize.
gatewayRequiredstringEnter adyen.
options.shopper_referenceRequiredstringThe shopper reference token associated with the saved payment method.
options.recurring_processing_modelOptionalstringEnter CardOnFile for a one-time purchase.

Request Examples

Curl

curl -X POST https://api.moltin.com/v2/orders/:order_id/payments \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": {
        "gateway": "adyen",
        "method": "purchase",
        "payment": "##8315932173953405",
        "options": {
			"shopper_reference": "MyShopper12345",
			"recurring_processing_model": "CardOnFile"
        }
      }
    }'

JavaScript SDK

const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
  client_id: 'X'
})
const orderId = 'XXXX'
Moltin.Orders.Payment(orderId, {
  gateway: 'adyen',
  method: 'purchase',
  payment: "##8315932173953405",
  options: {
    shopper_reference: "MyShopper12345",
	recurring_processing_model: "CardOnFile"
  }
}).then(() => {
  // Do something
})

Response Example

200 OK

{
    "data": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "type": "transaction",
        "reference": "#882593221587009K#",
        "gateway": "adyen",
        "amount": 100,
        "currency": "USD",
        "transaction-type": "purchase",
        "status": "complete",
        "relationships": {
            "order": {
                "data": {
                    "type": "order",
                    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                }
            }
        },
        "meta": {
            "display_price": {
                "amount": 100,
                "currency": "USD",
                "formatted": "$100.00"
            },
            "created_at": "2019-01-31T17:20:39.378Z"
        }
    }
}

Was this helpful?

Previous
Paying for an order Overview

Learn

Docs