API Test Keys

Create Transfers From Orders

POST
/v1/orders

Click to copy

Use this endpoint to set up transfer of funds while creating an order. This can be done by passing the transfers parameters as part of the request body.

  • You cannot create transfers on orders which has the partial_payment parameter enabled. Ensure that this parameter is set to 0.
  • You cannot create transfers on orders for international currencies. Currently, this feature only supports orders created using INR.

Is this page helpful?

Curl

change language

change language

1
curl -X POST https://api.razorpay.com/v1/orders \
2
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
3
-H 'content-type: application/json'
4
-d '{
5
"amount": 2000,
6
"currency": "INR",
7
"transfers": [
8
{
9
"account": "acc_IRQWUleX4BqvYn",
10
"amount": 1000,
11
"currency": "INR",
12
"notes": {
13
"branch": "Acme Corp Bangalore North",
14
"name": "Gaurav Kumar"
15
},
16
"linked_account_notes": [
17
"branch"
18
],
19
"on_hold": 1,
20
"on_hold_until": 1671222870
21
},
22
{
23
"account": "acc_IROu8Nod6PXPtZ",
24
"amount": 1000,
25
"currency": "INR",
26
"notes": {
27
"branch": "Acme Corp Bangalore South",
28
"name": "Saurav Kumar"
29
},
30
"linked_account_notes": [
31
"branch"
32
],
33
"on_hold": 0
34
}
35
]
36
}'

Success

Failure

1
{
2
"id": "order_JJCYnu3hipocHz",
3
"entity": "order",
4
"amount": 2000,
5
"amount_paid": 0,
6
"amount_due": 2000,
7
"currency": "INR",
8
"receipt": null,
9
"offer_id": null,
10
"offers": {
11
"entity": "collection",
12
"count": 0,
13
"items": []
14
},
15
"status": "created",
16
"attempts": 0,
17
"notes": [],
18
"created_at": 1649931742,
19
"transfers": [
20
{
21
"id": "trf_JJCYnw77tqUT9r",
22
"entity": "transfer",
23
"status": "created",
24
"source": "order_JJCYnu3hipocHz",
25
"recipient": "acc_IRQWUleX4BqvYn",
26
"amount": 1000,
27
"currency": "INR",
28
"amount_reversed": 0,
29
"notes": {
30
"branch": "Acme Corp Bangalore North",
31
"name": "Gaurav Kumar"
32
},
33
"linked_account_notes": [
34
"branch"
35
],
36
"on_hold": true,
37
"on_hold_until": 1671222870,
38
"recipient_settlement_id": null,
39
"created_at": 1649931742,
40
"processed_at": null,
41
"error": {
42
"code": null,
43
"description": null,
44
"reason": null,
45
"field": null,
46
"step": null,
47
"id": "trf_JJCYnw77tqUT9r",
48
"source": null,
49
"metadata": null
50
}
51
},
52
{
53
"id": "trf_JJCYnxe5GV19Kk",
54
"entity": "transfer",
55
"status": "created",
56
"source": "order_JJCYnu3hipocHz",
57
"recipient": "acc_IROu8Nod6PXPtZ",
58
"amount": 1000,
59
"currency": "INR",
60
"amount_reversed": 0,
61
"notes": {
62
"branch": "Acme Corp Bangalore South",
63
"name": "Saurav Kumar"
64
},
65
"linked_account_notes": [
66
"branch"
67
],
68
"on_hold": false,
69
"on_hold_until": null,
70
"recipient_settlement_id": null,
71
"created_at": 1649931742,
72
"processed_at": null,
73
"error": {
74
"code": null,
75
"description": null,
76
"reason": null,
77
"field": null,
78
"step": null,
79
"id": "trf_JJCYnxe5GV19Kk",
80
"source": null,
81
"metadata": null
82
}
83
}
84
]
85
}
Request Parameters
amount

*

integer

The transaction amount, in paise. For example, for an amount of ₹299.35, the value of this field should be 29935.

currency

*

string

The currency in which the transaction should be made. We support only INR for Route transactions.

receipt
string

Unique identifier that you can use for internal reference.

transfers
array

Details regarding the transfer.

Show child parameters (7)

Response Parameters
id
string

Unique identifier of the order created.

entity
string

The name of the entity. Here, it is order.

