POST
/
v2
/
payment-methods
/
create-intent
Payment Method - Create Intent
curl --request POST \
  --url https://sandbox.hyperswitch.io/v2/payment-methods/create-intent \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "metadata": {},
  "billing": {
    "address": {
      "city": "New York",
      "country": "AF",
      "line1": "123, King Street",
      "line2": "Powelson Avenue",
      "line3": "Bridgewater",
      "zip": "08807",
      "state": "New York",
      "first_name": "John",
      "last_name": "Doe",
      "origin_zip": "08807"
    },
    "phone": {
      "number": "9123456789",
      "country_code": "+1"
    },
    "email": "<string>"
  },
  "customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8"
}'
{
  "id": "12345_pm_01926c58bc6e77c09e809964e72af8c8",
  "merchant_id": "merchant_1671528864",
  "customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
  "payment_method_type": "card",
  "payment_method_subtype": "ach",
  "recurring_enabled": true,
  "created": "2023-01-18T11:04:09.922Z",
  "last_used_at": "2024-02-24T11:04:09.922Z",
  "payment_method_data": {
    "card": {
      "issuer_country": "AF",
      "last4_digits": "<string>",
      "expiry_month": "<string>",
      "expiry_year": "<string>",
      "card_holder_name": "<string>",
      "card_fingerprint": "<string>",
      "nick_name": "<string>",
      "card_network": "Visa",
      "card_isin": "<string>",
      "card_issuer": "<string>",
      "card_type": "<string>",
      "saved_to_locker": true
    }
  },
  "connector_tokens": [
    {
      "token": "pm_9UhMqBMEOooRIvJFFdeW",
      "connector_token_request_reference_id": "<string>"
    }
  ],
  "network_token": {
    "payment_method_data": {
      "last4_digits": "<string>",
      "issuer_country": "AF",
      "network_token_expiry_month": "<string>",
      "network_token_expiry_year": "<string>",
      "nick_name": "<string>",
      "card_holder_name": "<string>",
      "card_isin": "<string>",
      "card_issuer": "<string>",
      "card_network": "Visa",
      "card_type": "<string>",
      "saved_to_locker": true
    }
  }
}

Authorizations

api-key
string
header
required

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Body

application/json
customer_id
string
required

The unique identifier of the customer.

Required string length: 32 - 64
Example:

"12345_cus_01926c58bc6e77c09e809964e72af8c8"

metadata
object | null

You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.

billing
object

Response

Payment Method Intent Created

id
string
required

The unique identifier of the Payment method

Example:

"12345_pm_01926c58bc6e77c09e809964e72af8c8"

merchant_id
string
required

Unique identifier for a merchant

Example:

"merchant_1671528864"

customer_id
string
required

The unique identifier of the customer.

Required string length: 32 - 64
Example:

"12345_cus_01926c58bc6e77c09e809964e72af8c8"

payment_method_type
enum<string>
required

Indicates the type of payment method. Eg: 'card', 'wallet', etc.

Available options:
card,
card_redirect,
pay_later,
wallet,
bank_redirect,
bank_transfer,
crypto,
bank_debit,
reward,
real_time_payment,
upi,
voucher,
gift_card,
open_banking,
mobile_payment
payment_method_subtype
enum<string>

Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.

Available options:
ach,
affirm,
afterpay_clearpay,
alfamart,
ali_pay,
ali_pay_hk,
alma,
amazon_pay,
paysera,
apple_pay,
atome,
bacs,
bancontact_card,
becs,
benefit,
bizum,
blik,
bluecode,
boleto,
bca_bank_transfer,
bni_va,
breadpay,
bri_va,
bhn_card_network,
card_redirect,
cimb_va,
classic,
credit,
crypto_currency,
cashapp,
dana,
danamon_va,
debit,
duit_now,
efecty,
eft,
eps,
flexiti,
fps,
evoucher,
giropay,
givex,
google_pay,
go_pay,
gcash,
ideal,
interac,
indomaret,
klarna,
kakao_pay,
local_bank_redirect,
mandiri_va,
knet,
mb_way,
mobile_pay,
momo,
momo_atm,
multibanco,
online_banking_thailand,
online_banking_czech_republic,
online_banking_finland,
online_banking_fpx,
online_banking_poland,
online_banking_slovakia,
oxxo,
pago_efectivo,
permata_bank_transfer,
open_banking_uk,
pay_bright,
paypal,
paze,
pix,
pay_safe_card,
przelewy24,
prompt_pay,
pse,
red_compra,
red_pagos,
samsung_pay,
sepa,
sepa_bank_transfer,
skrill,
sofort,
swish,
touch_n_go,
trustly,
twint,
upi_collect,
upi_intent,
vipps,
viet_qr,
venmo,
walley,
we_chat_pay,
seven_eleven,
lawson,
mini_stop,
family_mart,
seicomart,
pay_easy,
local_bank_transfer,
mifinity,
open_banking_pis,
direct_carrier_billing,
instant_bank_transfer,
instant_bank_transfer_finland,
instant_bank_transfer_poland,
revolut_pay,
indonesian_bank_transfer
recurring_enabled
boolean | null

Indicates whether the payment method supports recurring payments. Optional.

Example:

true

created
string<date-time> | null

A timestamp (ISO 8601 code) that determines when the payment method was created

Example:

"2023-01-18T11:04:09.922Z"

last_used_at
string<date-time> | null

A timestamp (ISO 8601 code) that determines when the payment method was last used

Example:

"2024-02-24T11:04:09.922Z"

payment_method_data
object
connector_tokens
object[] | null

The connector token details if available

network_token
object