---
agentTools:
  projectIndex: https://unpedash.readme.io/llms.txt
---

# Pay Bill

Pay bill amount

### Header

| Name         | Type   | Value                                      |
| :----------- | :----- | :----------------------------------------- |
| api-key      | string | (get it from api credentials in api panel) |
| content-type | string | application/json                           |
| accept       | string | application/json                           |

```php php
$header = [  
    'accept: application/json',  
    'api-key: XdWCmd0NF1ZVklnVPegOdL59WkFM7o4h91UYPAt1',  
    'content-type: application/json',  
];
```

### Request Body Parameters

| Name        | Type    | Value                                                                                                       |
| :---------- | :------ | :---------------------------------------------------------------------------------------------------------- |
| partner\_id | integer | (Get in from api panel you api parner id)                                                                   |
| operator    | String  | (Get it From Provider Data Api)                                                                             |
| type        | String  | PAY                                                                                                         |
| requestId   | String  | Get it from bill fetch api response                                                                         |
| apitxnid    | String  | Unique Reference id Of Merchant                                                                             |
| amount      | String  | Get it from bill fetch api response due amount                                                              |
| param0      | String  | Mandatory (Get parameter array from provider api for every provider for number of manadatory biller input ) |
| param1      | String  | Conditional (Follow No of parameter input of provider)                                                      |
| param2      | String  | Conditional (Follow No of parameter input of provider)                                                      |

```php
$parameter = [
    'partner_id' => '1'
  	'operator'   => "PAYT00000NATTQ",
  	'type'			 => "PAY",
  	'requestId'  => "ANTBBPS123456",
  	'apitxnid'   => "ANTBBPS123456",
  	'amount'		 => 200
  	'param0'     => 'UP00AA1234'
];

$body_json_string = json_encode($parameter);
```

### Request Body to be sent in Json

| Name | type   | Value                                               |
| :--- | :----- | :-------------------------------------------------- |
| body | String | Aes Encypted of Json Encoded Body Parameters String |

```php
$request_body = [
    "body" => "CE9BD8918E7971EFBA20CE7CF47582570B6B4932B6BF1D861071F02E92249698285B621186146CA93C8906DE3DB0D09216A579F7D89407E290BC5827ED770AE7305DAD79D50111144EC6EB6B793B5D4F83CB503CEA1279FF50F974F660E84851BCF53FA8FB132BEF412CC5084E6BC21B"
];

$final_body = json_encode($request_body);
```

### Response Body Parameters

| Name       | type   | Condition         | Possible Value                 |
| :--------- | :----- | :---------------- | :----------------------------- |
| statuscode | String | All Time          | TXN / TUP / TXF / ERR          |
| message    | String | All Time          | Transaction Response Message   |
| apitxnid   | String | In Case TXN / TXF | Merchant Unique Transaction Id |
| payid      | String | In Case TXN / TXF | Ebanker Transaction Id         |
| refno      | String | In Case TXN / TXF | Billpayment Reference          |
| number     | String | In Case TXN / TXF | Bill Number                    |
| provider   | String | In Case TXN / TXF | Bill Provider                  |
| amount     | String | In Case TXN / TXF | Bill Amount                    |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Bill Payment",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://unpay.in/tech/api/bbps/"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/pay": {
      "post": {
        "summary": "Pay Bill",
        "description": "Pay bill amount",
        "operationId": "pay-bill",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "bucykpifxahgnnhdhrbxfqbqqzuibaezasdasdadasdas"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "default": "CE9BD8918E7971EFBA20CE7CF47582570B6B4932B6BF1D861071F02E922496984B332B15B312A534055973149C8963036E54FE04892C35EE91D807FED687499BE69F0C8BD8817048B268C162A1BD408534C1FD689F5BD0F4C4567524F22DE436EF2F10DD00DC54F394295EDEBE7466F18027208193309BC2842BDEDA39AC0C3CAF6001154EF592079A3D4B3A785E240EA9B5B2944D519CC5B51CCB6063506460EBB3E948EB58813217F4BFB5F6B465038C033DC8C09E1F8827195D0B1C432895AC2B243FD2BEBE585E105C0A59A304581417917E9D0428925021A0D6E4EC391BBCD2325D07F6C2654B4A11148A7F7B67",
                    "format": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Successfully Fetch": {
                    "value": "{\n    \"statuscode\": \"TXN\",\n    \"message\": \"Transaction Successfull\",\n    \"apitxnid\": \"ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331\",\n    \"payid\": \"ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331\",\n    \"refno\": \"*******\",\n    \"date\": \"29 Nov - 13:56\",\n    \"number\": \"**********\",\n    \"provider\": \"Kotak Mahindra Bank - Fastag\",\n    \"amount\": 100\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statuscode": {
                      "type": "string",
                      "example": "TXN"
                    },
                    "message": {
                      "type": "string",
                      "example": "Transaction Successfull"
                    },
                    "apitxnid": {
                      "type": "string",
                      "example": "ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331"
                    },
                    "payid": {
                      "type": "string",
                      "example": "ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331"
                    },
                    "refno": {
                      "type": "string",
                      "example": "*******"
                    },
                    "date": {
                      "type": "string",
                      "example": "29 Nov - 13:56"
                    },
                    "number": {
                      "type": "string",
                      "example": "**********"
                    },
                    "provider": {
                      "type": "string",
                      "example": "Kotak Mahindra Bank - Fastag"
                    },
                    "amount": {
                      "type": "integer",
                      "example": 100,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Payment Failed": {
                    "value": "{\n    \"statuscode\": \"TXF\",\n    \"message\": \"Failed Reason\",\n    \"apitxnid\": \"ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331\",\n    \"payid\": \"ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331\",\n    \"refno\": \"failed\",\n    \"date\": \"29 Nov - 13:56\",\n    \"number\": \"*********\",\n    \"provider\": \"Kotak Mahindra Bank - Fastag\",\n    \"amount\": 100\n}"
                  },
                  "Bad Request Error": {
                    "value": "{\n    \"statuscode\": \"ERR\",\n    \"message\" : \"Bad request message\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Payment Failed",
                      "type": "object",
                      "properties": {
                        "statuscode": {
                          "type": "string",
                          "example": "TXF"
                        },
                        "message": {
                          "type": "string",
                          "example": "Failed Reason"
                        },
                        "apitxnid": {
                          "type": "string",
                          "example": "ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331"
                        },
                        "payid": {
                          "type": "string",
                          "example": "ANTBBPSAPIjxFjOH8T6fFQ4h2e023321331"
                        },
                        "refno": {
                          "type": "string",
                          "example": "failed"
                        },
                        "date": {
                          "type": "string",
                          "example": "29 Nov - 13:56"
                        },
                        "number": {
                          "type": "string",
                          "example": "*********"
                        },
                        "provider": {
                          "type": "string",
                          "example": "Kotak Mahindra Bank - Fastag"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 100,
                          "default": 0
                        }
                      }
                    },
                    {
                      "title": "Bad Request Error",
                      "type": "object",
                      "properties": {
                        "statuscode": {
                          "type": "string",
                          "example": "ERR"
                        },
                        "message": {
                          "type": "string",
                          "example": "Bad request message"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "652a3f9c7d4e97005a9ec0c7:652a3f9c7d4e97005a9ec0d2"
}
```