amount
integer

The order amount, in paise. For example, for an amount of ₹299.35, the value of this field should be 29935.

amount_paid
integer

The amount paid against the order.

amount_due
integer

The amount pending against the order.

currency
string

The currency in which the order should be created. We support only INR for Route transactions.

receipt
string

Unique identifier that you can use for internal reference.

status
string

The status of the order. Possible values:

  • created
  • attempted
  • paid

notes
json object

Set of key-value pairs that can be associated with an entity. These pairs can be useful for storing additional information about the entity. A maximum of 15 key-value pairs, each of 256 characters (maximum), are supported.

created_at
integer

Timestamp in Unix. This indicates the time of the order created.

transfers
array

Details regarding the transfer.

Show child parameters (11)

Errors

The api key/secret provided is invalid

Error Status: 4xx

This error occurs when there is a mismatch between the API credentials passed in the API call and the API credentials generated on the dashboard.

Solution

The amount must be atleast INR 1.00

Error Status: 400

This error occurs when the amount is less than the minimum amount. The transaction amount expressed in the currency subunit, such as paise (in INR) should always be greater than or equal to 100.

Solution

The input field is required

Error Status: 400

This error occurs when a mandatory field is empty.

Solution

The currency should be INR for transfers

Error Status: 400

This error occurs when the currency is anything other than INR.

Solution

Keys sent in linked_account_notes must exist in notes

Error Status: 400

This error occurs when there is a mismatch between the key passed in the linked_account_notes array and the key from the notes object.

Solution

on_hold_until must be between 946684800 and 4765046400

Error Status: 400

This error occurs when the time stamp provided for the on_hold_until entity is not correct or if it is not between 946684800 and 4765046400.

Solution

input is an invalid account_code.

Error Status: 400

This error occurs when the account_code passed is invalid or does not belong to the requested merchant.

Solution

Transfer cannot be made due to insufficient balance

Error Status: 400

This error occurs when the total balance is less than or equal to the transfer amount.

Solution

The sum of amount requested for transfer is greater than the captured amount

Error Status: 400

This error occurs when the total transferred amount exceeds the captured payment amount.

Solution

Create Transfers From Orders

POST
/v1/orders

Click to copy

Use this endpoint to set up transfer of funds while creating an order. This can be done by passing the transfers parameters as part of the request body.

  • You cannot create transfers on orders which has the partial_payment parameter enabled. Ensure that this parameter is set to 0.
  • You cannot create transfers on orders for international currencies. Currently, this feature only supports orders created using INR.

Is this page helpful?

Request Parameters
amount

*

integer

The transaction amount, in paise. For example, for an amount of ₹299.35, the value of this field should be 29935.

currency

*

string

The currency in which the transaction should be made. We support only INR for Route transactions.

receipt
string

Unique identifier that you can use for internal reference.

transfers
array

Details regarding the transfer.

Show child parameters (7)

Response Parameters
id
string

Unique identifier of the order created.

entity
string

The name of the entity. Here, it is order.

amount
integer

The order amount, in paise. For example, for an amount of ₹299.35, the value of this field should be 29935.

amount_paid
integer

The amount paid against the order.

amount_due
integer

The amount pending against the order.

currency
string

The currency in which the order should be created. We support only INR for Route transactions.

receipt
string

Unique identifier that you can use for internal reference.

status
string

The status of the order. Possible values:

  • created
  • attempted
  • paid

notes
json object

Set of key-value pairs that can be associated with an entity. These pairs can be useful for storing additional information about the entity. A maximum of 15 key-value pairs, each of 256 characters (maximum), are supported.

created_at
integer

Timestamp in Unix. This indicates the time of the order created.

transfers
array

Details regarding the transfer.

Show child parameters (11)

Errors

The api key/secret provided is invalid

Error Status: 4xx

This error occurs when there is a mismatch between the API credentials passed in the API call and the API credentials generated on the dashboard.

Solution

The amount must be atleast INR 1.00

Error Status: 400

This error occurs when the amount is less than the minimum amount. The transaction amount expressed in the currency subunit, such as paise (in INR) should always be greater than or equal to 100.

Solution

The input field is required

Error Status: 400

This error occurs when a mandatory field is empty.

Solution

The currency should be INR for transfers

