Accepting Payments with Connected Accounts
You can accept payments by specifying the ID and authorisation key at the point of accepting payments.
get
https://api2.ourpass.co/v1/api/subaccounts/:subaccountId
Accepting payments using connected account
cURL
Node.js
PHP
Ruby
Python
1
curl --location --request GET 'https://api2.ourpass.co/v1/api/subaccounts/373' \
2
--data-raw '{
3
"subaccountId": 374
4
}'
Copied!
1
var axios = require('axios');
2
var data = '{\n "subaccountId": 374\n}';
3
4
var config = {
5
method: 'get',
6
url: 'https://api2.ourpass.co/v1/api/subaccounts/373',
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/373');
5
$request->setMethod(HTTP_Request2::METHOD_GET);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setBody('{\n "subaccountId": 374\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/373")
5
6
http = Net::HTTP.new(url.host, url.port);
7
request = Net::HTTP::Get.new(url)
8
request.body = "{\n \"subaccountId\": 374\n}"
9
10
response = http.request(request)
11
puts response.read_body
12
Copied!
1
import requests
2
3
url = "https://api2.ourpass.co/v1/api/subaccounts/373"
4
5
payload = "{\n \"subaccountId\": 374\n}"
6
headers = {}
7
8
response = requests.request("GET", url, headers=headers, data=payload)
9
10
print(response.text)
11
Copied!