Subaccounts The Octane Subaccounts API allows you to manage and retrieve information about subaccounts associated with your master account.
Subaccounts are a way to create and manage user accounts under a master account. They can be interacted with using the master account's API key.
Subaccount:
A subaccount is specified via the userId
field in the request body or request query, serving as another part of the apiKey.
The master account can interact with subaccount payment methods and transactions.
The master account cannot interact with subaccounts of a subaccount.
Each subaccount can only have one master account.
Subaccounts API Endpoints
Post Subaccount
POST
https://api.abyiss.com/v2/octane/subaccounts
Returns a 201 status code upon successful query. Then returns the successful account created.
Request Body
Name Type Description User name including first and last name.
201: Created Success 401: Unauthorized Unauthorized -- Invalid API Key
Copy {
"newSubAccountId" : "usr-123456790"
}
Copy {
"Unauthorized" : "Invaild API Key"
}
Get Subaccounts
GET
https://api.abyiss.com/v2/octane/subaccounts
Returns an array of all the accounts for an associated apiKey
.
200: OK Success 401: Unauthorized Unauthorized -- Invalid API Key
Copy [{
"id" : "usr-123456790" ,
"email" : "test@account.com" ,
"name" : "subAccountName" ,
"createdAt" : "2023-12-10T00:46:14.786" ,
"updatedAt" : "2023-12-10T00:46:14.783"
} , {
"id" : "usr-123457800" ,
"email" : "zeekdonuts@gmail.com" ,
"name" : "Zeek Zubert" ,
"createdAt" : "2023-12-10T02:18:32.022" ,
"updatedAt" : "2023-12-10T02:18:32.018"
}]
Copy {
"Unauthorized" : "Invaild API Key"
}
Get Subaccount by ID
GET
https://api.abyiss.com/v2/octane/subaccounts/{accountId}
Returns an object for the accountId
for an associated apiKey
.
Query Parameters
200: OK Success 401: Unauthorized Unauthorized -- Invalid API Key
Copy {
"id" : "usr-123456790" ,
"email" : "test@account.com" ,
"name" : "subAccountName" ,
"createdAt" : "2023-12-10T00:46:14.786" ,
"updatedAt" : "2023-12-10T00:46:14.783"
}
Copy {
"Unauthorized" : "Invaild API Key"
}
Copy & Paste Code
POST Subaccounts
Curl Python JavaScript
Copy curl -X POST \
-H "Content-Type: application/json" \
-d '{
"api-key": "dev-api-key",
"subAccount": {
"name": "Zeek Zubert",
"email": "zeekdonuts@gmail.com"
}
}' \
https://api.abyiss.com/v2/octane/subaccounts
Copy import requests
import json
url = "https://api.abyiss.com/v2/octane/subaccounts"
headers = {
"Content-Type" : "application/json"
}
subaccount_data = {
"api-key" : "dev-api-key" ,
"subAccount" : {
"name" : "Zeek Zubert" ,
"email" : "zeekdonuts@gmail.com"
}
}
response = requests . post (url, headers = headers, data = json. dumps (subaccount_data))
print (response.status_code)
print (response. json ())
Copy const axios = require ( 'axios' );
const url = 'https://api.abyiss.com/v2/octane/subaccounts' ;
const headers = {
'Content-Type' : 'application/json'
};
const subaccountData = {
'api-key' : 'dev-api-key' ,
'subAccount' : {
'name' : 'Zeek Zubert' ,
'email' : 'zeekdonuts@gmail.com'
}
};
axios .post (url , subaccountData , { headers })
.then (response => {
console .log ( response .status);
console .log ( response .data);
})
.catch (error => {
console .error ( error . response .status);
console .error ( error . response .data);
});
GET Subaccounts
Curl Python JavaScript
Copy curl "https://api.abyiss.com/v2/octane/subaccounts?apiKey=YOUR_API_KEY_HERE"
Copy import requests
url = 'https://api.abyiss.com/v2/octane/subaccounts?apiKey=YOUR_API_KEY_HERE'
response = requests . get (url)
print (response.status_code) # This will print the status code of the response
print (response. json ()) # This will print the response content as JSON
Copy const url = 'https://api.abyiss.com/v2/octane/subaccounts?apiKey=YOUR_API_KEY_HERE' ;
fetch (url)
.then (response => {
if ( ! response .ok) {
throw new Error ( 'Network response was not ok' );
}
return response .json ();
})
.then (data => {
console .log (data); // Handle the response data
})
.catch (error => {
console .error ( 'There has been a problem with your fetch operation:' , error);
});
Subaccounts Response Object
POST Subaccounts Get Subaccounts Get Subaccount by Id
Example URL: https://api.abyiss.com/v2/octane/subaccounts?apiKey=
Copy [{
"id" : "usr-123456790" ,
"email" : "test@account.com" ,
"name" : "subAccountName" ,
"createdAt" : "2023-12-10T00:46:14.786" ,
"updatedAt" : "2023-12-10T00:46:14.783"
} , {
"id" : "usr-123457800" ,
"email" : "zeekdonuts@gmail.com" ,
"name" : "Zeek Zubert" ,
"createdAt" : "2023-12-10T02:18:32.022" ,
"updatedAt" : "2023-12-10T02:18:32.018"
}]
Subaccounts Response Attributes
Attribute Name Data Type Description User first and last name.
The timestamp the user account was created.
The last timestamp the user account was updated at.
Last updated 4 months ago