🍲dfcv🏰dd⋉(● ∸ ●)⋊@% PNG %k25u25%fgd5n! PNG %k25u25%fgd5n!PK 6_]cz8+ 8+ razorpay/documents/customer.mdnu [ ## Customer
### Create customer
```php
$api->customer->create(array('name' => 'Razorpay User', 'email' => 'customer@razorpay.com','contact'=>'9123456780','notes'=> array('notes_key_1'=> 'Tea, Earl Grey, Hot','notes_key_2'=> 'Tea, Earl Grey… decaf')));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| name* | string | Name of the customer |
| email | string | Email of the customer |
| contact | string | Contact number of the customer |
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `0` or `1`|
| gstin | string | Customer's GST number, if available. For example, 29XAbbA4369J1PA |
| notes | array | A key-value pair |
**Response:**
```json
{
"id" : "cust_1Aa00000000004",
"entity": "customer",
"name" : "Gaurav Kumar",
"email" : "gaurav.kumar@example.com",
"contact" : "9123456780",
"gstin": "29XAbbA4369J1PA",
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at ": 1234567890
}
```
-------------------------------------------------------------------------------------------------------
### Edit customer
```php
$api->customer->fetch($customerId)->edit(array('name' => 'Razorpay User', 'email' => 'customer@razorpay.com', 'contact' => '9999999999'));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | The id of the customer to be updated |
| email | string | Email of the customer |
| contact | string | Contact number of the customer |
| notes | array | A key-value pair |
**Response:**
```json
{
"id": "cust_1Aa00000000003",
"entity": "customer",
"name": "Gaurav Kumar",
"email": "Gaurav.Kumar@example.com",
"contact": "9000000000",
"gstin": null,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"created_at": 1582033731
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all customer
```php
$api->customer->all($options);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| count | integer | number of payments to fetch (default: 10) |
| skip | integer | number of payments to be skipped (default: 0) |
**Response:**
```json
{
"entity":"collection",
"count":1,
"items":[
{
"id":"cust_1Aa00000000001",
"entity":"customer",
"name":"Gaurav Kumar",
"email":"gaurav.kumar@example.com",
"contact":"9876543210",
"gstin":"29XAbbA4369J1PA",
"notes":{
"note_key_1":"September",
"note_key_2":"Make it so."
},
"created_at ":1234567890
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a customer
```php
$api->customer->fetch($customerId);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | The id of the customer to be fetched |
**Response:**
```json
{
"id" : "cust_1Aa00000000001",
"entity": "customer",
"name" : "Saurav Kumar",
"email" : "Saurav.kumar@example.com",
"contact" : "+919000000000",
"gstin":"29XAbbA4369J1PA",
"notes" : [],
"created_at ": 1234567890
}
```
-------------------------------------------------------------------------------------------------------
### Add Bank Account of Customer
```php
$customerId = "cust_N5mywh91sXB69O"
$api->customer->fetch($customerId)->addBankAccount([
"ifsc_code" => "UTIB0000194",
"account_number" => "919999999999",
"beneficiary_name" => "Pratheek",
"beneficiary_address1" => "address 1",
"beneficiary_address2" => "address 2",
"beneficiary_address3" => "address 3",
"beneficiary_address4" => "address 4",
"beneficiary_email" => "random@email.com",
"beneficiary_mobile" => "8762489310",
"beneficiary_city" => "Bangalore",
"beneficiary_state" => "KA",
"beneficiary_country" => "IN",
]);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | Customer's bank account number |
| account_number | integer | The id of the customer to be fetched |
| account_number | string | The name of the beneficiary associated with the bank account. |
| beneficiary_name | string | The virtual payment address. |
| beneficiary_address1 | string | The id of the customer to be fetched |
| beneficiary_email | string | Email address of the beneficiary. |
| beneficiary_mobile | integer | Mobile number of the beneficiary. |
| beneficiary_city | string | The name of the city of the beneficiary. |
| beneficiary_state | string | The state of the beneficiary. |
| beneficiary_pin | interger | The pin code of the beneficiary's address. |
| ifsc_code | string | The IFSC code of the bank branch associated with the account. |
**Response:**
```json
{
"id" : "cust_1Aa00000000001",
"entity": "customer",
"name" : "Saurav Kumar",
"email" : "Saurav.kumar@example.com",
"contact" : "+919000000000",
"gstin":"29XAbbA4369J1PA",
"notes" : [],
"created_at ": 1234567890
}
```
-------------------------------------------------------------------------------------------------------
### Delete Bank Account of Customer
```php
$customerId = "cust_N5mywh91sXB69O"
$bankAccountId = "ba_N6aM8uo64IzxHu"
$api->customer->fetch($customerId)->deleteBankAccount($bankAccountId);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | Customer's bank account number |
| bank_id | string | The bank_id that needs to be deleted. |
**Response:**
```json
{
"id": "ba_Evg09Ll05SIPSD",
"ifsc": "ICIC0001207",
"bank_name": "ICICI Bank",
"name": "Test R4zorpay",
"account_number": "XXXXXXXXXXXXXXX0434",
"status": "deleted"
}
```
-------------------------------------------------------------------------------------------------------
### Eligibility Check API
```php
$api->customer->requestEligibilityCheck(array(
"inquiry" => "affordability",
"amount" => 500000,
"currency" => "INR",
"customer" => array(
"id" => "cust_MVSyUEwC4qb5sN",
"contact" => "+918220276214",
"ip" => "105.106.107.108",
"referrer" => "https://merchansite.com/example/paybill",
"user_agent" => "Mozilla/5.0",
)
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | Customer's bank account number |
| bank_id | string | The bank_id that needs to be deleted. |
**Response:**
```json
{
"amount": "500000",
"customer": {
"id": "KkBhM9EC1Y0HTm",
"contact": "+918220722114"
},
"instruments": [
{
"method": "emi",
"issuer": "HDFC",
"type": "debit",
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
"eligibility": {
"status": "eligible"
}
},
{
"method": "paylater",
"provider": "getsimpl",
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
"eligibility": {
"status": "eligible"
}
},
{
"method": "paylater",
"provider": "icic",
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
"eligibility": {
"status": "eligible"
}
},
{
"method": "cardless_emi",
"provider": "walnut369",
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
"eligibility": {
"status": "ineligible",
"error": {
"code": "GATEWAY_ERROR",
"description": "The customer has not been approved by the partner.",
"source": "business",
"step": "inquiry",
"reason": "user_not_approved"
}
}
},
{
"method": "cardless_emi",
"provider": "zestmoney",
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
"eligibility": {
"status": "ineligible",
"error": {
"code": "GATEWAY_ERROR",
"description": "The customer has exhausted their credit limit.",
"source": "business",
"step": "inquiry",
"reason": "credit_limit_exhausted"
}
}
},
{
"method": "paylater",
"provider": "lazypay",
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
"eligibility": {
"status": "ineligible",
"error": {
"code": "GATEWAY_ERROR",
"description": "The order amount is less than the minimum transaction amount.",
"source": "business",
"step": "inquiry",
"reason": "min_amt_required"
}
}
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch Eligibility by id
```php
$api->customer->fetchEligibility("elig_F1cxDoHWD4fkQt");
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | Customer's bank account number |
| bank_id | string | The bank_id that needs to be deleted. |
**Response:**
```json
{
"instruments": [
{
"method": "paylater",
"provider": "lazypay",
"eligibility_req_id": "elig_LBwGKVvS2X48Lq",
"eligibility": {
"status": "eligible"
}
},
{
"method": "paylater",
"provider": "getsimpl",
"eligibility_req_id": "elig_LBwGKVvS2X48Lq",
"eligibility": {
"status": "ineligible",
"error": {
"code": "GATEWAY_ERROR",
"description": "The customer has exhausted their credit limit",
"source": "gateway",
"step": "inquiry",
"reason": "credit_limit_exhausted"
}
}
}
]
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/customers/)**
PK 6_]?J J * razorpay/documents/productConfiguration.mdnu [ ## Product Configuration
### Request a Product Configuration
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$api->account->fetch($accountId)->products()->requestProductConfiguration(array(
"product_name" => "payment_gateway",
"tnc_accepted" => true,
"ip" => "233.233.233.234"
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| product_name* | string | The product(s) to be configured. Possible value is `payment_gateway`, `payment_links` |
| tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible values is `true` |
| ip | integer | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the `tnc_accepted` parameter when the `tnc` is accepted. |
**Response:**
```json
{
"requested_configuration": {
"payment_methods": []
},
"active_configuration": {
"payment_capture": {
"mode": "automatic",
"refund_speed": "normal",
"automatic_expiry_period": 7200
},
"settlements": {
"account_number": null,
"ifsc_code": null,
"beneficiary_name": null
},
"checkout": {
"theme_color": "#FFFFFF",
"flash_checkout": true,
"logo": "https://example.com/your_logo"
},
"refund": {
"default_refund_speed": "normal"
},
"notifications": {
"whatsapp": true,
"sms": false,
"email": [
"b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
]
},
"payment_methods": {
"netbanking": {
"enabled": true,
"instrument": [
{
"type": "retail",
"bank": [
"hdfc",
"sbin",
"utib",
"icic",
"scbl",
"yesb"
]
}
]
},
"wallet": {
"enabled": true,
"instrument": [
"airtelmoney",
"freecharge",
"jiomoney",
"olamoney",
"payzapp",
"mobikwik"
]
},
"upi": {
"enabled": true,
"instrument": [
"upi"
]
}
}
},
"requirements": [
{
"field_reference": "individual_proof_of_address",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "individual_proof_of_identification",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "business_proof_of_identification",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "settlements.beneficiary_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "settlements.account_number",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "settlements.ifsc_code",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "contact_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "customer_facing_business_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "kyc.pan",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
"status": "required",
"reason_code": "field_missing"
}
],
"tnc":{
"id": "tnc_IgohZaDBHRGjPv",
"accepted": true,
"accepted_at": 1641550798
},
"id": "acc_prd_HEgNpywUFctQ9e",
"account_id": "acc_HQVlm3bnPmccC0",
"product_name": "payment_gateway",
"activation_status": "needs_clarification",
"requested_at": 162547884
}
```
-------------------------------------------------------------------------------------------------------
### Edit a Product Configuration
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$productId = "acc_prd_HEgNpywUFctQ9e";
$api->account->fetch($accountId)->products()->edit($productId, array(
"notifications" => array(
"email" => array(
"gaurav.kumar@example.com",
"acd@gmail.com"
)
),
"checkout" => array(
"theme_color" => "#528FFF"
),
"refund" => array(
"default_refund_speed" => "optimum"
),
"settlements" => array(
"account_number" => "1234567890",
"ifsc_code" => "HDFC0000317",
"beneficiary_name" => "Gaurav Kumar"
),
"tnc_accepted" => true,
"ip" => "233.233.233.234"
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| notifications | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| checkout | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| refund | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| settlements | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible value is `true` |
| ip | string | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the tnc_accepted parameter when the `tnc` is accepted. |
| payment_methods | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| type | string | Possible value is `domestic` |
| issuer | string | The card issuer. Possible values for issuer are `amex`, `dicl`, `maestro`, `mastercard`, `rupay`, `visa`. |
| wallet | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
| instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
| upi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| instrument(upi) | string | The UPI service provider. Possible values are `google_pay`, `upi`|
| paylater | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
| instrument(emi) | string | The Paylater service provider. Possible values are `epaylater`, `getsimpl`|
| emi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
**Response:**
```json
{
"id": "acc_GP4lfNA0iIMn5B",
"type": "standard",
"status": "created",
"email": "gauri@example.org",
"profile": {
"category": "healthcare",
"subcategory": "clinic",
"addresses": {
"registered": {
"street1": "507, Koramangala 1st block",
"street2": "MG Road-1",
"city": "Bengalore",
"state": "KARNATAKA",
"postal_code": "560034",
"country": "IN"
}
}
},
"notes": [],
"created_at": 1610603081,
"phone": "9000090000",
"reference_id": "randomId",
"business_type": "partnership",
"legal_business_name": "Acme Corp",
"customer_facing_business_name": "ABCD Ltd"
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a product configuration
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$productId = "acc_prd_HEgNpywUFctQ9e";
$api->account->fetch($accountId)->products()->fetch($productId);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| productId* | string | The unique identifier of a product generated by Razorpay. |
**Response:**
```json
{
"requested_configuration": {
"payment_methods": []
},
"active_configuration": {
"payment_capture": {
"mode": "automatic",
"refund_speed": "normal",
"automatic_expiry_period": 7200
},
"settlements": {
"account_number": null,
"ifsc_code": null,
"beneficiary_name": null
},
"checkout": {
"theme_color": "#FFFFFF",
"flash_checkout": true
},
"refund": {
"default_refund_speed": "normal"
},
"notifications": {
"whatsapp": true,
"sms": false,
"email": [
"b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
]
},
"payment_methods": {
"netbanking": {
"enabled": true,
"instrument": [
{
"type": "retail",
"bank": [
"hdfc",
"sbin",
"utib",
"icic",
"scbl",
"yesb"
]
}
]
},
"wallet": {
"enabled": true,
"instrument": [
"airtelmoney",
"freecharge",
"jiomoney",
"olamoney",
"payzapp",
"mobikwik"
]
},
"upi": {
"enabled": true,
"instrument": [
"upi"
]
}
}
},
"requirements": [
{
"field_reference": "individual_proof_of_address",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "individual_proof_of_identification",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "business_proof_of_identification",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "settlements.beneficiary_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "settlements.account_number",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "settlements.ifsc_code",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "contact_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "customer_facing_business_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "kyc.pan",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
"status": "required",
"reason_code": "field_missing"
}
],
"tnc":{
"id": "tnc_IgohZaDBHRGjPv",
"accepted": true,
"accepted_at": 1641550798
},
"id": "acc_prd_HEgNpywUFctQ9e",
"account_id": "acc_HQVlm3bnPmccC0",
"product_name": "payment_gateway",
"activation_status": "needs_clarification",
"requested_at": 1625478849
}
```
-------------------------------------------------------------------------------------------------------
### Fetch Terms and Conditions for a Sub-Merchant
```php
$productName = "payments";
$api->product->fetchTnc($productName);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| productName* | string | The product family for which the relevant product to be requested for the sub-merchant. Possible value is `payments` |
**Response:**
```json
{
"entity": "tnc_map",
"product_name": "payments",
"id": "tnc_map_HjOVhIdpVDZ0FB",
"tnc": {
"terms": "https://razorpay.com/terms",
"privacy": "https://razorpay.com/privacy",
"agreement": "https://razorpay.com/agreement"
},
"last_published_at": 1640589653
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a product configuration
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$productId = "acc_prd_HEgNpywUFctQ9e";
$api->account->fetch($accountId)->products()->fetch($productId);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| productId* | string | The unique identifier of a product generated by Razorpay. |
**Response:**
```json
{
"requested_configuration": {
"payment_methods": []
},
"active_configuration": {
"payment_capture": {
"mode": "automatic",
"refund_speed": "normal",
"automatic_expiry_period": 7200
},
"settlements": {
"account_number": null,
"ifsc_code": null,
"beneficiary_name": null
},
"checkout": {
"theme_color": "#FFFFFF",
"flash_checkout": true
},
"refund": {
"default_refund_speed": "normal"
},
"notifications": {
"whatsapp": true,
"sms": false,
"email": [
"b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
]
},
"payment_methods": {
"netbanking": {
"enabled": true,
"instrument": [
{
"type": "retail",
"bank": [
"hdfc",
"sbin",
"utib",
"icic",
"scbl",
"yesb"
]
}
]
},
"wallet": {
"enabled": true,
"instrument": [
"airtelmoney",
"freecharge",
"jiomoney",
"olamoney",
"payzapp",
"mobikwik"
]
},
"upi": {
"enabled": true,
"instrument": [
"upi"
]
}
}
},
"requirements": [
{
"field_reference": "individual_proof_of_address",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "individual_proof_of_identification",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "business_proof_of_identification",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
"status": "required",
"reason_code": "document_missing"
},
{
"field_reference": "settlements.beneficiary_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "settlements.account_number",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "settlements.ifsc_code",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "contact_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "customer_facing_business_name",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
"status": "required",
"reason_code": "field_missing"
},
{
"field_reference": "kyc.pan",
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
"status": "required",
"reason_code": "field_missing"
}
],
"tnc":{
"id": "tnc_IgohZaDBHRGjPv",
"accepted": true,
"accepted_at": 1641550798
},
"id": "acc_prd_HEgNpywUFctQ9e",
"account_id": "acc_HQVlm3bnPmccC0",
"product_name": "payment_gateway",
"activation_status": "needs_clarification",
"requested_at": 1625478849
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/partners/product-configuration/)**PK 6_]|<[7 7 razorpay/documents/qrcode.mdnu [ ## Qr Codes
### Create Qr code
```php
$api->qrCode->create(array("type" => "upi_qr","name" => "Store_1", "usage" => "single_use","fixed_amount" => 1,"payment_amount" => 300,"customer_id" => "cust_HKsR5se84c5LTO","description" => "For Store 1","close_by" => 1681615838,"notes" => array("purpose" => "Test UPI QR code notes")));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| type* | string | The type of QR code i.e, `upi_qr`/`bharat_qr` |
| name | string | Label entered to identify the QR code. |
| usage* | string | Indicates if the QR code should be allowed to accept single payment or multiple payments i.e, `single_use`/`multiple_use` |
| fixed_amount | boolean | Indicates if the QR should accept payments of specific amounts or any amount. |
| payment_amount(* mandatory if fixed_amount is true) | integer | Indicates if the QR should accept payments of specific amounts or any amount. |
| customer_id | string | Unique identifier of the customer the QR code is linked with |
| description | string | A brief description about the QR code. |
| close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
**Response:**
```json
{
"id": "qr_HMsVL8HOpbMcjU",
"entity": "qr_code",
"created_at": 1623660301,
"name": "Store_1",
"usage": "single_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/BWcUVrLp",
"payment_amount": 300,
"status": "active",
"description": "For Store 1",
"fixed_amount": true,
"payments_amount_received": 0,
"payments_count_received": 0,
"notes": {
"purpose": "Test UPI QR code notes"
},
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1681615838,
"closed_at": 1623660445,
"close_reason": "on_demand"
}
```
-------------------------------------------------------------------------------------------------------
### Create Qr code with GST
```php
$api->qrCode->create(array("type" => "upi_qr","name" => "Store_1", "usage" => "single_use","fixed_amount" => 1,"payment_amount" => 300,"customer_id" => "cust_HKsR5se84c5LTO","description" => "For Store 1","close_by" => 1681615838,"notes" => array("purpose" => "Test UPI QR code notes"),"tax_invoice" => array("number" => "INV001", "date" => 1589994898,"customer_name" => "Gaurav Kumar", "business_gstin"=> "06AABCU9605R1ZR","gst_amount" => 4000, "cess_amount" => 0, "supply_type" => "interstate")));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| type* | string | The type of QR code i.e, `upi_qr`/`bharat_qr` |
| name | string | Label entered to identify the QR code. |
| usage* | string | Indicates if the QR code should be allowed to accept single payment or multiple payments i.e, `single_use`/`multiple_use` |
| fixed_amount | boolean | Indicates if the QR should accept payments of specific amounts or any amount. |
| payment_amount(* mandatory if fixed_amount is true) | integer | Indicates if the QR should accept payments of specific amounts or any amount. |
| customer_id | string | Unique identifier of the customer the QR code is linked with |
| description | string | A brief description about the QR code. |
| close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
| tax_invoice | array | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. |
**Response:**
```json
{
"id": "qr_HMsVL8HOpbMcjU",
"entity": "qr_code",
"created_at": 1623660301,
"name": "Store_1",
"usage": "single_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/BWcUVrLp",
"payment_amount": 300,
"status": "active",
"description": "For Store 1",
"fixed_amount": true,
"payments_amount_received": 0,
"payments_count_received": 0,
"notes": {
"purpose": "Test UPI QR code notes"
},
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1681615838,
"tax_invoice": {
"number": "INV001",
"date": 1589994898,
"customer_name": "Gaurav Kumar",
"business_gstin": "06AABCU9605R1ZR",
"gst_amount": 4000,
"cess_amount": 0,
"supply_type": "interstate"
}
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all Qr code
```php
$api->qrCode->all($options);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| from | timestamp | timestamp after which the payments were created |
| to | timestamp | timestamp before which the payments were created |
| count | integer | number of payments to fetch (default: 10) |
| skip | integer | number of payments to be skipped (default: 0) |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "qr_HO2jGkWReVBMNu",
"entity": "qr_code",
"created_at": 1623914648,
"name": "Store_1",
"usage": "single_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/w2CEwYmkAu",
"payment_amount": 300,
"status": "active",
"description": "For Store 1",
"fixed_amount": true,
"payments_amount_received": 0,
"payments_count_received": 0,
"notes": {
"purpose": "Test UPI QR code notes"
},
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1681615838,
"closed_at": null,
"close_reason": null
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a Qr code
```php
$api->qrCode->fetch($qrCodeId);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| qrCodeId | string | The id of the qr code to be fetched |
**Response:**
```json
{
"id": "qr_HO2r1MDprYtWRT",
"entity": "qr_code",
"created_at": 1623915088,
"name": "Store_1",
"usage": "single_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/oCswTOcCo",
"payment_amount": 300,
"status": "active",
"description": "For Store 1",
"fixed_amount": true,
"payments_amount_received": 0,
"payments_count_received": 0,
"notes": {
"purpose": "Test UPI QR code notes"
},
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1681615838,
"closed_at": null,
"close_reason": null
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a Qr code for customer id
```php
$api->qrCode->all(["customer_id" => $customerId]);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customerId* | string | The id of the customer to which qr code need to be fetched |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "qr_HMsgvioW64f0vh",
"entity": "qr_code",
"created_at": 1623660959,
"name": "Store_1",
"usage": "single_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/DTa2eQR",
"payment_amount": 300,
"status": "active",
"description": "For Store 1",
"fixed_amount": true,
"payments_amount_received": 0,
"payments_count_received": 0,
"notes": {
"purpose": "Test UPI QR code notes"
},
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1681615838
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a Qr code for payment id
```php
$api->qrCode->all(["payment_id" => $paymentId]);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| paymentID* | string | The id of the payment to which qr code need to be fetched |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "qr_HMsqRoeVwKbwAF",
"entity": "qr_code",
"created_at": 1623661499,
"name": "Fresh Groceries",
"usage": "multiple_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/eI9XD54Q",
"payment_amount": null,
"status": "active",
"description": "Buy fresh groceries",
"fixed_amount": false,
"payments_amount_received": 1000,
"payments_count_received": 1,
"notes": [],
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1624472999,
"close_reason": null
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch Payments for a QR Code
```php
$api->qrCode->fetch($qrCodeId)->fetchAllPayments($options);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| qrCodeID* | string | The id of the qr code to which payment where made |
| from | timestamp | timestamp after which the payments were created |
| to | timestamp | timestamp before which the payments were created |
| count | integer | number of payments to fetch (default: 10) |
| skip | integer | number of payments to be skipped (default: 0) |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "pay_HMtDKn3TnF4D8x",
"entity": "payment",
"amount": 500,
"currency": "INR",
"status": "captured",
"order_id": null,
"invoice_id": null,
"international": false,
"method": "upi",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": "QRv2 Payment",
"card_id": null,
"bank": null,
"wallet": null,
"vpa": "gauri.kumari@okhdfcbank",
"email": "gauri.kumari@example.com",
"contact": "+919999999999",
"customer_id": "cust_HKsR5se84c5LTO",
"notes": [],
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {
"rrn": "116514257019"
},
"created_at": 1623662800
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Close a QR Code
```php
$api->qrCode->fetch($qrCodeId)->close()
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| qrCodeID* | string | The id of the qr code to be closed |
**Response:**
```json
{
"id": "qr_HMsVL8HOpbMcjU",
"entity": "qr_code",
"created_at": 1623660301,
"name": "Store_1",
"usage": "single_use",
"type": "upi_qr",
"image_url": "https://rzp.io/i/BWcUVrLp",
"payment_amount": 300,
"status": "closed",
"description": "For Store 1",
"fixed_amount": true,
"payments_amount_received": 0,
"payments_count_received": 0,
"notes": {
"purpose": "Test UPI QR code notes"
},
"customer_id": "cust_HKsR5se84c5LTO",
"close_by": 1681615838,
"closed_at": 1623660445,
"close_reason": "on_demand"
}
```
-------------------------------------------------------------------------------------------------------
### Refund a Payment
```php
$api->payment->fetch($paymentId)->refund(array("amount"=> "100","notes"=>array("notes_key_1"=>"Beam me up Scotty.", "notes_key_2"=>"Engage")));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| paymentId* | string | The id of the payment to be refunded |
| amount | string | Amount to be refunded |
| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
**Response:**
```json
{
"id": "rfnd_FP8QHiV938haTz",
"entity": "refund",
"amount": 500100,
"receipt": "Receipt No. 31",
"currency": "INR",
"payment_id": "pay_29QQoUBi66xm2f",
"notes": [],
"receipt": null,
"acquirer_data": {
"arn": null
},
"created_at": 1597078866,
"batch_id": null,
"status": "processed",
"speed_processed": "normal",
"speed_requested": "normal"
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/qr-codes/)**
PK 6_]b* * ( razorpay/documents/paymentVerfication.mdnu [ ## payment verification
### Verify payment verification
```php
$api->utility->verifyPaymentSignature(array('razorpay_order_id' => $razorpayOrderId, 'razorpay_payment_id' => $razorpayPaymentId, 'razorpay_signature' => $razorpaySignature));
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| orderId* | string | The id of the order to be fetched |
| paymentId* | string | The id of the payment to be fetched |
| signature* | string | Signature returned by the Checkout. This is used to verify the payment. |
-------------------------------------------------------------------------------------------------------
### Verify subscription verification
```php
$api->utility->verifyPaymentSignature(array('razorpay_subscription_id' => $razorpaySubscriptionId, 'razorpay_payment_id' => $razorpayPaymentId, 'razorpay_signature' => $razorpaySignature));
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be fetched |
| paymentId* | string | The id of the payment to be fetched |
| signature* | string | Signature returned by the Checkout. This is used to verify the payment. |
-------------------------------------------------------------------------------------------------------
### Verify paymentlink verification
```php
$api->utility->verifyPaymentSignature(array('razorpay_payment_link_id' => $razorpayPaymentlinkId, 'razorpay_payment_id' => $razorpayPaymentId, 'razorpay_payment_link_reference_id' => $razorpayPaymentLinkReferenceId, 'razorpay_payment_link_status' => $razorpayPaymentLinkStatus, 'razorpay_signature' => $razorpayPaymentLinkSignature));
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| razorpayPaymentlinkId* | string | The id of the paymentlink to be fetched |
| razorpayPaymentId* | string | The id of the payment to be fetched |
| razorpayPaymentLinkReferenceId* | string | A reference number tagged to a Payment Link |
| razorpayPaymentLinkStatus* | string | Current status of the link |
| razorpayPaymentLinkSignature* | string | Signature returned by the Checkout. This is used to verify the payment. |
-------------------------------------------------------------------------------------------------------
### Verify webhook signature
```php
$webhookBody = '{"entity":"event","account_id":"acc_Hn1ukn2d32Fqww","event":"payment.authorized","contains":["payment"],"payload":{"payment":{"entity":{"id":"pay_JTVtDcN1uRYb5n","entity":"payment","amount":22345,"currency":"INR","status":"authorized","order_id":"order_JTVsulofMPyzBY","invoice_id":null,"international":false,"method":"card","amount_refunded":0,"refund_status":null,"captured":false,"description":"#JT8o1jsTyzrywc","card_id":"card_JTVtDjPwZbFbTM","card":{"id":"card_JTVtDjPwZbFbTM","entity":"card","name":"gaurav","last4":"4366","network":"Visa","type":"credit","issuer":"UTIB","international":false,"emi":true,"sub_type":"consumer","token_iin":null},"bank":null,"wallet":null,"vpa":null,"email":"you@example.com","contact":"+919999999999","notes":{"policy_name":"Jeevan Saral"},"fee":null,"tax":null,"error_code":null,"error_description":null,"error_source":null,"error_step":null,"error_reason":null,"acquirer_data":{"auth_code":"472379"},"created_at":1652183214}}},"created_at":1652183218}';
$webhookSignature = "27209ba357bf7b7b461a4c1d7f54d5a8bb6b0b4b2f5fa4aebf1f1c861a05d18a";
$webhookSecret = "test";
$api->utility->verifyWebhookSignature($webhookBody, $webhookSignature, $webhookSecret);
```
**PN: * indicates mandatory fields**
PK 6_]CTCV CV razorpay/documents/papernach.mdnu [ ## Paper NACH
### Create customer
```php
$api->customer->create(array('name' => 'Razorpay User', 'email' => 'customer@razorpay.com','contact'=>'9123456780', 'fail_existing'=> '0', 'notes'=> array('notes_key_1'=> 'Tea, Earl Grey, Hot','notes_key_2'=> 'Tea, Earl Grey… decaf')));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| name* | string | Name of the customer |
| email | string | Email of the customer |
| contact | string | Contact number of the customer |
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `0` or `1`|
| notes | array | A key-value pair |
**Response:**
```json
{
"id": "cust_1Aa00000000003",
"entity": "customer",
"name": "Gaurav Kumar",
"email": "Gaurav.Kumar@example.com",
"contact": "9000000000",
"gstin": null,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"created_at": 1582033731
}
```
-------------------------------------------------------------------------------------------------------
### Create order
```php
$api->order->create(array('amount' => 0,'currency' => 'INR','method' => 'nach','customer_id' => 'cust_1Aa00000000001','receipt' => 'Receipt No. 1', 'notes' => array('notes_key_1' => 'Beam me up Scotty','notes_key_2' => 'Engage'),'token' => array('auth_type' => 'physical','max_amount' => 10000000,'expire_at' => 2709971120,'notes' => array('notes_key_1' => 'Tea, Earl Grey, Hot','notes_key_2' => 'Tea, Earl Grey… decaf.'),'bank_account' => array('account_number' => '11214311215411','ifsc_code' => 'HDFC0000001','beneficiary_name' => 'Gaurav Kumar','account_type' => 'savings'),'nach' => array('form_reference1' => 'Recurring Payment for Gaurav Kumar','form_reference2' => 'Method Paper NACH','description' => 'Paper NACH Gaurav Kumar'))));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
| currency* | string | The currency of the payment (defaults to INR) |
| customerId* | string | The id of the customer to be fetched |
| method* | string | Payment method used to make the registration transaction. Possible value is `nach`. |
| receipt | string | Your system order reference id. |
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#112-create-an-order) are supported |
| notes | object | A key-value pair |
**Response:**
```json
{
"id":"order_1Aa00000000001",
"entity":"order",
"amount":0,
"amount_paid":0,
"amount_due":0,
"currency":"INR",
"receipt":"rcptid #10",
"offer_id":null,
"offers":{
"entity":"collection",
"count":0,
"items":[
]
},
"status":"created",
"attempts":0,
"notes":{
"notes_key_1":"Beam me up Scotty",
"notes_key_2":"Engage"
},
"created_at":1579775420,
"token":{
"method":"nach",
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"recurring_status":null,
"failure_reason":null,
"currency":"INR",
"max_amount":10000000,
"auth_type":"physical",
"expire_at":1580480689,
"nach":{
"create_form":true,
"form_reference1":"Recurring Payment for Gaurav Kumar",
"form_reference2":"Method Paper NACH",
"prefilled_form":"https://rzp.io/i/bitw",
"upload_form_url":"https://rzp.io/i/gts",
"description":"Paper NACH Gaurav Kumar"
},
"bank_account":{
"ifsc":"HDFC0000001",
"bank_name":"HDFC Bank",
"name":"Gaurav Kumar",
"account_number":"11214311215411",
"account_type":"savings",
"beneficiary_email":"gaurav.kumar@example.com",
"beneficiary_mobile":"9876543210"
},
"first_payment_amount":0
}
}
```
-------------------------------------------------------------------------------------------------------
### Create an Authorization Payment
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/paper-nach/authorization-transaction/#113-create-an-authorization-payment) for authorization payment
-------------------------------------------------------------------------------------------------------
### Create registration link
```php
$api->subscription->createSubscriptionRegistration(array('customer' => array('name' => 'Gaurav Kumar','email' => 'gaurav.kumar@example.com','contact' => '9123456780'),'amount' => 0,'currency' => 'INR','type' => 'link','description' => '12 p.m. Meals','subscription_registration' => array('method' => 'nach','auth_type' => 'physical','bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '11214311215411','account_type' => 'savings','ifsc_code' => 'HDFC0001233'),'nach' => array('form_reference1' => 'Recurring Payment for Gaurav Kumar','form_reference2' => 'Method Paper NACH'),'expire_at' => 1947483647,'max_amount' => 50000),'receipt' => 'Receipt No. 1','sms_notify' => 1,'email_notify' => 1,'expire_by' => 1647483647,'notes' => array('note_key 1' => 'Beam me up Scotty','note_key 2' => 'Tea. Earl Gray. Hot.')));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customer | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#121-create-a-registration-link) |
| type* | string | In this case, the value is `link`. |
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
| amount* | integer | The payment amount in the smallest currency sub-unit. |
| description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#121-create-a-registration-link) |
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : 1) |
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : 1) |
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
| receipt | string | Your system order reference id. |
| notes | array | A key-value pair |
**Response:**
```json
{
"id": "inv_FHrZiAubEzDdaq",
"entity": "invoice",
"receipt": "Receipt No. 27",
"invoice_number": "Receipt No. 27",
"customer_id": "cust_BMB3EwbqnqZ2EI",
"customer_details": {
"id": "cust_BMB3EwbqnqZ2EI",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9123456780",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9123456780"
},
"order_id": "order_FHrZiBOkWHZPOp",
"line_items": [],
"payment_id": null,
"status": "issued",
"expire_by": 1647483647,
"issued_at": 1595491154,
"paid_at": null,
"cancelled_at": null,
"expired_at": null,
"sms_status": "sent",
"email_status": "sent",
"date": 1595491154,
"terms": null,
"partial_payment": false,
"gross_amount": 0,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"currency": "INR",
"currency_symbol": "₹",
"description": "12 p.m. Meals",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"comment": null,
"short_url": "https://rzp.io/i/bzDYbNg",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"created_at": 1595491154,
"idempotency_key": null,
"token": {
"method": "nach",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 50000,
"auth_type": "physical",
"expire_at": 1947483647,
"nach": {
"create_form": true,
"form_reference1": "Recurring Payment for Gaurav Kumar",
"form_reference2": "Method Paper NACH",
"prefilled_form": "https://rzp.io/i/exdIzYN",
"upload_form_url": "https://rzp.io/i/bzDYbNg",
"description": "12 p.m. Meals"
},
"bank_account": {
"ifsc": "HDFC0001233",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "11214311215411",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9123456780"
},
"first_payment_amount": 0
},
"nach_form_url": "https://rzp.io/i/exdIzYN"
}
```
-------------------------------------------------------------------------------------------------------
### Send/Resend notifications
```php
$api->invoice->fetch($invoiceId)->notifyBy($medium);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| invoiceId* | string | The id of the invoice to be notified |
| medium* | string | `sms`/`email`, Medium through which notification should be sent. |
**Response:**
```json
{
"success": true
}
```
-------------------------------------------------------------------------------------------------------
### Cancel a registration link
```php
$api->invoice->fetch($invoiceId)->cancel();
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| invoiceId* | string | The id of the invoice to be cancelled |
**Response:**
```json
{
"id": "inv_FHrZiAubEzDdaq",
"entity": "invoice",
"receipt": "Receipt No. 27",
"invoice_number": "Receipt No. 27",
"customer_id": "cust_BMB3EwbqnqZ2EI",
"customer_details": {
"id": "cust_BMB3EwbqnqZ2EI",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9123456780",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": "Gaurav Kumar",
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "9123456780"
},
"order_id": "order_FHrZiBOkWHZPOp",
"line_items": [],
"payment_id": null,
"status": "cancelled",
"expire_by": 1647483647,
"issued_at": 1595491154,
"paid_at": null,
"cancelled_at": 1595491339,
"expired_at": null,
"sms_status": "sent",
"email_status": "sent",
"date": 1595491154,
"terms": null,
"partial_payment": false,
"gross_amount": 0,
"tax_amount": 0,
"taxable_amount": 0,
"amount": 0,
"amount_paid": 0,
"amount_due": 0,
"currency": "INR",
"currency_symbol": "₹",
"description": "12 p.m. Meals",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"comment": null,
"short_url": "https://rzp.io/i/bzDYbNg",
"view_less": true,
"billing_start": null,
"billing_end": null,
"type": "link",
"group_taxes_discounts": false,
"created_at": 1595491154,
"idempotency_key": null,
"token": {
"method": "nach",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"recurring_status": null,
"failure_reason": null,
"currency": "INR",
"max_amount": 50000,
"auth_type": "physical",
"expire_at": 1947483647,
"nach": {
"create_form": true,
"form_reference1": "Recurring Payment for Gaurav Kumar",
"form_reference2": "Method Paper NACH",
"prefilled_form": "https://rzp.io/i/tSYd5aV",
"upload_form_url": "https://rzp.io/i/bzDYbNg",
"description": "12 p.m. Meals"
},
"bank_account": {
"ifsc": "HDFC0001233",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"account_number": "11214311215411",
"account_type": "savings",
"beneficiary_email": "gaurav.kumar@example.com",
"beneficiary_mobile": "9123456780"
},
"first_payment_amount": 0
},
"nach_form_url": "https://rzp.io/i/tSYd5aV"
}
```
-------------------------------------------------------------------------------------------------------
### Fetch Payment ID using Order ID
```php
$api->order->fetch($orderId)->payments();
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| orderId* | string | Order id for which payment id need to be fetched |
**Response:**
```json
{
"entity":"collection",
"count":1,
"items":[
{
"id":"pay_1Aa00000000003",
"entity":"payment",
"amount":0,
"currency":"INR",
"status":"captured",
"order_id":"order_1Aa00000000003",
"invoice_id":"inv_1Aa00000000003",
"international":false,
"method":"nach",
"amount_refunded":0,
"refund_status":null,
"captured":true,
"description":"12 p.m. Meals",
"card_id":null,
"bank":"HDFC",
"wallet":null,
"vpa":null,
"email":"gaurav.kumar@example.com",
"contact":"99876543210",
"customer_id":"cust_1Aa00000000002",
"token_id":"token_1Aa00000000003",
"notes":{
"note_key 1":"Beam me up Scotty",
"note_key 2":"Tea. Earl Gray. Hot."
},
"fee":0,
"tax":0,
"error_code":null,
"error_description":null,
"created_at":1580109147
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch token by payment ID
```php
$api->payment->fetch($paymentId);
```
**Parameters:**
| Name | Type | Description |
|------------|--------|-----------------------------------|
| paymentId* | string | Id of the payment to be retrieved |
**Response:**
```json
{
"id": "pay_EnLNTjINiPkMEZ",
"entity": "payment",
"amount": 0,
"currency": "INR",
"status": "captured",
"order_id": "order_EnLLfglmKksr4K",
"invoice_id": "inv_EnLLfgCzRfcMuh",
"international": false,
"method": "nach",
"amount_refunded": 0,
"refund_status": null,
"captured": true,
"description": "Invoice #inv_EnLLfgCzRfcMuh",
"card_id": null,
"bank": "UTIB",
"wallet": null,
"vpa": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"customer_id": "cust_DtHaBuooGHTuyZ",
"token_id": "token_EnLNTnn7uyRg5V",
"notes": {
"note_key 1": "Beam me up Scotty",
"note_key 2": "Tea. Earl Gray. Hot."
},
"fee": 0,
"tax": 0,
"error_code": null,
"error_description": null,
"error_source": null,
"error_step": null,
"error_reason": null,
"acquirer_data": {},
"created_at": 1588827564
}
```
-------------------------------------------------------------------------------------------------------
### Fetch tokens by customer ID
```php
$api->customer->fetch($customerId)->tokens()->all();
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | The id of the customer to be fetched |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "token_EhYgIE3pOyMQpD",
"entity": "token",
"token": "3mQ5Czc6APNppI",
"bank": "HDFC",
"wallet": null,
"method": "nach",
"vpa": null,
"recurring": true,
"recurring_details": {
"status": "confirmed",
"failure_reason": null
},
"auth_type": "physical",
"mrn": null,
"used_at": 1587564373,
"created_at": 1587564373,
"dcc_enabled": false
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Delete token
```php
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| customerId* | string | The id of the customer to be fetched |
| tokenId* | string | The id of the token to be fetched |
**Response:**
```json
{
"deleted": true
}
```
-------------------------------------------------------------------------------------------------------
### Create an order to charge the customer
```php
$api->order->create(array('amount' => 1000,'currency' => 'INR','payment_capture' => true,'receipt' => 'Receipt No. 1','notes'=> array('notes_key_1' => 'Tea, Earl Grey, Hot', 'notes_key_2' => 'Tea, Earl Grey… decaf.')));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| amount* | integer | Amount of the order to be paid |
| currency* | string | Currency of the order. Currently only `INR` is supported. |
| payment_capture* | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
| receipt | string | Your system order reference id. |
| notes | array | A key-value pair |
**Response:**
```json
{
"id":"order_1Aa00000000002",
"entity":"order",
"amount":1000,
"amount_paid":0,
"amount_due":1000,
"currency":"INR",
"receipt":"Receipt No. 1",
"offer_id":null,
"status":"created",
"attempts":0,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at":1579782776
}
```
-------------------------------------------------------------------------------------------------------
### Create a Recurring Payment
```php
$api->payment->createRecurring(array('email'=>'gaurav.kumar@example.com','contact'=>'9123456789','amount'=>100,'currency'=>'INR','order_id'=>'order_1Aa00000000002','customer_id'=>'cust_1Aa00000000001','token'=>'token_1Aa00000000001','recurring'=>'1','description'=>'Creating recurring payment for Gaurav Kumar'));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| email* | string | The customer's email address. |
| contact* | string | The customer's phone number. |
| amount* | integer | The amount you want to charge your customer. This should be the same as the amount in the order. |
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
| order_id* | string | The unique identifier of the order created. |
| customer_id* | string | The `customer_id` for the customer you want to charge. |
| token* | string | The `token_id` generated when the customer successfully completes the authorization payment. Different payment instruments for the same customer have different `token_id`.|
| recurring* | string | Determines if recurring payment is enabled or not. Possible values:
* `1` - Recurring is enabled.* `0` - Recurring is not enabled.|
| description | string | A user-entered description for the payment.|
| notes | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. |
**Response:**
```json
{
"razorpay_payment_id" : "pay_1Aa00000000001",
"razorpay_order_id" : "order_1Aa00000000001",
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/authorization-transaction/)**
PK 6_]lY razorpay/documents/addon.mdnu [ ## Addons
### Create an addon
```php
$api->subscription->fetch($subscriptionId)->createAddon(array('item' => array('name' => 'Extra Chair', 'amount' => 30000, 'currency' => 'INR'), 'quantity' => 2));
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
| items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-an-add-on) |
| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |
**Response:**
```json
{
"id":"ao_00000000000001",
"entity":"addon",
"item":{
"id":"item_00000000000001",
"active":true,
"name":"Extra appala (papadum)",
"description":"1 extra oil fried appala with meals",
"amount":30000,
"unit_amount":30000,
"currency":"INR",
"type":"addon",
"unit":null,
"tax_inclusive":false,
"hsn_code":null,
"sac_code":null,
"tax_rate":null,
"tax_id":null,
"tax_group_id":null,
"created_at":1581597318,
"updated_at":1581597318
},
"quantity":2,
"created_at":1581597318,
"subscription_id":"sub_00000000000001",
"invoice_id":null
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all addons
```php
$api->addon->all($options);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| from | timestamp | timestamp after which the addons were created |
| to | timestamp | timestamp before which the addons were created |
| count | integer | number of addons to fetch (default: 10) |
| skip | integer | number of addons to be skipped (default: 0) |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "ao_00000000000002",
"entity": "addon",
"item": {
"id": "item_00000000000002",
"active": true,
"name": "Extra sweet",
"description": "1 extra sweet of the day with meals",
"amount": 90000,
"unit_amount": 90000,
"currency": "INR",
"type": "addon",
"unit": null,
"tax_inclusive": false,
"hsn_code": null,
"sac_code": null,
"tax_rate": null,
"tax_id": null,
"tax_group_id": null,
"created_at": 1581597318,
"updated_at": 1581597318
},
"quantity": 1,
"created_at": 1581597318,
"subscription_id": "sub_00000000000001",
"invoice_id": "inv_00000000000001"
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch an addon
```php
$api->addon->fetch($addonId);
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| addonId* | string | addon id to be fetched |
**Response:**
```json
{
"id":"ao_00000000000001",
"entity":"addon",
"item":{
"id":"item_00000000000001",
"active":true,
"name":"Extra appala (papadum)",
"description":"1 extra oil fried appala with meals",
"amount":30000,
"unit_amount":30000,
"currency":"INR",
"type":"addon",
"unit":null,
"tax_inclusive":false,
"hsn_code":null,
"sac_code":null,
"tax_rate":null,
"tax_id":null,
"tax_group_id":null,
"created_at":1581597318,
"updated_at":1581597318
},
"quantity":2,
"created_at":1581597318,
"subscription_id":"sub_00000000000001",
"invoice_id":null
}
```
-------------------------------------------------------------------------------------------------------
### Delete an addon
```php
$api->addon->fetch($addonId)->delete();
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|--------------|
| addonId* | string | addon id to be deleted |
**Response:**
```json
[]
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/subscriptions/#add-ons)**
PK 6_]4u^) ) ! razorpay/documents/stakeholder.mdnu [ ## Stakeholders
### Create an Stakeholder
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$api->account->fetch("acc_GP4lfNA0iIMn5B")->stakeholders()->create(array(
"percentage_ownership" => 10,
"name" => "Gaurav Kumar",
"email" => "gaurav.kumar@example.com",
"relationship" => array(
"director" => true,
"executive" => false
),
"phone" => array(
"primary" => "7474747474",
"secondary" => "7474747474"
),
"addresses" => array(
"residential" => array(
"street" => "506, Koramangala 1st block",
"city" => "Bengaluru",
"state" => "Karnataka",
"postal_code" => "560034",
"country" => "IN"
)
),
"kyc" => array(
"pan" => "AVOPB1111K"
),
"notes" => array(
"random_key_by_partner" => "random_value"
)
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| email | string | The sub-merchant's business email address. |
| name* | string | The stakeholder's name as per the PAN card. The maximum length is 255 characters. |
| percentage_ownership | float | The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters. |
| relationship | boolean | The stakeholder's relationship with the account’s business. |
| phone | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
| addresses | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
| kyc | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
| notes | object | A key-value pair |
**Response:**
```json
{
"entity": "stakeholder",
"relationship": {
"director": true
},
"phone": {
"primary": "7474747474",
"secondary": "7474747474"
},
"notes": {
"random_key_by_partner": "random_value"
},
"kyc": {
"pan": "AVOPB1111K"
},
"id": "sth_GLGgm8fFCKc92m",
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"percentage_ownership": 10,
"addresses": {
"residential": {
"street": "506, Koramangala 1st block",
"city": "Bengaluru",
"state": "Karnataka",
"postal_code": "560034",
"country": "IN"
}
}
}
```
-------------------------------------------------------------------------------------------------------
### Edit Stakeholder
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$stakeholderId = "sth_GOQ4Eftlz62TSL";
$api->account->fetch($accountId)->stakeholders()->edit($stakeholderId, array(
"percentage_ownership" => 20,
"name" => "Gauri Kumar",
"relationship" => array(
"director" => false,
"executive" => true
),
"phone" => array(
"primary" => "9898989898",
"secondary" => "9898989898"
),
"addresses" => array(
"residential" => array(
"street" => "507, Koramangala 1st block",
"city" => "Bangalore",
"state" => "Karnataka",
"postal_code" => "560035",
"country" => "IN"
)
),
"kyc" => array(
"pan" => "AVOPB1111J"
),
"notes" => array(
"random_key_by_partner" => "random_value2"
)
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
| name | string | The stakeholder's name as per the PAN card. The maximum length is 255 characters. |
| percentage_ownership | float | The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters. |
| relationship | boolean | The stakeholder's relationship with the account’s business. |
| phone | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
| addresses | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
| kyc | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
| notes | object | A key-value pair |
**Response:**
```json
{
"id": "acc_GP4lfNA0iIMn5B",
"type": "standard",
"status": "created",
"email": "gauri@example.org",
"profile": {
"category": "healthcare",
"subcategory": "clinic",
"addresses": {
"registered": {
"street1": "507, Koramangala 1st block",
"street2": "MG Road-1",
"city": "Bengalore",
"state": "KARNATAKA",
"postal_code": "560034",
"country": "IN"
}
}
},
"notes": [],
"created_at": 1610603081,
"phone": "9000090000",
"reference_id": "randomId",
"business_type": "partnership",
"legal_business_name": "Acme Corp",
"customer_facing_business_name": "ABCD Ltd"
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all accounts
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$api->account->fetch($accountId)->stakeholders()->all();
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
**Response:**
```json
{
"entity": "collection",
"items": [
{
"id": "GZ13yPHLJof9IE",
"entity": "stakeholder",
"relationship": {
"director": true
},
"phone": {
"primary": "9000090000",
"secondary": "9000090000"
},
"notes": {
"random_key_by_partner": "random_value"
},
"kyc": {
"pan": "AVOPB1111K"
},
"name": "Gaurav Kumar",
"email": "gaurav.kumar@acme.org",
"percentage_ownership": 10,
"addresses": {
"residential": {
"street": "506, Koramangala 1st block",
"city": "Bengaluru",
"state": "Karnataka",
"postal_code": "560034",
"country": "in"
}
}
}
],
"count": 1
}
```
-------------------------------------------------------------------------------------------------------
### Fetch an stakeholder
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$stakeholderId = "sth_GOQ4Eftlz62TSL";
$api->account->fetch($accountId)->stakeholders()->fetch($stakeholderId);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
**Response:**
```json
{
"entity": "stakeholder",
"relationship": {
"director": true
},
"phone": {
"primary": "9000090000",
"secondary": "9000090000"
},
"notes": {
"random_key_by_partner": "random_value2"
},
"kyc": {
"pan": "AVOPB1111J"
},
"id": "sth_GOQ4Eftlz62TSL",
"name": "Gauri Kumar",
"email": "gauri@example.com",
"percentage_ownership": 20,
"addresses": {
"residential": {
"street": "507, Koramangala 1st block",
"city": "Bangalore",
"state": "Karnataka",
"postal_code": "560035",
"country": "in"
}
}
}
```
### Upload stakeholders documents
```php
$accountId = "acc_00000000000001";
$stakeholderId = "sth_00000000000001";
$payload = [
'file'=> '/Users/your_name/Downloads/sample_uploaded.pdf',
"document_type" => "aadhar_front"
];
$api->account->fetch($accountId)->stakeholders()->uploadStakeholderDoc($stakeholderId, $payload);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
| file* | string | The URL generated once the business proof document is uploaded. |
| document_type* | string | The documents valid for the proof type to be shared. In case of individual_proof_of_address, both the front and back of a document proof must be uploaded. Possible values :
individual_proof_of_identification: `personal_pan`
individual_proof_of_address : `voter_id_back`, `voter_id_front`, `aadhar_front`, `aadhar_back`, `passport_front`, `passport_back` |
**Response:**
```json
{
"individual_proof_of_address": [
{
"type": "aadhar_front",
"url": "https://rzp.io/i/bzDAbNg"
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch stakeholders documents
```php
$accountId = "acc_00000000000001";
$stakeholderId = "sth_00000000000001";
$api->account->fetch($accountId)->stakeholders()->fetchStakeholderDoc($stakeholderId);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
**Response:**
```json
{
"business_proof_of_identification": [
{
"type": "business_proof_url",
"url": ""
}
]
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/partners/stakeholder)**
$result = $api->account->fetch("acc_M83Uw27KXuC7c8")->stakeholders()->fetchStakeholderDoc("sth_M83WuwmrCFa55g", $payload);
$result = $api->account->fetch("acc_M83Uw27KXuC7c8")->stakeholders()->uploadStakeholderDoc("sth_M83WuwmrCFa55g", $payload);PK 6_]? razorpay/documents/webhook.mdnu [ ## Webhook
### Create a Webhook
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$api->account->fetch($accountId)->webhooks()->create(array(
"url" => "https://google.com",
"alert_email" => "gaurav.kumar@example.com",
"secret" => "12345",
"events" => array(
"payment.authorized",
"payment.failed",
"payment.captured",
"payment.dispute.created",
"refund.failed",
"refund.created"
)
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| url* | string | The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters. |
| alert_email | string | This is the email address to which notifications must be sent in case of webhook failure. |
| secret | string | A secret for the webhook endpoint that is used to validate that the webhook is from Razorpay. |
| events | string | The required events from the list of Active Events. For example `payment.authorized`, `payment.captured`, `payment.failed`, `payment.dispute.created`, `refund.failed`, `refund.created` and so on. |
**Response:**
```json
{
"id": "JebiXkKGYwua5L",
"created_at": 1654605478,
"updated_at": 1654605478,
"service": "beta-api-live",
"owner_id": "JOGUdtKu3dB03d",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://google.com",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"payment.authorized",
"payment.failed",
"payment.captured",
"payment.dispute.created",
"refund.failed",
"refund.created"
]
}
```
-------------------------------------------------------------------------------------------------------
### Edit Webhook
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$webhookId = "HK890egfiItP3H";
$api->account->fetch($accountId)->webhooks()->edit($webhookId, array(
"url" => "https://www.linkedin.com",
"events" => array(
"refund.created"
)
));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| webhookId* | string | The unique identifier of the webhook whose details are to be updated |
| url | string | The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters. |
| events | string | The required events from the list of Active Events. For example `payment.authorized`, `payment.captured`, `payment.failed`, `payment.dispute.created`, `refund.failed`, `refund.created` and so on. |
**Response:**
```json
{
"id": "HK890egfiItP3H",
"created_at": 1623060358,
"updated_at": 1623067148,
"service": "beta-api-test",
"owner_id": "H3kYHQ635sBwXG",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://www.linkedin.com",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"refund.created"
]
}
```
-------------------------------------------------------------------------------------------------------
### Delete an account
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$webhookId = "HK890egfiItP3H";
$api->account->fetch($accountId)->webhooks()->delete($webhookId);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account that must be deleted. |
| webhookId* | string | The unique identifier of the webhook whose details are to be updated |
**Response:**
```json
[]
```
-------------------------------------------------------------------------------------------------------
### Fetch a webhook
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$webhookId = "HK890egfiItP3H";
$api->account->fetch($accountId)->webhooks()->fetch($webhookId);
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| webhookId* | string | The unique identifier of the webhook whose details are to be updated |
**Response:**
```json
{
"id": "HK890egfiItP3H",
"created_at": 1623060358,
"updated_at": 1623060358,
"owner_id": "H3kYHQ635sBwXG",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://en1mwkqo5ioct.x.pipedream.net",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"payment.authorized",
"payment.failed",
"payment.captured",
"payment.dispute.created",
"refund.failed",
"refund.created"
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all Webhooks
```php
$accountId = "acc_GP4lfNA0iIMn5B";
$api->account->fetch($accountId)->webhooks()->all();
```
**Parameters:**
| Name | Type | Description |
|-------------|-------------|---------------------------------------------|
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
| from | integer | Timestamp, in seconds, from when the webhooks are to be fetched. |
| to | integer | Timestamp, in seconds, till when the webhooks are to be fetched. |
| count | integer | Number of webhooks to be fetched. The default value is `10` and the maximum value is `100`. This can be used for pagination, in combination with `skip`. |
| skip | integer | Number of records to be skipped while fetching the webhooks. This can be used for pagination, in combination with `count`. |
**Response:**
```json
{
"id": "HK890egfiItP3H",
"created_at": 1623060358,
"updated_at": 1623060358,
"owner_id": "H3kYHQ635sBwXG",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://en1mwkqo5ioct.x.pipedream.net",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"payment.authorized",
"payment.failed",
"payment.captured",
"payment.dispute.created",
"refund.failed",
"refund.created"
]
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/partners/webhooks)**PK 6_]rpfR R " razorpay/documents/subscription.mdnu [ ## Subscriptions
### Create subscription
```php
$api->subscription->create(array("plan_id" => "plan_Jc7wDk5iZX88wx","total_count" => 6,"quantity" => 1,"customer_notify" => 1,"start_at" => 1580453311,"expire_by" => 1580626111,"addons" => array(array("item" => array("name" => "Delivery charges","amount" => 30000,"currency" => "INR"))),"offer_id" => "offer_JCTD1XMlUmzF6Z","notes" => array("notes_key_1" => "Tea, Earl Grey, Hot","notes_key_2" => "Tea, Earl Grey… decaf.")));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| plan_id* | string | The unique identifier for a plan that should be linked to the subscription.|
| total_count* | string | The number of billing cycles for which the customer should be charged |
| customer_notify | boolean | Indicates whether the communication to the customer would be handled by you or us |
| quantity | integer | The number of times the customer should be charged the plan amount per invoice |
| start_at | integer | The timestamp, in Unix format, for when the subscription should start. If not passed, the subscription starts immediately after the authorization payment. |
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
| addons | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription) are supported |
| notes | array | Notes you can enter for the contact for future reference. |
| offer_id | string | The unique identifier of the offer that is linked to the subscription. |
**Response:**
```json
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000001",
"status": "created",
"current_start": null,
"current_end": null,
"ended_at": null,
"quantity": 1,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"charge_at": 1580453311,
"start_at": 1580626111,
"end_at": 1583433000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 0,
"customer_notify": true,
"created_at": 1580280581,
"expire_by": 1580626111,
"short_url": "https://rzp.io/i/z3b1R61A9",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count": 5
}
```
-------------------------------------------------------------------------------------------------------
### Create subscription link
```php
$api->subscription->create(array("plan_id" => "plan_Jc7wDk5iZX88wx","total_count" => 12,"quantity" => 1,"start_at" => 1561852800,"expire_by" => 1561939199,"customer_notify" => 1,"addons" => array(array("item" => array("name" => "Delivery charges","amount" => 30000,"currency" => "INR"))),"offer_id" => "offer_JCTD1XMlUmzF6Z","notes" => array("notes_key_1" => "Tea, Earl Grey, Hot","notes_key_2" => "Tea, Earl Grey… decaf."),"notify_info" => array("notify_phone" => "9123456789","notify_email" => "gaurav.kumar@example.com")));
```
**Parameters:**
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| plan_id* | string | The unique identifier for a plan that should be linked to the subscription.|
| total_count* | string | The number of billing cycles for which the customer should be charged |
| customer_notify | boolean | Indicates whether the communication to the customer would be handled by you or us |
| quantity | integer | The number of times the customer should be charged the plan amount per invoice |
| start_at | integer | The timestamp, in Unix format, for when the subscription should start. If not passed, the subscription starts immediately after the authorization payment. |
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
| addons | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription-link) are supported |
| notes | array | Notes you can enter for the contact for future reference. |
| notify_info | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription-link) are supported |
| offer_id | string | The unique identifier of the offer that is linked to the subscription. |
**Response:**
```json
{
"id":"sub_00000000000002",
"entity":"subscription",
"plan_id":"plan_00000000000001",
"status":"created",
"current_start":null,
"current_end":null,
"ended_at":null,
"quantity":1,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"charge_at":1580453311,
"start_at":1580453311,
"end_at":1587061800,
"auth_attempts":0,
"total_count":12,
"paid_count":0,
"customer_notify":true,
"created_at":1580283117,
"expire_by":1581013800,
"short_url":"https://rzp.io/i/m0y0f",
"has_scheduled_changes":false,
"change_scheduled_at":null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count":12
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all subscriptions
```php
$api->subscription->all($options);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| from | timestamp | timestamp after which the payments were created |
| to | timestamp | timestamp before which the payments were created |
| count | integer | number of subscriptions to fetch (default: 10) |
| skip | integer | number of subscriptions to be skipped (default: 0) |
| plan_id | string | The unique identifier of the plan for which you want to retrieve all the subscriptions |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000001",
"customer_id": "cust_D00000000000001",
"status": "active",
"current_start": 1577355871,
"current_end": 1582655400,
"ended_at": null,
"quantity": 1,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"charge_at": 1577385991,
"offer_id": "offer_JHD834hjbxzhd38d",
"start_at": 1577385991,
"end_at": 1603737000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 1,
"customer_notify": true,
"created_at": 1577356081,
"expire_by": 1577485991,
"short_url": "https://rzp.io/i/z3b1R61A9",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"remaining_count": 5
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch particular subscription
```php
$api->subscription->fetch($subscriptionId);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be fetched |
**Response:**
```json
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000001",
"customer_id": "cust_D00000000000001",
"status": "active",
"current_start": 1577355871,
"current_end": 1582655400,
"ended_at": null,
"quantity": 1,
"notes":{
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"charge_at": 1577385991,
"start_at": 1577385991,
"end_at": 1603737000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 1,
"customer_notify": true,
"created_at": 1577356081,
"expire_by": 1577485991,
"short_url": "https://rzp.io/i/z3b1R61A9",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count": 5
}
```
-------------------------------------------------------------------------------------------------------
### Cancel particular subscription
```php
$api->subscription->fetch($subscriptionId)->cancel($options);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be cancelled |
| cancel_at_cycle_end | boolean | Possible values:
0 (default): Cancel the subscription immediately.
1: Cancel the subscription at the end of the current billing cycle. |
**Response:**
```json
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000001",
"customer_id": "cust_D00000000000001",
"status": "cancelled",
"current_start": 1580453311,
"current_end": 1581013800,
"ended_at": 1580288092,
"quantity": 1,
"notes":{
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"charge_at": 1580453311,
"start_at": 1577385991,
"end_at": 1603737000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 1,
"customer_notify": true,
"created_at": 1580283117,
"expire_by": 1581013800,
"short_url": "https://rzp.io/i/z3b1R61A9",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count": 5
}
```
-------------------------------------------------------------------------------------------------------
### Update particular subscription
```php
$api->subscription->fetch($subscriptionId)->update($options);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be updated |
| options | array | All parameters listed [here](https://razorpay.com/docs/api/subscriptions/#update-a-subscription) for update |
**Response:**
```json
{
"id":"sub_00000000000002",
"entity":"subscription",
"plan_id":"plan_00000000000002",
"customer_id":"cust_00000000000002",
"status":"authenticated",
"current_start":null,
"current_end":null,
"ended_at":null,
"quantity":3,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"charge_at":1580453311,
"start_at":1580453311,
"end_at":1606588200,
"auth_attempts":0,
"total_count":6,
"paid_count":0,
"customer_notify":true,
"created_at":1580283807,
"expire_by":1580626111,
"short_url":"https://rzp.io/i/yeDkUKy",
"has_scheduled_changes":false,
"change_scheduled_at":null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count":6
}
```
-------------------------------------------------------------------------------------------------------
### Fetch details of pending update
```php
$api->subscription->fetch($subscriptionId)->pendingUpdate()
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to fetch pending update |
**Response:**
```json
{
"id":"sub_00000000000001",
"entity":"subscription",
"plan_id":"plan_00000000000003",
"customer_id":"cust_00000000000001",
"status":"active",
"current_start":1580284732,
"current_end":1580841000,
"ended_at":null,
"quantity":25,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"charge_at":1580841000,
"start_at":1580284732,
"end_at":1611081000,
"auth_attempts":0,
"total_count":6,
"paid_count":1,
"customer_notify":true,
"created_at":1580284702,
"expire_by":1580626111,
"short_url":"https://rzp.io/i/fFWTkbf",
"has_scheduled_changes":true,
"change_scheduled_at":1557253800,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count":5
}
```
-------------------------------------------------------------------------------------------------------
### Cancel a update
```php
$api->subscription->fetch($subscriptionId)->cancelScheduledChanges();
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be cancel an update |
**Response:**
```json
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000003",
"customer_id": "cust_00000000000001",
"status": "active",
"current_start": 1580284732,
"current_end": 1580841000,
"ended_at": null,
"quantity": 1,
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"charge_at": 1580841000,
"start_at": 1580284732,
"end_at": 1611081000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 1,
"customer_notify": true,
"created_at": 1580284702,
"expire_by": 1580626111,
"short_url": "https://rzp.io/i/fFWTkbf",
"has_scheduled_changes": false,
"change_scheduled_at": 1527858600,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count": 5
}
```
-------------------------------------------------------------------------------------------------------
### Pause a subscription
```php
$api->subscription->fetch($subscriptionId)->pause(array('pause_at'=>'now'));
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be paused |
| pause_at | string | To pause the subscription, possible values: `now` |
**Response:**
```json
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000001",
"status": "paused",
"current_start": null,
"current_end": null,
"ended_at": null,
"quantity": 1,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"charge_at": null,
"start_at": 1580626111,
"end_at": 1583433000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 0,
"customer_notify": true,
"created_at": 1580280581,
"paused_at": 1590280581,
"expire_by": 1580626111,
"pause_initiated_by": "self",
"short_url": "https://rzp.io/i/z3b1R61A9",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count": 6
}
```
-------------------------------------------------------------------------------------------------------
### Resume a subscription
```php
$api->subscription->fetch($subscriptionId)->resume(array('resume_at'=>'now'));
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to be resumed |
| resume_at | string | To resume the subscription, possible values: `now` |
**Response:**
```json
{
"id": "sub_00000000000001",
"entity": "subscription",
"plan_id": "plan_00000000000001",
"status": "active",
"current_start": null,
"current_end": null,
"ended_at": null,
"quantity": 1,
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"charge_at": 1580453311,
"start_at": 1580626111,
"end_at": 1583433000,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 0,
"customer_notify": true,
"created_at": 1580280581,
"paused_at": 1590280581,
"expire_by": 1580626111,
"pause_initiated_by": null,
"short_url": "https://rzp.io/i/z3b1R61A9",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"source": "api",
"offer_id":"offer_JHD834hjbxzhd38d",
"remaining_count": 6
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all invoices for a subscription
```php
$api->invoice->all(['subscription_id'=>$subscriptionId]);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to fetch invoices |
**Response:**
```json
{
"entity": "collection",
"count": 1,
"items": [
{
"id": "inv_00000000000003",
"entity": "invoice",
"receipt": null,
"invoice_number": null,
"customer_id": "cust_00000000000001",
"customer_details": {
"id": "cust_00000000000001",
"name": null,
"email": "gaurav.kumar@example.com",
"contact": "+919876543210",
"gstin": null,
"billing_address": null,
"shipping_address": null,
"customer_name": null,
"customer_email": "gaurav.kumar@example.com",
"customer_contact": "+919876543210"
},
"order_id": "order_00000000000002",
"subscription_id": "sub_00000000000001",
"line_items": [
{
"id": "li_00000000000003",
"item_id": null,
"ref_id": null,
"ref_type": null,
"name": "Monthly Plan",
"description": null,
"amount": 99900,
"unit_amount": 99900,
"gross_amount": 99900,
"tax_amount": 0,
"taxable_amount": 99900,
"net_amount": 99900,
"currency": "INR",
"type": "plan",
"tax_inclusive": false,
"hsn_code": null,
"sac_code": null,
"tax_rate": null,
"unit": null,
"quantity": 1,
"taxes": []
}
],
"payment_id": "pay_00000000000002",
"status": "paid",
"expire_by": null,
"issued_at": 1593344888,
"paid_at": 1593344889,
"cancelled_at": null,
"expired_at": null,
"sms_status": null,
"email_status": null,
"date": 1593344888,
"terms": null,
"partial_payment": false,
"gross_amount": 99900,
"tax_amount": 0,
"taxable_amount": 99900,
"amount": 99900,
"amount_paid": 99900,
"amount_due": 0,
"currency": "INR",
"currency_symbol": "₹",
"description": null,
"notes": [],
"comment": null,
"short_url": "https://rzp.io/i/Ys4feGqEp",
"view_less": true,
"billing_start": 1594405800,
"billing_end": 1597084200,
"type": "invoice",
"group_taxes_discounts": false,
"created_at": 1593344888,
"idempotency_key": null
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Delete offer linked to a subscription
```php
$api->subscription->fetch($subscriptionId)->deleteOffer($offerId);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | string | The id of the subscription to offer need to be deleted |
| offerId* | string | The id of the offer linked to subscription |
**Response:**
```json
{
"id": "sub_I3GGEs7Xgmnozy",
"entity": "subscription",
"plan_id": "plan_HuXrfsI0ZZ3peu",
"customer_id": "cust_I3FToKbnExwDLu",
"status": "active",
"current_start": 1632914901,
"current_end": 1635445800,
"ended_at": null,
"quantity": 1,
"notes": [],
"charge_at": 1635445800,
"start_at": 1632914901,
"end_at": 1645986600,
"auth_attempts": 0,
"total_count": 6,
"paid_count": 1,
"customer_notify": true,
"created_at": 1632914246,
"expire_by": 1635532200,
"short_url": "https://rzp.io/i/SOvRWaYP81",
"has_scheduled_changes": false,
"change_scheduled_at": null,
"source": "dashboard",
"payment_method": "card",
"offer_id": null,
"remaining_count": 5
}
```
-------------------------------------------------------------------------------------------------------
### Authentication Transaction
Please refer this [doc](https://razorpay.com/docs/api/subscriptions/#authentication-transaction) for authentication of transaction
-------------------------------------------------------------------------------------------------------
### Payment verification
```php
$api->utility->verifyPaymentSignature($options)
```
Please refer this [doc](https://razorpay.com/docs/api/subscriptions/#payment-verification) for payment verification
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/subscriptions/#subscriptions)**
PK 6_]3> > razorpay/documents/settlement.mdnu [ ## Settlements
### Fetch all settlements
```php
$api->settlement->all($options);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| from | timestamp | timestamp after which the settlement were created |
| to | timestamp | timestamp before which the settlement were created |
| count | integer | number of settlements to fetch (default: 10) |
| skip | integer | number of settlements to be skipped (default: 0) |
**Response:**
```json
{
"entity": "collection",
"count": 2,
"items": [
{
"id": "setl_DGlQ1Rj8os78Ec",
"entity": "settlement",
"amount": 9973635,
"status": "processed",
"fees": 471699,
"tax": 42070,
"utr": "1568176960vxp0rj",
"created_at": 1568176960
},
{
"id": "setl_4xbSwsPABDJ8oK",
"entity": "settlement",
"amount": 50000,
"status": "processed",
"fees": 123,
"tax": 12,
"utr": "RZRP173069230702",
"created_at": 1509622306
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Fetch a settlement
```php
$api->settlement->fetch($settlementId);
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| $settlementId* | string | The id of the settlement to be fetched |
**Response:**
```json
{
"id": "setl_DGlQ1Rj8os78Ec",
"entity": "settlement",
"amount": 9973635,
"status": "processed",
"fees": 471699,
"tax": 42070,
"utr": "1568176960vxp0rj",
"created_at": 1568176960
}
```
-------------------------------------------------------------------------------------------------------
### Settlement report for a month
```php
$api->settlement->reports(array("year"=>2020,"month"=>09));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| year* | integer | The year the settlement was received in the `YYYY` format. For example, `2020` |
| month* | integer | The month the settlement was received in the `MM` format. For example, `09` |
| day | integer | The date the settlement was received in the `DD` format. For example, `01` |
| count | integer | number of settlements to fetch (default: 10) |
| skip | integer | number of settlements to be skipped (default: 0) |
**Response:**
```json
{
"entity": "collection",
"count": 4,
"items": [
{
"entity_id": "pay_DEXrnipqTmWVGE",
"type": "payment",
"debit": 0,
"credit": 97100,
"amount": 100000,
"currency": "INR",
"fee": 2900,
"tax": 0,
"on_hold": false,
"settled": true,
"created_at": 1567692556,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"credit_type": "default",
"description": "Recurring Payment via Subscription",
"notes": "{}",
"payment_id": null,
"settlement_utr": "1568176960vxp0rj",
"order_id": "order_DEXrnRiR3SNDHA",
"order_receipt": null,
"method": "card",
"card_network": "MasterCard",
"card_issuer": "KARB",
"card_type": "credit",
"dispute_id": null
},
{
"entity_id": "rfnd_DGRcGzZSLyEdg1",
"type": "refund",
"debit": 242500,
"credit": 0,
"amount": 242500,
"currency": "INR",
"fee": 0,
"tax": 0,
"on_hold": false,
"settled": true,
"created_at": 1568107224,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"credit_type": "default",
"description": null,
"notes": "{}",
"payment_id": "pay_DEXq1pACSqFxtS",
"settlement_utr": "1568176960vxp0rj",
"order_id": "order_DEXpmZgffXNvuI",
"order_receipt": null,
"method": "card",
"card_network": "MasterCard",
"card_issuer": "KARB",
"card_type": "credit",
"dispute_id": null
},
{
"entity_id": "trf_DEUoCEtdsJgvl7",
"type": "transfer",
"debit": 100296,
"credit": 0,
"amount": 100000,
"currency": "INR",
"fee": 296,
"tax": 46,
"on_hold": false,
"settled": true,
"created_at": 1567681786,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"credit_type": "default",
"description": null,
"notes": null,
"payment_id": "pay_DEApNNTR6xmqJy",
"settlement_utr": "1568176960vxp0rj",
"order_id": null,
"order_receipt": null,
"method": null,
"card_network": null,
"card_issuer": null,
"card_type": null,
"dispute_id": null
},
{
"entity_id": "adj_EhcHONhX4ChgNC",
"type": "adjustment",
"debit": 0,
"credit": 1012,
"amount": 1012,
"currency": "INR",
"fee": 0,
"tax": 0,
"on_hold": false,
"settled": true,
"created_at": 1567681786,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"description": "test reason",
"notes": null,
"payment_id": null,
"settlement_utr": null,
"order_id": null,
"order_receipt": null,
"method": null,
"card_network": null,
"card_issuer": null,
"card_type": null,
"dispute_id": null
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Settlement recon
```php
$api->settlement->settlementRecon(array('year' => 2018, 'month' => 2, 'day'=>11));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| year* | integer | The year the settlement was received in the `YYYY` format. For example, `2020` |
| month* | integer | The month the settlement was received in the `MM` format. For example, `09` |
| day | integer | The day the settlement was received in the `DD` format. For example, |
**Response:**
```json
{
"entity": "collection",
"count": 4,
"items": [
{
"entity_id": "pay_DEXrnipqTmWVGE",
"type": "payment",
"debit": 0,
"credit": 97100,
"amount": 100000,
"currency": "INR",
"fee": 2900,
"tax": 0,
"on_hold": false,
"settled": true,
"created_at": 1567692556,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"credit_type": "default",
"description": "Recurring Payment via Subscription",
"notes": "{}",
"payment_id": null,
"settlement_utr": "1568176960vxp0rj",
"order_id": "order_DEXrnRiR3SNDHA",
"order_receipt": null,
"method": "card",
"card_network": "MasterCard",
"card_issuer": "KARB",
"card_type": "credit",
"dispute_id": null
},
{
"entity_id": "rfnd_DGRcGzZSLyEdg1",
"type": "refund",
"debit": 242500,
"credit": 0,
"amount": 242500,
"currency": "INR",
"fee": 0,
"tax": 0,
"on_hold": false,
"settled": true,
"created_at": 1568107224,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"credit_type": "default",
"description": null,
"notes": "{}",
"payment_id": "pay_DEXq1pACSqFxtS",
"settlement_utr": "1568176960vxp0rj",
"order_id": "order_DEXpmZgffXNvuI",
"order_receipt": null,
"method": "card",
"card_network": "MasterCard",
"card_issuer": "KARB",
"card_type": "credit",
"dispute_id": null
},
{
"entity_id": "trf_DEUoCEtdsJgvl7",
"type": "transfer",
"debit": 100296,
"credit": 0,
"amount": 100000,
"currency": "INR",
"fee": 296,
"tax": 46,
"on_hold": false,
"settled": true,
"created_at": 1567681786,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"credit_type": "default",
"description": null,
"notes": null,
"payment_id": "pay_DEApNNTR6xmqJy",
"settlement_utr": "1568176960vxp0rj",
"order_id": null,
"order_receipt": null,
"method": null,
"card_network": null,
"card_issuer": null,
"card_type": null,
"dispute_id": null
},
{
"entity_id": "adj_EhcHONhX4ChgNC",
"type": "adjustment",
"debit": 0,
"credit": 1012,
"amount": 1012,
"currency": "INR",
"fee": 0,
"tax": 0,
"on_hold": false,
"settled": true,
"created_at": 1567681786,
"settled_at": 1568176960,
"settlement_id": "setl_DGlQ1Rj8os78Ec",
"posted_at": null,
"description": "test reason",
"notes": null,
"payment_id": null,
"settlement_utr": null,
"order_id": null,
"order_receipt": null,
"method": null,
"card_network": null,
"card_issuer": null,
"card_type": null,
"dispute_id": null
}
]
}
```
-------------------------------------------------------------------------------------------------------
### Create on-demand settlement
```php
$api->settlement->createOndemandSettlement(array("amount"=> 1221, "settle_full_balance"=> false, "description"=>"Testing","notes" => array("notes_key_1"=> "Tea, Earl Grey, Hot","notes_key_2"=> "Tea, Earl Grey… decaf.")));
```
**Parameters:**
| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| amount*| integer | Maximum amount that can be settled |
| settle_full_balance* | boolean | true or false |
| description | string | The description may not be greater than 30 characters |
| notes | array | A key-value pair |
**Response:**
```json
{
"id": "setlod_FNj7g2YS5J67Rz",
"entity": "settlement.ondemand",
"amount_requested": 200000,
"amount_settled": 0,
"amount_pending": 199410,
"amount_reversed": 0,
"fees": 590,
"tax": 90,
"currency": "INR",
"settle_full_balance": false,
"status": "initiated",
"description": "Need this to make vendor payments.",
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
},
"created_at": 1596771429,
"ondemand_payouts": {
"entity": "collection",
"count": 1,
"items": [
{
"id": "setlodp_FNj7g2cbvw8ueO",
"entity": "settlement.ondemand_payout",
"initiated_at": null,
"processed_at": null,
"reversed_at": null,
"amount": 200000,
"amount_settled": null,
"fees": 590,
"tax": 90,
"utr": null,
"status": "created",
"created_at": 1596771429
}
]
}
}
```
-------------------------------------------------------------------------------------------------------
### Fetch all on-demand settlements
```php
$api->settlement->fetchAllOndemandSettlement($options);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| from | timestamp | timestamp after which the payments were created |
| to | timestamp | timestamp before which the payments were created |
| count | integer | number of payments to fetch (default: 10) |
| skip | integer | number of payments to be skipped (default: 0) |
**Response:**
For all on-demand settlements response please click [here](https://razorpay.com/docs/api/settlements/#fetch-all-on-demand-settlements)
-------------------------------------------------------------------------------------------------------
### Fetch on-demand settlement by ID
```php
$api->settlement->fetch($settlementId)->fetchOndemandSettlementById();
```
**Parameters:**
| Name | Type | Description |
|------------|--------|-----------------------------------|
| $settlementId* | string | Settlement Id of the On-demand settlement|
**Response:**
For on-demand settlement by ID response please click [here](https://razorpay.com/docs/api/settlements/#fetch-on-demand-settlements-by-id)
-------------------------------------------------------------------------------------------------------
### Fetch Instant Settlement With ID With Payout Details
```php
$settlementId = "setlod_MI0c34SIRVT25W";
$api->settlement->fetchOndemandSettlementById($settlementId,["expand[]"=> "ondemand_payouts"]);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| expand[] | string | Possible value is `ondemand_payouts` |
**Response:**
```json
{
"id": "setlod_FNj7g2YS5J67Rz",
"entity": "settlement.ondemand",
"amount_requested": 200000,
"amount_settled": 199410,
"amount_pending": 0,
"amount_reversed": 0,
"fees": 590,
"tax": 90,
"currency": "INR",
"settle_full_balance": false,
"status": "processed",
"description": "Need this to buy stock.",
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey, decaf."
},
"created_at": 1596771429,
"ondemand_payouts": {
"entity": "collection",
"count": 1,
"items": [
{
"id": "setlodp_FNj7g2cbvw8ueO",
"entity": "settlement.ondemand_payout",
"initiated_at": 1596771430,
"processed_at": 1596778752,
"reversed_at": null,
"amount": 200000,
"amount_settled": 199410,
"fees": 590,
"tax": 90,
"utr": "022011173948",
"status": "processed",
"created_at": 1596771429
}
]
}
}
```
-------------------------------------------------------------------------------------------------------
### Fetch All Instant Settlements With Payout Details
```php
$api->settlement->fetchAllOndemandSettlement(["expand[]"=> "ondemand_payouts"]);
```
**Parameters:**
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| expand[] | string | Possible value is `ondemand_payouts` |
**Response:**
```json
{
"entity": "collection",
"count": 2,
"items": [
{
"id": "setlod_FNj7g2YS5J67Rz",
"entity": "settlement.ondemand",
"amount_requested": 200000,
"amount_settled": 199410,
"amount_pending": 0,
"amount_reversed": 0,
"fees": 590,
"tax": 90,
"currency": "INR",
"settle_full_balance": false,
"status": "processed",
"description": "Need this to make vendor payments.",
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey, decaf."
},
"created_at": 1596771429,
"ondemand_payouts": {
"entity": "collection",
"count": 1,
"items": [
{
"id": "setlodp_FNj7g2cbvw8ueO",
"entity": "settlement.ondemand_payout",
"initiated_at": 1596771430,
"processed_at": 1596778752,
"reversed_at": null,
"amount": 200000,
"amount_settled": 199410,
"fees": 590,
"tax": 90,
"utr": "022011173948",
"status": "processed",
"created_at": 1596771429
}
]
}
}
]
}
```
-------------------------------------------------------------------------------------------------------
**PN: * indicates mandatory fields**
**For reference click [here](https://razorpay.com/docs/api/settlements/)**
PK 6_] n9 9 &