Skip to content

Commit

Permalink
Merge pull request #193 from razorpay/doc_api_correction
Browse files Browse the repository at this point in the history
Doc api correction
  • Loading branch information
ankitdas13 authored Jul 1, 2022
2 parents 0352f2d + da7e26c commit 912da6a
Show file tree
Hide file tree
Showing 32 changed files with 1,670 additions and 750 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format

## Unreleased

## [1.3.1][1.3.1] - 2022-07-01

- Added Third party validation & Otp API for Payment (createUpi, validateVpa, otpGenerate, otpSubmit, otpResend)
- Update Documention

## [1.3.0][1.3.0] - 2022-02-01

### Added
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ that both app title and version are strings.

- [Token](documents/token.md)

- [Fund](documents/fund.md)

- [Order](documents/order.md)

- [Payments](documents/payment.md)
Expand Down
4 changes: 2 additions & 2 deletions documents/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ client.subscription.createAddon('sub_I55auG9GnbsR8u',{
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
| items* | object | Details of the add-on you want to create. |
| quantity* | integer | This specifies the number of units of the add-on to be charged to the customer. |
| 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
Expand Down
67 changes: 50 additions & 17 deletions documents/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@ client.customer.create({

```py
client.order.create({
"amount": 50000,
"currency": "INR",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
}
"amount":100,
"currency":"INR",
"customer_id":"cust_4xbQrmEoA5WJ01",
"method":"card",
"token":{
"max_amount":5000,
"expire_at":2709971120,
"frequency":"monthly"
},
"receipt":"Receipt No. 1",
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey... decaf."
}
})
```

Expand All @@ -62,24 +69,35 @@ client.order.create({
|-----------------|---------|------------------------------------------------------------------------------|
| 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 |
| receipt | string | Your system order reference id. |
| method* | string | Payment method used to make the registration transaction. Possible value is `card`. |
| token | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#112-create-an-order) are supported |
| notes | object | A key-value pair |

**Response:**
```json
{
"id": "order_EKwxwAgItmmXdp",
"id": "order_JmugUU7mFbXTRN",
"entity": "order",
"amount": 50000,
"amount": 100,
"amount_paid": 0,
"amount_due": 50000,
"amount_due": 100,
"currency": "INR",
"receipt": "receipt#1",
"receipt": "Receipt No. 1",
"offer_id": null,
"status": "created",
"attempts": 0,
"notes": [],
"created_at": 1582628071
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey... decaf."
},
"created_at": 1656418993,
"token": {
"max_amount": 5000,
"expire_at": 2709971120
},
"method": "card"
}
```
-------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -117,8 +135,7 @@ client.registration_link.create({

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customer | object | Details of the customer to whom the registration link will be sent. |
| type* | string | the value is `link`. |
| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#121-create-a-registration-link) are supported |
| 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) |
| description* | string | A brief description of the payment. |
Expand Down Expand Up @@ -216,7 +233,7 @@ client.order.create({
| 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 `card`. |
| method | string | Payment method used to make the registration transaction. Possible value is `card`. |
| receipt | string | Your system order reference id. |
| token | array | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/subsequent-payments/#31-create-an-order-to-charge-the-customer) are supported |
| notes | array | A key-value pair |
Expand Down Expand Up @@ -515,8 +532,24 @@ client.card.fetch(cardId)

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| cardId* | string | card id to be fetched |
| cardId* | string | card id to be fetched |

**Response:**
```json
{
"id": "card_JXPULjlKqC5j0i",
"entity": "card",
"name": "Gaurav",
"last4": "4366",
"network": "Visa",
"type": "credit",
"issuer": "UTIB",
"international": false,
"emi": true,
"sub_type": "consumer",
"token_iin": null
}
```
-------------------------------------------------------------------------------------------------------

## Delete tokens
Expand Down
6 changes: 4 additions & 2 deletions documents/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ client.customer.create({
| 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 | object | A key-value pair |

**Response:**
Expand Down Expand Up @@ -88,8 +90,8 @@ client.customer.all(options)

| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| count | integer | number of payments to fetch (default: 10) |
| skip | integer | number of payments to be skipped (default: 0) |
| count | integer | number of customers to fetch (default: 10) |
| skip | integer | number of customers to be skipped (default: 0) |

**Response:**
```json
Expand Down
25 changes: 18 additions & 7 deletions documents/emandate.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ client.customer.create({
| 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 | object | A key-value pair |

**Response:**
Expand All @@ -48,12 +49,13 @@ client.customer.create({
client.order.create({
"amount": 0,
"currency": "INR",
"payment_capture": True,
"method": "emandate",
"customer_id": "cust_1Aa00000000001",
"receipt": "Receipt No. 1",
"notes": {
"notes_key_1": "Beam me up Scotty",
"notes_key_2": "Engage"
"notes_key_2": "Engage"
},
"token": {
"auth_type": "netbanking",
Expand Down Expand Up @@ -81,11 +83,14 @@ client.order.create({
| currency* | string | Currency of the order. Currently only `INR` is supported. |
| method* | string | The authorization method. In this case the value will be `emandate` |
| receipt | string | Your system order reference id. |
| customer_id* | string | The `customer_id` for the customer you want to charge.|
| 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. |
| notes | object | A key-value pair |
| token | object | A key-value pair |
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported|

**Response:**
Create order response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#112-create-an-order)

-------------------------------------------------------------------------------------------------------

### Create an Authorization Payment
Expand Down Expand Up @@ -134,16 +139,20 @@ client.registration_link.create({

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customer | object | Details of the customer to whom the registration link will be sent. |
| customer* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
| 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 | object | Details of the authorization payment. |
| notes | object | A key-value pair |
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
| 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:**
Create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#121-create-a-registration-link)

-------------------------------------------------------------------------------------------------------

### Send/Resend notifications
Expand Down Expand Up @@ -369,6 +378,7 @@ client.token.delete(customerId,tokenId)
client.order.create({
"amount":1000,
"currency":"INR",
"payment_capture": True,
"receipt":"Receipt No. 1",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
Expand All @@ -385,6 +395,7 @@ client.order.create({
| currency* | string | Currency of the order. Currently only `INR` is supported. |
| receipt | string | Your system order reference id. |
| notes | object | A key-value pair |
| 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. |

**Response:**
```json
Expand Down Expand Up @@ -440,8 +451,8 @@ client.payment.createRecurring({
| 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:<br>* `1` - Recurring is enabled.* `0` - Recurring is not enabled.|
| description* | string | A user-entered description for the payment.|
| notes* | object | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. |
| description | string | A user-entered description for the payment.|
| notes | object | 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
Expand Down
76 changes: 51 additions & 25 deletions documents/fund.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,33 @@ client.fund_account.create({
|---------------|-------------|---------------------------------------------|
| customerId* | string | The id of the customer to be fetched |
| account_type* | string | The bank_account to be linked to the customer ID |
| bank_account* | object | A key-value pair |
| bank_account* | object | All keys listed [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/#create-a-fund-account) are supported |

**Response:**
```json
{
"id":"fa_Aa00000000001",
"entity":"fund_account",
"customer_id":"cust_Aa000000000001",
"account_type":"bank_account",
"bank_account":{
"name":"Gaurav Kumar",
"account_number":"11214311215411",
"ifsc":"HDFC0000053",
"bank_name":"HDFC Bank"
"id": "fa_JexSeA2SS1S19D",
"entity": "fund_account",
"customer_id": "cust_JdumbHq5F3kKu6",
"account_type": "bank_account",
"bank_account": {
"ifsc": "HDFC0000053",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"notes": [],
"account_number": "11214311215411"
},
"active":true,
"created_at":1543650891
"batch_id": null,
"active": true,
"created_at": 1654682051
}
```
-------------------------------------------------------------------------------------------------------

### Fetch all fund accounts

```py
client.fund_account.fetch(customerId)
client.fund_account.all({"customer_id":customerId})
```

**Parameters:**
Expand All @@ -55,18 +57,42 @@ client.fund_account.fetch(customerId)
**Response:**
```json
{
"id":"fa_Aa00000000001",
"entity":"fund_account",
"customer_id":"cust_Aa000000000001",
"account_type":"bank_account",
"bank_account":{
"name":"Gaurav Kumar",
"account_number":"11214311215411",
"ifsc":"HDFC0000053",
"bank_name":"HDFC Bank"
},
"active":true,
"created_at":1543650891
"entity": "collection",
"count": 2,
"items": [
{
"id": "fa_JcXaLomo4ck5IY",
"entity": "fund_account",
"customer_id": "cust_JZse2vlC5nK9AQ",
"account_type": "bank_account",
"bank_account": {
"ifsc": "HDFC0000053",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"notes": [],
"account_number": "11214311215411"
},
"batch_id": null,
"active": true,
"created_at": 1654154246
},
{
"id": "fa_JcXYtecLkhW74k",
"entity": "fund_account",
"customer_id": "cust_JZse2vlC5nK9AQ",
"account_type": "bank_account",
"bank_account": {
"ifsc": "HDFC0000053",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"notes": [],
"account_number": "11214311215411"
},
"batch_id": null,
"active": true,
"created_at": 1654154163
}
]
}
```
-------------------------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 912da6a

Please sign in to comment.