Skip to content

Creates a card payment method

Request

POST {{baseURL}}/v2/payment-methods/cards

This endpoint creates a card (credit or debit) payment method.

The card information is tokenized and stored, assigning it to the merchant.

Tokenization means the sensitive payment data, such as the raw card number or bank account number, is submitted to Flute once. After that, Flute assigns a non-sensitive value to paymentMethodId. The paymentMethodId is then used as the payment reference for later transactions.

See Also:
To add a new ACH payment method, see POST /v2/payment-methods/ach.
To list payment methods, see GET /v2/payment-methods.
To retrieve a payment method, see GET /v2/payment-methods/{{paymentMethodId}}.
To update a payment method, see PATCH /v2/payment-methods/{{paymentMethodId}}.

Security
Bearer
Bodyapplication/json
cardNumberstring or nullrequired

Specifies the credit card number used for the transaction.

Example: 4111111111111111

Example:"4111111111111111"
securityCodestring or null

Specifies the securityCode (sometimes also called similarly to CCV) for the card.

This is a three or four digit security code on the credit card.

Example: 483

Example:"483"
expirationMonthinteger or null, (int32), [ 1 .. 12 ]required

Identifies the expiration month (in a two-digit number format) of the card.

Examples:
07
12

Example:12
expirationYearinteger or null, (int32)required

Identifies the expiration year (in a four-digit number) of the card.

Example: 2032

Example:2032
customerIdstring or null, (uuid)

Identifies the customer to link this payment method to.

This value may be null when this payment method is an orphan owned by the merchant directly. An orphan payment method is a payment method in the merchant's vault but has no customer record associated with it.

Example: 8fa8e727-73c6-436e-b56f-6f55aabf3b1c

Example:"8fa8e727-73c6-436e-b56f-6f55aabf3b1c"
paymentNamestring or null

Specifies the name for the payment method.

This is a free-formed name that is convenient for the merchant to recognize.

Example: Peppared Street Cafe's Preferred Payment

Example:"Peppared Street Cafe's Preferred Payment"
curl -i -X POST \
  https://sandbox.api.flute.com/v2/payment-methods/cards \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customerId": "098290e9-49cd-4613-a885-db61a29f80f7",
    "paymentName": "My Visa Card",
    "cardNumber": "4111111111111111",
    "securityCode": "123",
    "expirationMonth": 12,
    "expirationYear": 2030
  }'

Responses

OK

Bodyapplication/json
paymentMethodIdstring or null, (uuid)

Indicates the payment method identifier.

This is the identifier of a previously saved ACH account to charge.

Example: 39a95e35-6d50-45ec-884b-c2417edf005d

Example:"39a95e35-6d50-45ec-884b-c2417edf005d"
Response
{ "paymentMethodId": "83eed29d-849d-4aff-8ff7-02783bfe97d5" }