Error Status: 400

This error occurs when the currency is anything other than INR.

Solution

Keys sent in linked_account_notes must exist in notes

Error Status: 400

This error occurs when there is a mismatch between the key passed in the linked_account_notes array and the key from the notes object.

Solution

on_hold_until must be between 946684800 and 4765046400

Error Status: 400

This error occurs when the time stamp provided for the on_hold_until entity is not correct or if it is not between 946684800 and 4765046400.

Solution

input is an invalid account_code.

Error Status: 400

This error occurs when the account_code passed is invalid or does not belong to the requested merchant.

Solution

Transfer cannot be made due to insufficient balance

Error Status: 400

This error occurs when the total balance is less than or equal to the transfer amount.

Solution

The sum of amount requested for transfer is greater than the captured amount

Error Status: 400

This error occurs when the total transferred amount exceeds the captured payment amount.

Solution

Curl

change language

change language

1
curl -X POST https://api.razorpay.com/v1/orders \
2
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
3
-H 'content-type: application/json'
4
-d '{
5
"amount": 2000,
6
"currency": "INR",
7
"transfers": [
8
{
9
"account": "acc_IRQWUleX4BqvYn",
10
"amount": 1000,
11
"currency": "INR",
12
"notes": {
13
"branch": "Acme Corp Bangalore North",
14
"name": "Gaurav Kumar"
15
},
16
"linked_account_notes": [
17
"branch"
18
],
19
"on_hold": 1,
20
"on_hold_until": 1671222870
21
},
22
{
23
"account": "acc_IROu8Nod6PXPtZ",
24
"amount": 1000,
25
"currency": "INR",
26
"notes": {
27
"branch": "Acme Corp Bangalore South",
28
"name": "Saurav Kumar"
29
},
30
"linked_account_notes": [
31
"branch"
32
],
33
"on_hold": 0
34
}
35
]
36
}'

Success

Failure

1
{
2
"id": "order_JJCYnu3hipocHz",
3
"entity": "order",
4
"amount": 2000,
5
"amount_paid": 0,
6
"amount_due": 2000,
7
"currency": "INR",
8
"receipt": null,
9
"offer_id": null,
10
"offers": {
11
"entity": "collection",
12
"count": 0,
13
"items": []
14
},
15
"status": "created",
16
"attempts": 0,
17
"notes": [],
18
"created_at": 1649931742,
19
"transfers": [
20
{
21
"id": "trf_JJCYnw77tqUT9r",
22
"entity": "transfer",
23
"status": "created",
24
"source": "order_JJCYnu3hipocHz",
25
"recipient": "acc_IRQWUleX4BqvYn",
26
"amount": 1000,
27
"currency": "INR",
28
"amount_reversed": 0,
29
"notes": {
30
"branch": "Acme Corp Bangalore North",
31
"name": "Gaurav Kumar"
32
},
33
"linked_account_notes": [
34
"branch"
35
],
36
"on_hold": true,
37
"on_hold_until": 1671222870,
38
"recipient_settlement_id": null,
39
"created_at": 1649931742,
40
"processed_at": null,
41
"error": {
42
"code": null,
43
"description": null,
44
"reason": null,
45
"field": null,
46
"step": null,
47
"id": "trf_JJCYnw77tqUT9r",
48
"source": null,
49
"metadata": null
50
}
51
},
52
{
53
"id": "trf_JJCYnxe5GV19Kk",
54
"entity": "transfer",
55
"status": "created",
56
"source": "order_JJCYnu3hipocHz",
57
"recipient": "acc_IROu8Nod6PXPtZ",
58
"amount": 1000,
59
"currency": "INR",
60
"amount_reversed": 0,
61
"notes": {
62
"branch": "Acme Corp Bangalore South",
63
"name": "Saurav Kumar"
64
},
65
"linked_account_notes": [
66
"branch"
67
],
68
"on_hold": false,
69
"on_hold_until": null,
70
"recipient_settlement_id": null,
71
"created_at": 1649931742,
72
"processed_at": null,
73
"error": {
74
"code": null,
75
"description": null,
76
"reason": null,
77
"field": null,
78
"step": null,
79
"id": "trf_JJCYnxe5GV19Kk",
80
"source": null,
81
"metadata": null
82
}
83
}
84
]
85
}