Update/Overhaul Connected Account
patch
https://api2.ourpass.co/v1/api/subaccounts/:subaccountId
This helps you update any of the data required to operate a subaccount
cURL
Node.js
PHP
Ruby
Python
1
curl --location --request PATCH 'https://api2.ourpass.co/v1/api/subaccounts/1295' \
2
--data-raw '{
3
"subAccountEmail": "[email protected]",
4
"txCap": 1000,
5
"txPercentage": 10,
6
"userMobile": "Hello",
7
"businessName": "Hello",
8
"bankName": "test",
9
"bankCode": "Hello",
10
"accountNumber": "Hello",
11
"accountName": "Hello",
12
"lastName": "true",
13
"firstName": "true"
14
}'
Copied!
1
var axios = require('axios');
2
var data = '{\n "subAccountEmail": "[email protected]",\n "txCap": 1000,\n "txPercentage": 10,\n "userMobile": "Hello",\n "businessName": "Hello",\n "bankName": "test",\n "bankCode": "Hello",\n "accountNumber": "Hello",\n "accountName": "Hello",\n "lastName": "true",\n "firstName": "true"\n}';
3
4
var config = {
5
method: 'patch',
6
url: 'https://api2.ourpass.co/v1/api/subaccounts/1295',
7
headers: { },
8
data : data
9
};
10
11
axios(config)
12
.then(function (response) {
13
console.log(JSON.stringify(response.data));
14
})
15
.catch(function (error) {
16
console.log(error);
17
});
18
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api2.ourpass.co/v1/api/subaccounts/1295');
5
$request->setMethod('PATCH');
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setBody('{\n "subAccountEmail": "[email protected]",\n "txCap": 1000,\n "txPercentage": 10,\n "userMobile": "Hello",\n "businessName": "Hello",\n "bankName": "test",\n "bankCode": "Hello",\n "accountNumber": "Hello",\n "accountName": "Hello",\n "lastName": "true",\n "firstName": "true"\n}');
10
try {
11
$response = $request->send();
12
if ($response->getStatus() == 200) {
13
echo $response->getBody();
14
}
15
else {
16
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
17
$response->getReasonPhrase();
18
}
19
}
20
catch(HTTP_Request2_Exception $e) {
21
echo 'Error: ' . $e->getMessage();
22
}
Copied!
1
require "uri"
2
require "net/http"
3
4
url = URI("https://api2.ourpass.co/v1/api/subaccounts/1295")
5
6
https = Net::HTTP.new(url.host, url.port)
7
https.use_ssl = true
8
9
request = Net::HTTP::Patch.new(url)
10
request.body = "{\n \"subAccountEmail\": \"[email protected]\",\n \"txCap\": 1000,\n \"txPercentage\": 10,\n \"userMobile\": \"Hello\",\n \"businessName\": \"Hello\",\n \"bankName\": \"test\",\n \"bankCode\": \"Hello\",\n \"accountNumber\": \"Hello\",\n \"accountName\": \"Hello\",\n \"lastName\": \"true\",\n \"firstName\": \"true\"\n}"
11
12
response = https.request(request)
13
puts response.read_body
14
Copied!
1
import requests
2
3
url = "https://api2.ourpass.co/v1/api/subaccounts/1295"
4
5
payload = "{\n \"subAccountEmail\": \"[email protected]\",\n \"txCap\": 1000,\n \"txPercentage\": 10,\n \"userMobile\": \"Hello\",\n \"businessName\": \"Hello\",\n \"bankName\": \"test\",\n \"bankCode\": \"Hello\",\n \"accountNumber\": \"Hello\",\n \"accountName\": \"Hello\",\n \"lastName\": \"true\",\n \"firstName\": \"true\"\n}"
6
headers = {}
7
8
response = requests.request("PATCH", url, headers=headers, data=payload)
9
10
print(response.text)
11
Copied!