> ## Documentation Index
> Fetch the complete documentation index at: https://doc-test-my.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment Methods

> Check the various payment methods you can configure at the checkout by integrating with Razorpay APIs.

You can accept payments through several payment methods such as fpx, debit cards, credit cards and wallets. However, you can configure payment methods of your choice for collecting payments from your customers.

Check the [payment methods](/docs/payments/payment-gateway/s2s-integration/payment-methods/methods-api) activated for your account.

### Check the API Endpoint

On this page, we have listed the sample codes with the S2S JSON V2 API. If you are using the Redirect API version, use the API endpoint as suggested below:

| API Version    | Endpoint                                                                                                     |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| Redirect       | [https://api.razorpay.com/v1/payments/create/redirect](https://api.razorpay.com/v1/payments/create/redirect) |
| JSON V1 and V2 | [https://api.razorpay.com/v1/payments/create/json](https://api.razorpay.com/v1/payments/create/json)         |

#### Supported Payment Fields

Understand the fields required to construct a payment request:

`key_id` *mandatory*
: `string` The key id that you have generated from the **API Keys** tab in the Dashboard.

`amount` *mandatory*
: `integer` Payment amount in the smallest currency sub-unit. For example, if the amount to be charged is ₹299, then pass `29900` in this field.

`currency` *mandatory*
: `string` Currency code for the currency in which you want to accept the payment. For example, `MYR`. Refer to the list of [supported currencies](/docs/payments/international-payments#supported-currencies). Length must be of 3 characters.

`order_id` *mandatory*
: `string` Unique identifier of the Order.<br /> Know more about [Orders API](https://razorpay.com/docs/api/orders).

`ip` *mandatory*
: `string` Customer's IP address.

`email` *mandatory*
: `string` Email address of the customer. Maximum length supported is 40 characters.

`contact` *mandatory*
: `string`  Phone number of the customer. Maximum length supported is 15 characters, inclusive of country code.

`authentication` *optional*
: `object` Details of the authentication channel.

`authentication_channel`
: `string` The authentication channel for the payment. Possible values:

* `browser` (default)
* `app`

`browser` *mandatory*
: `object` Information regarding the customer's browser. This parameter need not be passed when `authentication_channel=app`.

`java_enabled`
: `boolean` Indicates whether the customer's browser supports Java. Obtained from the `navigator` HTML DOM object. Possible values:

* `true`: Customer's browser supports Java.
* `false`: Customer's browser does not support Java.

`javascript_enabled`
: `boolean` Indicates whether the customer's browser can execute JavaScript. Obtained from the `navigator` HTML DOM object. Possible values:

* `true`: Customer's browser can execute JavaScript.
* `false`: Customer's browser cannot execute JavaScript.

`timezone_offset`
: `integer` Time difference between UTC time and the cardholder's browser local time. Obtained from the `getTimezoneOffset()` method applied to the `Date` object.

`screen_width`
: `integer` Total width of the payer's screen in pixels. Obtained from the `screen.width` HTML DOM property.

`screen_height`
: `integer` Obtained from the `navigator` HTML DOM object.

`color_depth`
: `integer` Obtained from the payer's browser using the `screen.colorDepth` HTML DOM property.

`language`
: `string` Obtained from the payer's browser using the `navigator.language` HTML DOM property. Maximum limit of 8 characters.

`method` *mandatory*
: `string` Name of the payment method. Possible values are:

* `card`
* `fpx`
* `wallet`

`card`
:  `object` Details associated with the card\`\`. Required if the payment method is `card`.

`number` *mandatory*
: `string` Unformatted card number. Required if the method is `card`.

`name` *mandatory*
: `string` Name of the cardholder. Required if the method is `card`.

`expiry_month` *mandatory*
: `integer` Expiry month for card in `MM` format. Required if the method is `card`.

`expiry_year` *mandatory*
: `string` Expiry year for card in `YY` format. Required if the method is `card`.

`cvv` *mandatory*
: `string` CVV printed on the back of card. Required if the method is `card`.

`bank`
: `string` Bank code of the bank used for the payment. Required if the method is `fpx`.

`wallet`
: `string` Wallet code for the wallet used for the payment. Required if the method is `wallet`.

`notes` *optional*
: `object` Key-value object used for passing tracking info. Refer to [Notes](/docs/api/understand#notes) for more details.

`callback_url` *optional*
: `string` URL endpoint where Razorpay will submit the final payment status.

`referrer` *optional*
: `string` Referrer header passed by the client's browser.

`user_agent` *optional*
: `string` Customer user-agent.

Sample payloads for each of the payment methods are shown below in the JSON format.

## Debit and Credit Cards

Given below is the sample code for card payments:

<CodeGroup>
  ```bash Request theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
  -X POST https://api.razorpay.com/v1/payments/create/json \
  -H "Content-Type: application/json" \
  -d '{
  	"amount": 100,
  	"currency": "MYR",
  	"contact": "9000090000",
  	"email": "nur.aisyah@example.com",
  	"order_id": "order_DPzFe1Q1dEOKed",
  	"method": "card",
  	"card": {
      	"number": "4386289407660153",
      	"name": "Nur",
      	"expiry_month": 11,
      	"expiry_year": 30,
      	"cvv": 100
      },
      "authentication": {
          "authentication_channel": "browser"
      },
      "browser": {
          "java_enabled": false,
          "javascript_enabled": false,
          "timezone_offset": 11,
          "color_depth": 23,
          "screen_width": 23,
          "screen_height": 100
      }
      // Note: The authentication and browser parameters are applicable for 3DS 2 transactions
  }'
  ```

  ```json Response theme={null}
  {
    "next": [
      {
        "action": "redirect",
        "url": "https://api.razorpay.com/v1/payments/LdDXnHYxjDwQ1b/authenticate?rearch=1"
      },
      {
        "action": "otp_generate",
        "url": "https://api.razorpay.com/pg_router/v1/payments/pay_LdDXnHYxjDwQ1b/otp_generate?key_id=rzp_live_XXXXXXXXXXXXXX"
      }
    ],
    "razorpay_payment_id": "pay_LdDXnHYxjDwQ1b"
  }
  ```
</CodeGroup>

#### Supported Card Networks

List of supported card networks:

* Visa
* Mastercard

## FPX

Given below is the sample code for FPX payments. Pass the value for the `bank` parameter as shown below:

<CodeGroup>
  ```bash Request theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
  -X POST https://api.razorpay.com/v1/payments/create/json
  -H "Content-Type: application/json" \
  -d '{
  	"amount": 200000,
  	"currency": "MYR",
  	"contact": "9000090000",
  	"email": "nur.aisyah@example.com",
  	"order_id": "order_DPzFe1Q1dEObDT",
  	"method": "fpx",
  	"bank": "ARBK"
  }'
  ```

  ```json Response theme={null}
  {
    "razorpay_payment_id": "pay_LH5u4G73PdHG6s",
    "next": [
      {
        "action": "redirect",
        "url": "https://api.razorpay.com/v1/payments/LH5u4G73PdHG6s/authenticate"
      }
    ]
  }
  ```
</CodeGroup>

#### Supported Banks

Fetch the supported bank codes using the [Methods API](/docs/payments/payment-gateway/s2s-integration/payment-methods/methods-api).

## Wallet

Given below is the sample code for wallet payments. Pass the wallet provider name as shown:

<CodeGroup>
  ```bash Request theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
  -X POST https://api.razorpay.com/v1/payments/create/json
  -H "Content-Type: application/json" \
  -d '{
  	"amount": 200000,
  	"currency": "MYR",
  	"contact": "9000090000",
  	"email": "nur.aisyah@example.com",
  	"order_id": "order_DPzFe1Q1dEObDU",
  	"method": "wallet",
  	"wallet": "touchngo"
  }'
  ```

  ```json Response theme={null}
  {
    "razorpay_payment_id": "pay_LH66fCVePbPIN3",
    "next": [
      {
        "action": "redirect",
        "url": "https://api.razorpay.com/v1/payments/LH66fCVePbPIN3/authenticate"
      }
    ]
  }
  ```
</CodeGroup>

#### Supported Wallets

The table below lists the various wallets available to you.

| Wallet Provider | Wallet Code | Availability |
| --------------- | ----------- | ------------ |
| Touch 'n Go     | `touchngo`  | ✓            |
| GrabPay         | `grabpay`   | ✓            |
| mCash           | `mcash`     | ✓            |
| Boost           | `boost`     | ✓            |

#### Acceptable Image Formats and Sizes

The acceptable image formats and sizes are:

* .jpeg
* .jpg
* .png
* Maximum accepted size is 6 MB.

#### Error Reasons

Know about [errors under Recurring Payments FAQs](https://razorpay.com/docs/payments/recurring-payments/paper-nach/faqs#14-what-are-the-errors-i-get-while).
