# Create Payment — Adyen

> Creates a payment for a shopper. See the documentation

- Key: `adyen-create-payment`
- Type: Action (Write)
- Version: 0.0.2
- App: Adyen (`adyen`) — https://pipedream.com/apps/adyen.md
- This page (HTML): https://pipedream.com/apps/adyen/actions/create-payment
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/adyen/actions/create-payment/create-payment.mjs

## Description

Creates a payment for a shopper. [See the documentation](https://docs.adyen.com/api-explorer/Checkout/71/post/payments)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `merchantAccount` | `string` | Yes | The merchant account identifier, with which you want to process the transaction. |
| `amountCurrency` | `string` | Yes | The currency of the payment amount. The three-character ISO currency code. |
| `amountValue` | `integer` | Yes | The amount of the transaction, in minor units. |
| `reference` | `string` | Yes | The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (-). Maximum length: 80 characters. |
| `returnUrl` | `string` | Yes | The URL to return to in case of a redirection. The format depends on the channel. For more information refer the documentation. |
| `paymentMethodType` | `string` | Yes | The payment method used for the payment. For example scheme or paypal. For the full list of payment methods, refer to the documentation. Options are loaded from the connected account. |
| `paymentMethodDetails` | `object` | No | The payment method details object required for submitting additional payment details. Should contain relevant payment details fields. For more information refer the documentation. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "adyen",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "adyen-create-payment",
  arguments: {
    merchantAccount: "Merchant Account",
    amountCurrency: "Currency",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "adyen-create-payment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    adyen: { authProvisionId: "apn_xxxxxxx" },
    merchantAccount: "Merchant Account",
    amountCurrency: "Currency",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "adyen-create-payment",
    "configured_props": {
      "adyen": { "authProvisionId": "apn_xxxxxxx" },
      "merchantAccount": "Merchant Account",
      "amountCurrency": "Currency"
    }
  }'
```

---

- App: https://pipedream.com/apps/adyen.md · All apps: https://pipedream.com/apps
