---
updatedAt: 2026-07-15T07:39:07.000Z
agentTools:
  projectIndex: https://docs.payu.in/llms.txt
---

# CB - Cards

Merchant-hosted card payment via the Cross-Border Cards S2S flow. This operation documents the complete-card request schema.

***

title: Cards - CB
api:
file: Merchant Hosted Cards API.json
operationId: merchantHostedCheckoutCards
hidden: false
link:
new\_tab: false
metadata:
title: >-
Collect Payment API using Cards - Merchant Hosted with Cross-Border
Payments
--------

You can collect payments from customers with leading cards using the Merchant Hosted integration for Cross-Border Payments. Post to **`/_payment`** with **`txn_s2s_flow=4`** for the Cross-Border Cards server-to-server (S2S) flow. The **buyer\_type\_business** parameter indicates the type of business of the buyer.

After the payment is complete, you must use the [Invoice Upload API](https://docs.payu.in/reference/invoice_upload_api) to upload invoices / AWBs (Air-way bill number). AWB details are mandatory for Goods transactions.

<Callout icon="📘" theme="info">
  **Reference**: For steps to integrate Cards for Cross-Border Payments, refer to [[S2S] Plain Cards Integration - Merchant Hosted Integration](doc:plain-cards-integration-one-time-pacb) or [[S2S] Process Saved Cards with a PayU Token](doc:cards-with-payu-tokenization-one-time-pacb)
</Callout>

### Environment

|                            |                                   |
| :------------------------- | :-------------------------------- |
| **Test Environment**       | `https://test.payu.in/_payment`   |
| **Production Environment** | `https://secure.payu.in/_payment` |

<Accordion title="Sample Request" icon="fa-info-code">
  **With complete card details**

  ```curl
  curl --location --request POST 'https://test.payu.in/_payment' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'key=JPM7Fg' \
  --data-urlencode 'txnid=payuTestTransaction12345' \
  --data-urlencode 'amount=100.00' \
  --data-urlencode 'firstname=Ashish' \
  --data-urlencode 'lastname=Kumar' \
  --data-urlencode 'email=test@payu.in' \
  --data-urlencode 'phone=9988776655' \
  --data-urlencode 'productinfo=Product Info' \
  --data-urlencode 'address1=123 Main Street' \
  --data-urlencode 'city=New York' \
  --data-urlencode 'state=NY' \
  --data-urlencode 'country=US' \
  --data-urlencode 'zipcode=10001' \
  --data-urlencode 'surl=https://test.payu.in/admin/test_response' \
  --data-urlencode 'furl=https://test.payu.in/admin/test_response' \
  --data-urlencode 'pg=CC' \
  --data-urlencode 'bankcode=CC' \
  --data-urlencode 'ccnum=5506900480000008' \
  --data-urlencode 'ccname=Test User' \
  --data-urlencode 'ccvv=123' \
  --data-urlencode 'ccexpmon=09' \
  --data-urlencode 'ccexpyr=2026' \
  --data-urlencode 'udf1=AELPR1234E' \
  --data-urlencode 'udf2=' \
  --data-urlencode 'udf3=02-02-1980' \
  --data-urlencode 'udf4=XYZ Pvt. Ltd.' \
  --data-urlencode 'udf5=INV123456' \
  --data-urlencode 'buyer_type_business=1' \
  --data-urlencode 'udf_params={"udf7":"0100000029","udf8":"99953729071"}' \
  --data-urlencode 'txn_s2s_flow=4' \
  --data-urlencode 's2s_client_ip=10.200.12.12' \
  --data-urlencode 's2s_device_info=Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0' \
  --data-urlencode 'hash=YOUR_CALCULATED_HASH'
  ```

  **With saved card**

  ```curl
  curl --location --request POST 'https://test.payu.in/_payment' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'key=JPM7Fg' \
  --data-urlencode 'txnid=payuTestTransaction12345' \
  --data-urlencode 'amount=100.00' \
  --data-urlencode 'firstname=Ashish' \
  --data-urlencode 'email=test@payu.in' \
  --data-urlencode 'phone=9988776655' \
  --data-urlencode 'productinfo=Product Info' \
  --data-urlencode 'address1=123 Main Street' \
  --data-urlencode 'city=New York' \
  --data-urlencode 'state=NY' \
  --data-urlencode 'country=US' \
  --data-urlencode 'zipcode=10001' \
  --data-urlencode 'surl=https://test.payu.in/admin/test_response' \
  --data-urlencode 'furl=https://test.payu.in/admin/test_response' \
  --data-urlencode 'pg=CC' \
  --data-urlencode 'bankcode=CC' \
  --data-urlencode 'ccvv=123' \
  --data-urlencode 'txn_s2s_flow=4' \
  --data-urlencode 's2s_client_ip=10.200.12.12' \
  --data-urlencode 's2s_device_info=Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0' \
  --data-urlencode 'user_credentials=JPM7Fg:customer_1112' \
  --data-urlencode 'storecard_token_type=0' \
  --data-urlencode 'store_card_token=10a7d7a45b72644460f108' \
  --data-urlencode 'udf1=AELPR1234E' \
  --data-urlencode 'udf3=02-02-1980' \
  --data-urlencode 'udf4=XYZ Pvt. Ltd.' \
  --data-urlencode 'udf5=INV123456' \
  --data-urlencode 'buyer_type_business=1' \
  --data-urlencode 'udf_params={"udf7":"0100000029","udf8":"99953729071"}' \
  --data-urlencode 'hash=YOUR_CALCULATED_HASH'
  ```
</Accordion>

<Accordion title="Sample Response" icon="fa-info-reply">
  **S2S collect-payment response** (`txn_s2s_flow=4`)

  ```json
  {
    "rawBankData": "",
    "referenceId": "00c44a4c8306f9cbe5ecf6133afe08a7",
    "bankData": {
      "referenceId": "00c44a4c8306f9cbe5ecf6133afe08a7",
      "messageDigest": "c2e9e456037f033e5cc3d7b6e556189adf41eeabf706844dff70aac91f6b8e73bb1846286c8f99ea768cf38f7c12369c|523727493647950f32684bd6f1ab07aa6474016f",
      "pares": "eNrVmdeS47i2pl+lo8+loje968jOCHojGtGLvKM3opHoyacfZmZVde06PWfOzMXEjCIUgkBiYRHAWv8H4s0phyzj7CyZh+z9TcvGMSqy36r0r99jFAfhGIT/gLE8/QNNM/IPEiGoP5CUgGEwAjGCSH9/f7vRVjZ+NvgsnTVLNoxV371D/wL/Bb8B3/+exoekjLrp/S1KXoysv6MkQhHYG/Dt71ubDTL3DkMwhZIgRoIIAoL4G/BV/Qb83f42f5TG0+GtSt9Dp5gMTkMMGzxCLtm1mik1zkV02PzrDfi44y2NpuwdBuHTNgj9BiF/IsSfyOnbZ/3b88Mc3fbzaRuCwDfg54q3c2SGrEv2dwQ7nfnx7y3bnn2XnXecdn6U34C/fXtG3Tv40wcFQeK0fda+Off3t6lqf/YJ/RMi/4ShN+Cz/m2comme34M34FvpLYmW5Z2maYYVTJqWzadhJqu+0t8/57N+3vKWJdU7eA7rx+9nK7op+qGayvbD1X+veAM+XAE+p+79za6K7uxsyH7b2qYb//q9nKbnnwCwruu/VuRf/VAA8PkgAEgB5w3pWBX/8ftXqyyVu7z/32rGRl3fVUnUVEc0nQtEy6ayT3/74ds/mXGsD0sQYPHsH6epPxII7f74qAERCDttAv9s9Kcn++/08quzwxj9MZYR9NHBL4be36wszz5WRPaba8l//f4f36OAq4psnP5Puvve1c8WvtvzombO3mc3DXRwZEp92R+80+1LH1P8RNQ4/9f3dl93vgE//Pvm/NdM/TQiXzc6RMf6GG04qXdxrxgV1PAQ4FJa38tkuNT",
      "additionalInfo": {
        "authUdf1": "",
        "authUdf2": "",
        "authUdf3": "",
        "authUdf4": "",
        "authUdf5": "",
        "authUdf6": "",
        "authUdf7": "",
        "authUdf8": "",
        "authUdf9": "",
        "authUdf10": ""
      }
    },
    "authenticationStatus": "success",
    "hash": "664b8ddd1b5b2d1b68abb7eee5ea6e001a02773499ddcd86956ba0833315e7d4e69c641d7b0b3e7590532e21e71936da173f4eda716fc09f83cd1117f0d0c37c"
  }
  ```

  Validate the response **`hash`** before consuming the payload. Hash formula: `sha512(authenticationStatus|bankData|rawBankData|referenceId|SALT)`.
</Accordion>

<Accordion title="S2S response parameters" icon="fa-list">
  | **Parameter** | **Description** |
  | --- | --- |
  | rawBankData | Raw bank authentication response, URL-encoded in query-string format. |
  | referenceId | Reference ID for the transaction returned by PayU. |
  | bankData | JSON object used for the authorisation step. Contains `referenceId`, `messageDigest`, `pares`, and `additionalInfo` when authentication succeeds. |
  | authenticationStatus | Authentication status of the transaction (for example, `success`). |
  | hash | Response hash. Validate using `sha512(authenticationStatus\|bankData\|rawBankData\|referenceId\|SALT)` before consuming the response. |
</Accordion>

<Accordion title="Redirect response parameters" icon="fa-list">
  Parameters posted to **surl** or **furl** after the customer completes or abandons payment in browser-based flows.

  | **Parameter** | **Description** |
  | --- | --- |
  | mihpayid | Unique reference number created for each transaction at PayU's end; used to identify a transaction for refunds. |
  | mode | Payment category: CC (credit card), DC (debit card), NB (net banking), CASH, EMI, CLEMI, BNPL. |
  | bankcode | Code for the payment option used (for example, CC, VISA, MAST). |
  | status | Transaction status: `success`, `failure`, or `pending`. Treat `failure` and `pending` as failed for order mapping unless your integration guide specifies otherwise. |
  | unmappedstatus | Internal PayU status (for example, dropped, bounced, captured, auth, failed, usercancelled, pending). See [Payment State Explanations](https://docs.payu.in/reference/payment-state-explanations). |
  | key | Merchant key. |
  | error | Failure reason for failed transactions. |
  | error\_message | Error message. See [Error Codes](https://docs.payu.in/reference/error-codes). |
  | bank\_ref\_num | Bank reference number for successful transactions. |
  | txnid | Transaction ID posted by the merchant in the request. |
  | amount | Amount sent in the transaction request. |
  | cardCategory | Card category (domestic or international). |
  | discount | Discount amount applied by the merchant. |
  | net\_amount\_debit | Net amount debited. |
  | addedon | Transaction date and time. |
  | productinfo | Product information echoed from the request. |
  | firstname | First name echoed from the request. |
  | lastname | Last name echoed from the request. |
  | email | Email echoed from the request. |
  | phone | Phone echoed from the request. |
  | hash | Response hash. Verify using PayU post-response hash rules. See [Generate Hash](https://docs.payu.in/docs/generate-hash-merchant-hosted). |
  | PG\_TYPE | Payment gateway used for the transaction. |
  | udf1 | Echo of **udf1** from the request (buyer PAN for Cross-Border). |
  | udf2 | Echo of **udf2** from the request. |
  | udf3 | Echo of **udf3** from the request (buyer DOB for Cross-Border). |
  | udf4 | Echo of **udf4** from the request (merchant name for PA2PA). |
  | udf5 | Echo of **udf5** from the request (invoice ID). |
  | udf6 | Echo of **udf6** from the request. |
  | udf7 | Import or export code when passed via **udf_params**. |
  | udf8 | Airway bill / consignment number when passed via **udf_params**. |
  | udf9 | Echo of **udf9** from the request. |
  | success\_at | Date and timestamp when the transaction succeeded. |
  | cardnum | Masked card number (last four digits). |
  | issuing\_bank | Card issuing bank. |
</Accordion>

> 🚧 Values to be used in Test environment
>
> For values to be used in the test environment, refer to [Test Cards](https://docs.payu.in/docs/test-cards-upi-id-and-wallets#web-checkout).

> ❗️ Error handling
>
> If any error message is displayed with an error code, refer to the <a href="error-codes" target="_blank">Error Codes</a> section to understand the reason for these error codes. Also, for error codes during various transaction stages in Net Banking, Cards and Wallets, refer to [Transaction Stages - Transaction Stages - Error References on Field7 & Field8](https://docs.payu.in/reference/transaction-stages-error-references-field7-field8).

<Callout icon="📘" theme="info">
  **Reference**:

  * For the character limit of each parameter and detailed description, refer to [Additional Info for Payment APIs](https://docs.payu.in/reference/addl_info-payment-apis).
  * Card number formats of various card types: [Card Number Formats](https://docs.payu.in/docs/card-number-formats).
</Callout>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Merchant Hosted — Cross-Border Cards",
    "description": "OpenAPI 3.1 for PayU merchant-hosted **`POST /_payment`** in the Cross-Border Cards server-to-server (S2S) flow.\n\nPost `application/x-www-form-urlencoded` fields from your server. Set **`pg`** to **CC** and **`bankcode`** to **CC** for card payments. Build **`hash`** on your server per PayU rules.\n\nConfirm sandbox keys, hash sequence, and CB field requirements with your PayU Key Account Manager (KAM).",
    "version": "1.0.0"
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "servers": [
    {
      "url": "https://test.payu.in",
      "description": "Sandbox"
    },
    {
      "url": "https://secure.payu.in",
      "description": "Production"
    }
  ],
  "paths": {
    "/_payment": {
      "post": {
        "tags": [
          "Cross-Border Cards"
        ],
        "summary": "CB - Cards",
        "description": "Merchant-hosted card payment via the Cross-Border Cards S2S flow. This operation documents the complete-card request schema.",
        "operationId": "merchantHostedCheckoutCards",
        "requestBody": {
          "required": true,
          "description": "Form-encoded payment request. All S2S and billing fields marked required apply to the Cross-Border Cards flow.",
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "txnid",
                  "amount",
                  "productinfo",
                  "firstname",
                  "surl",
                  "furl",
                  "email",
                  "pg",
                  "bankcode",
                  "ccnum",
                  "ccvv",
                  "ccname",
                  "ccexpmon",
                  "ccexpyr",
                  "hash",
                  "lastname",
                  "phone",
                  "zipcode",
                  "txn_s2s_flow",
                  "s2s_client_ip",
                  "s2s_device_info",
                  "udf5"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Merchant key provided by PayU during onboarding.",
                    "example": "JPM7Fg"
                  },
                  "txnid": {
                    "type": "string",
                    "description": "The transaction ID is a reference number for a specific order that is generated by the merchant.",
                    "example": "fd3e847h2"
                  },
                  "amount": {
                    "type": "string",
                    "description": "The payment amount for the transaction. Post as a decimal string (for example, \"1000\" or \"10.00\").",
                    "example": "1000"
                  },
                  "productinfo": {
                    "type": "string",
                    "description": "A brief description of the product.",
                    "example": "iPhone"
                  },
                  "firstname": {
                    "type": "string",
                    "description": "The first name of the customer."
                  },
                  "surl": {
                    "type": "string",
                    "format": "uri",
                    "description": "The success URL, which is the page PayU will redirect to if the transaction is successful.",
                    "example": "https://test-payment-middleware.payu.in/simulatorResponse"
                  },
                  "furl": {
                    "type": "string",
                    "format": "uri",
                    "description": "The failure URL, which is the page PayU will redirect to if the transaction fails.",
                    "example": "https://test-payment-middleware.payu.in/simulatorResponse"
                  },
                  "email": {
                    "type": "string",
                    "description": "The email address of the customer."
                  },
                  "pg": {
                    "type": "string",
                    "description": "The pg parameter determines which payment tabs will be displayed on the PayU page. For cards, use CC.",
                    "example": "CC"
                  },
                  "bankcode": {
                    "$ref": "#/components/schemas/bankcode"
                  },
                  "ccnum": {
                    "type": "string",
                    "description": "Use 13-19 digit card number for credit/debit cards (15 digits for AMEX, 13-19 for Maestro) and validate with LUHN algorithm. Use only test cards as in the example or that is listed in Test Cards, UPI ID and Wallets section."
                  },
                  "ccvv": {
                    "type": "string",
                    "description": "Use 3-digit CVV number for credit/debit cards and 4-digit security code (4DBC/CID) for AMEX cards. Validate with BIN API.",
                    "example": "123"
                  },
                  "ccname": {
                    "type": "string",
                    "description": "Name on card as entered by the customer for the transaction."
                  },
                  "ccexpmon": {
                    "type": "string",
                    "description": "Card expiry month in MM format. For months 1-9, use 01, 02, … 09. For months 10-12, use 10, 11, or 12.",
                    "example": "10"
                  },
                  "ccexpyr": {
                    "type": "string",
                    "description": "Card expiry year in four digits. Use 2025 in this field for the test environment.",
                    "example": "2025"
                  },
                  "hash": {
                    "type": "string",
                    "description": "Hash calculated by the merchant. Format: sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)"
                  },
                  "phone": {
                    "type": "string",
                    "description": "The phone number of the customer.",
                    "example": "9876543210"
                  },
                  "lastname": {
                    "type": "string",
                    "description": "The last name of the customer."
                  },
                  "buyer_type_business": {
                    "type": "string",
                    "description": "Identifies a B2B transaction. Post 1 for B2B.",
                    "example": "1"
                  },
                  "curl": {
                    "type": "string",
                    "format": "uri",
                    "description": "The cancel URL, which is the page PayU will redirect to if the transaction is cancelled by the customer.",
                    "example": "https://apiplayground-response.herokuapp.com/"
                  },
                  "udf1": {
                    "type": "string",
                    "description": "This parameter is optional but recommended for a higher approval rate. Buyer PAN (Permanent Account Number) for Cross-Border flows. Character limit: 10 alphanumeric."
                  },
                  "udf2": {
                    "type": "string",
                    "description": "User-defined field for transaction metadata (udf2)."
                  },
                  "udf3": {
                    "type": "string",
                    "description": "This parameter is optional but recommended for a higher approval rate. Buyer date of birth (DOB) in DD-MM-YYYY format for Cross-Border flows."
                  },
                  "udf4": {
                    "type": "string",
                    "description": "Merchant name for PA2PA integrations. Do not pass for UPI mandate or recurring transactions."
                  },
                  "udf5": {
                    "type": "string",
                    "description": "Invoice ID for the merchant. Mandatory during or after the transaction (including via the udf_update API post successful transaction)."
                  },
                  "address1": {
                    "type": "string",
                    "description": "This parameter is optional but recommended for a higher approval rate. The customer's primary billing address line (up to 100 characters)."
                  },
                  "address2": {
                    "type": "string",
                    "description": "The customer's secondary billing address line. Optional."
                  },
                  "city": {
                    "type": "string",
                    "description": "This parameter is optional but recommended for a higher approval rate. The customer's billing city (maximum 50 characters)."
                  },
                  "state": {
                    "type": "string",
                    "description": "This parameter is optional but recommended for a higher approval rate. The customer's billing state or province (maximum 50 characters)."
                  },
                  "country": {
                    "type": "string",
                    "description": "This parameter is optional but recommended for a higher approval rate. The customer's billing country code. Use ISO 3166-1 alpha-2 country codes (maximum 50 characters)."
                  },
                  "zipcode": {
                    "type": "string",
                    "description": "The customer's billing postal/zip code. Mandatory for Cross-Border Cards; use a 6-digit India zipcode where applicable.",
                    "example": "560001"
                  },
                  "txn_s2s_flow": {
                    "type": "integer",
                    "description": "Enables the S2S flow. Mandatory for S2S; set to 4 for S2S4 flow.",
                    "example": 4
                  },
                  "s2s_client_ip": {
                    "type": "string",
                    "description": "Client IP captured by the merchant in the S2S flow. Mandatory for fraud detection.",
                    "example": "203.0.113.10"
                  },
                  "s2s_device_info": {
                    "type": "string",
                    "description": "User agent captured by the merchant in the S2S flow. Mandatory for the S2S flow.",
                    "example": "Mozilla/5.0"
                  },
                  "udf_params": {
                    "type": "string",
                    "description": "Optional JSON string for additional UDF values; documents UDF7 for Import or Export Code and UDF8 for Airway Bill / Consignment Number."
                  }
                }
              },
              "examples": {
                "crossBorderCardS2S": {
                  "summary": "Cross-Border Cards — CC + S2S4",
                  "value": {
                    "key": "JPM7Fg",
                    "txnid": "fd3e847h2",
                    "amount": "1000",
                    "productinfo": "iPhone",
                    "firstname": "Ashish",
                    "lastname": "Kumar",
                    "email": "test@example.com",
                    "phone": "9876543210",
                    "surl": "https://test-payment-middleware.payu.in/simulatorResponse",
                    "furl": "https://test-payment-middleware.payu.in/simulatorResponse",
                    "pg": "CC",
                    "bankcode": "CC",
                    "ccnum": "5123456789012346",
                    "ccname": "Test User",
                    "ccvv": "123",
                    "ccexpmon": "10",
                    "ccexpyr": "2025",
                    "zipcode": "560001",
                    "txn_s2s_flow": 4,
                    "s2s_client_ip": "203.0.113.10",
                    "s2s_device_info": "Mozilla/5.0",
                    "udf5": "INV-1001",
                    "hash": "REPLACE_WITH_SERVER_GENERATED_HASH"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "May return HTML or a query-string style body (for example, mihpayid=…&status=success&…) depending on integration. Verify hash on return using PayU post-response hash rules.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "successQueryString": {
                    "summary": "Example success postback (truncated)",
                    "value": "mihpayid=403993715531077182&mode=CC&status=success&unmappedstatus=captured&key=JPM7Fg&txnid=ypl938459435dfdfdf&amount=1000.00&cardCategory=domestic&error=E000&error_Message=No+Error&bankcode=CC"
                  }
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Redirect to issuer / ACS / bank or merchant surl / furl (typical browser flow)."
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {
      "bankcode": {
        "type": "string",
        "description": "Each payment option is identified with a unique bank code at PayU. For cards, post CC.",
        "example": "CC"
      }
    }
  },
  "tags": [
    {
      "name": "Cross-Border Cards",
      "description": "Merchant-hosted card payments for Cross-Border integrations using the S2S flow."
    }
  ]
}
```