---
page_source: https://juspay.io/in/docs/ec-headless/android/payloads/cod-payments
page_title: COD Payments
---


# COD Transactions




### Step 1 Get Payment Methods


This operation retrieves information about all the available payment methods available for the merchant through Juspay. Consume CASH payment method detail from the response and display them on the Checkout page.




### Step 2 COD Txn


This operation helps the merchant to route the transaction via CASH gateway and transaction will directly marked as “COD_INITIATED”


## Request Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
    
    Example: abcd-12345-abcd-12345
  - Value: value
  - Tags: String, Mandatory
- **Service**:
  - Description: Value: in.juspay.hyperapi
  - Tags: String, Mandatory
- **Payload**:
  - Description: Parameters required to call Hyper SDK API
  - Value:
    - **Action**:
      - Description: Must be codTxn for COD Process calls.
      - Tags: String, Mandatory
    - **OrderId**:
      - Description: order id pertaining to the order for which the payment is started.
      - Tags: String, Mandatory
    - **PaymentMethod**:
      - Description: Must be CASH
      - Tags: String, Mandatory
    - **ClientAuthToken**:
      - Description: Required for client side authentication
      - Tags: String, Mandatory
  - Tags: JSON, Mandatory





## Sample Code Snippets:
### Sample Request:

#### Get Payment Methods Code Snippet:

```get payment methods
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "getPaymentMethods"
    }
}
```

#### COD Txn Code Snippet:

```cod txn
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "codTxn",
        "orderId": "hyperorder4514",
        "paymentMethod": "CASH",
        "clientAuthToken": "tkn_0e37edc631d67fdb606ab48ccfc4213",
        "paymentMethodType": "CASH"
    }
}
```

### Sample Response:

#### Get Payment Methods:
```json
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "paymentMethods": [
            {
                "paymentMethodType": "CARD",
                "paymentMethod": "VISA",
                "description": "Visa"
            },
            {
                "paymentMethodType": "CARD",
                "paymentMethod": "MASTER",
                "description": "Master Card"
            },
            {
                "paymentMethodType": "NB",
                "paymentMethod": "NB_HDFC",
                "description": "HDFC"
            },
            {
                "paymentMethodType": "WALLET",
                "paymentMethod": "PAYTM",
                "description": "Paytm"
            },
            {
                "paymentMethodType": "CASH",
                "paymentMethod": "CASH",
                "description": "Cash Payment"
            },
        ]
    },
    "error": false,
    "errorCode": "",
    "errorMessage": ""
}
```

#### COD Txn:
```plaintext
{
    "service": "in.juspay.hyperapi",
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "payload": {
        "action": "codTxn",
        "status": "COD_INITIATED",
        "orderId": "hyperorder4514"
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}
```

