Create virtual account
curl --request POST \
--url https://api.slash.com/virtual-account \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"accountId": "<string>",
"name": "<string>",
"commissionDetails": {
"type": "flatFee",
"amount": {
"amountCents": 123
},
"startDate": "2023-11-07T05:31:56Z"
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
name: '<string>',
commissionDetails: {type: 'flatFee', amount: {amountCents: 123}, startDate: '2023-11-07T05:31:56Z'}
})
};
fetch('https://api.slash.com/virtual-account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.slash.com/virtual-account"
payload = {
"accountId": "<string>",
"name": "<string>",
"commissionDetails": {
"type": "flatFee",
"amount": { "amountCents": 123 },
"startDate": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.slash.com/virtual-account"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"name\": \"<string>\",\n \"commissionDetails\": {\n \"type\": \"flatFee\",\n \"amount\": {\n \"amountCents\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"virtualAccount": {
"id": "<string>",
"name": "<string>",
"accountId": "<string>",
"accountType": "default",
"accountNumber": "<string>",
"routingNumber": "<string>",
"closedAt": "<string>"
},
"commissionRule": {
"id": "<string>",
"virtualAccountId": "<string>",
"commissionDetails": {
"type": "flatFee",
"amount": {
"amountCents": 123
},
"frequency": "monthly",
"startDate": "2023-11-07T05:31:56Z"
}
}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}Authorizations
API key authentication for public API requests.
Keys come in two flavors:
- Legal-entity-scoped keys are pinned to a single legal entity. Minted via the dashboard under a specific entity; every request acts on that entity.
- User-scoped keys are pinned to a user and span every legal
entity that user has access to. Every request made with a
user-scoped key (except
GET /legal-entity, which lists the legal entities the user can access) must include anx-legal-entityheader naming the legal entity the request is operating on. Requests without the header are rejected with400. The authenticated user must have an active permission role on the supplied legal entity, otherwise the request is rejected with403.
Body
The account ID the virtual account should be created under.
The name of the virtual account
Specifies how much of the virtual account's incoming funds should be diverted to the primary account
- VirtualAccountCommissionDetails
- VirtualAccountCommissionDetails
Hide child attributes
Hide child attributes
The type of the commission rule. A type of flat_fee will take a flat fee from the virtual account and transfer it to the primary account with the frequency of the collection defined as monthly or yearly.
flatFee The frequency from the start date that the rule will be applied. E.g. a start date of November 26, 2024 with a frequency of "monthly" will have the rule applied on December 26, 2024. If the frequency was "yearly", the rule would be applied again on November 26, 2025.
monthly, yearly The date that the rule will begin to take effect.
Response
OK
The virtual account object
Hide child attributes
Hide child attributes
The ID of the virtual account.
The name of the virtual account.
The account ID of the Slash account the virtual account is associated with.
The account type of the virtual account. Since virtual accounts and Slash accounts exist at the same hierarchy level, an account type of 'primary' means it is the main Slash account, while an account type of 'default' means it is a virtual account under the main account.
default, primary The account number of the virtual account.
The routing number of the virtual account.
The date the virtual account was closed; will be null if account was never closed.
The virtual account commission rule object
Hide child attributes
Hide child attributes
The ID of the commission rule
The ID of the virtual account the commission rule is applied to
Describes details of the commission rule.
- VirtualAccountCommissionDetails
- VirtualAccountCommissionDetails
Hide child attributes
Hide child attributes
The type of the commission rule. A type of flat_fee will take a flat fee from the virtual account and transfer it to the primary account with the frequency of the collection defined as monthly or yearly.
flatFee The frequency from the start date that the rule will be applied. E.g. a start date of November 26, 2024 with a frequency of "monthly" will have the rule applied on December 26, 2024. If the frequency was "yearly", the rule would be applied again on November 26, 2025.
monthly, yearly The date that the rule will begin to take effect.
curl --request POST \
--url https://api.slash.com/virtual-account \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"accountId": "<string>",
"name": "<string>",
"commissionDetails": {
"type": "flatFee",
"amount": {
"amountCents": 123
},
"startDate": "2023-11-07T05:31:56Z"
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
name: '<string>',
commissionDetails: {type: 'flatFee', amount: {amountCents: 123}, startDate: '2023-11-07T05:31:56Z'}
})
};
fetch('https://api.slash.com/virtual-account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.slash.com/virtual-account"
payload = {
"accountId": "<string>",
"name": "<string>",
"commissionDetails": {
"type": "flatFee",
"amount": { "amountCents": 123 },
"startDate": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.slash.com/virtual-account"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"name\": \"<string>\",\n \"commissionDetails\": {\n \"type\": \"flatFee\",\n \"amount\": {\n \"amountCents\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"virtualAccount": {
"id": "<string>",
"name": "<string>",
"accountId": "<string>",
"accountType": "default",
"accountNumber": "<string>",
"routingNumber": "<string>",
"closedAt": "<string>"
},
"commissionRule": {
"id": "<string>",
"virtualAccountId": "<string>",
"commissionDetails": {
"type": "flatFee",
"amount": {
"amountCents": 123
},
"frequency": "monthly",
"startDate": "2023-11-07T05:31:56Z"
}
}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}{
"message": "<string>",
"name": "<string>",
"identifier": "<string>",
"rawStatus": 123,
"meta": {}
}