---
title: "Create a payment method setup request for a customer"
method: POST
path: "/api/customer/{customerEmail}/payment-methods"
tags: ["Customer"]
---

# Create a payment method setup request for a customer

`POST /api/customer/{customerEmail}/payment-methods`

Creates a pending setup request that allows a customer to securely save a payment method. Returns a setup request `id` to pass as `setupId` to the InflowPay iframe SDK. The SDK handles card collection, tokenization, and 3DS authentication in subsequent steps. The request status advances from `pending` to `completed` (or `failed`) asynchronously once the card is confirmed.

## Path parameters

- `customerEmail` string, required

## Request body

- CreateCustomerPaymentMethodDto
  - `currency` 'EUR' | 'USD', required — Currency for the payment method (EUR or USD). The saved payment method will be usable for charges in this currency.
  - `card` CardInfoDto
    - `number` string, required — Card number (13-19 digits)
    - `expiration_month` number, required — Card expiration month (1-12)
    - `expiration_year` number, required — Card expiration year (4 digits)
    - `cvc` string, required — Card security code (CVC/CVV, 3-4 digits)
  - `threeDsSuccessUrl` string — **PCI / server-to-server only** — For merchants who transmit card data via their API. URL to redirect to after successful 3DS authentication.
  - `threeDsFailureUrl` string — **PCI / server-to-server only** — For merchants who transmit card data via their API. URL to redirect to after failed 3DS authentication.
  - `firstName` string — Optional in the API schema, but **required** when the customer has no first name on file (e.g. new customers) or when that data is missing — 3DS cannot be started without it.
  - `lastName` string — Optional in the API schema, but **required** when the customer has no last name on file (e.g. new customers) or when that data is missing — 3DS cannot be started without it.

## Response `200`

Setup request created successfully. Use the returned `id` as `setupId` in the iframe SDK.

- CreateSetupPaymentMethodRequestResponseDto
  - `id` string, required — Unique ID of the setup request. Pass this as `setupId` to the InflowPay iframe SDK so it can connect via WebSocket and confirm the card.
  - `customerId` string, required — ID of the customer this payment method will be attached to.
  - `customerEmail` string, required — Email of the customer.
  - `status` 'pending' | 'completed' | 'failed' | 'requires_3ds' | 'cancelled', required — Current status of the setup request. Always `pending` on creation — the status advances to `completed` or `failed` after the card is confirmed via the SDK.
  - `currency` 'EUR' | 'GBP' | 'USD', required — Currency of the payment method (EUR or USD).

## Other responses

- `400` — Invalid input data or customer not found
- `401` — Unauthorized - Invalid API key

---

[API](https://skmtc.dev/inflowpay/apis/inflow-api.md) · [All operations](https://skmtc.dev/inflowpay/apis/inflow-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/inflowpay/inflow-api/revisions/3012dd3dd14a/schema)
