create new entry
POST /api/rest/admin/accounts
Parameters
Name |
Description |
data[type]
|
Resource type (accounts)
|
data[attributes][name]
|
Name
|
data[attributes][min-balance]
|
Min balance
|
data[attributes][max-balance]
|
Max balance
|
data[attributes][vat]
|
Vat
|
data[attributes][origination-capacity]
|
Origination capacity
|
data[attributes][termination-capacity]
|
Termination capacity
|
data[attributes][total-capacity]
|
Total capacity
|
data[attributes][send-invoices-to]
|
Send invoices to
|
data[attributes][external-id]
|
External id
|
data[attributes][balance-low-threshold]
|
Balance low threshold
|
data[attributes][balance-high-threshold]
|
Balance high threshold
|
data[attributes][send-balance-notifications-to]
|
Send balance notifications to
|
data[relationships][contractor]
|
Contractor
|
data[relationships][timezone]
|
Timezone
|
data[relationships][customer-invoice-period]
|
Customer invoice period
|
data[relationships][vendor-invoice-period]
|
Vendor invoice period
|
data[relationships][customer-invoice-template]
|
Customer invoice template
|
data[relationships][vendor-invoice-template]
|
Vendor invoice template
|
Request
Headers
Route
POST /api/rest/admin/accounts
Body
{"data":{"type":"accounts","attributes":{"name":"name","min-balance":1,"max-balance":10,"vat":11,"origination-capacity":100,"termination-capacity":110,"total-capacity":100,"balance-low-threshold":90,"balance-high-threshold":95,"send-balance-notifications-to":[1]},"relationships":{"contractor":{"data":{"type":"contractors","id":4}},"timezone":{"data":{"type":"timezones","id":1}}}}}
Response
Headers
Status
201 Created
Body
{
"data": {
"id": "23",
"type": "accounts",
"links": {
"self": "http://example.org/api/rest/admin/accounts/23"
},
"attributes": {
"name": "name",
"balance": "0.0",
"min-balance": "1.0",
"max-balance": "10.0",
"vat": "11.0",
"balance-low-threshold": "90.0",
"balance-high-threshold": "95.0",
"send-balance-notifications-to": [
1
],
"destination-rate-limit": null,
"max-call-duration": null,
"external-id": null,
"uuid": null,
"origination-capacity": 100,
"termination-capacity": 110,
"total-capacity": 100,
"send-invoices-to": null,
"invoice-period": null
},
"relationships": {
"contractor": {
"links": {
"self": "http://example.org/api/rest/admin/accounts/23/relationships/contractor",
"related": "http://example.org/api/rest/admin/accounts/23/contractor"
},
"data": {
"type": "contractors",
"id": "4"
}
},
"timezone": {
"links": {
"self": "http://example.org/api/rest/admin/accounts/23/relationships/timezone",
"related": "http://example.org/api/rest/admin/accounts/23/timezone"
},
"data": {
"type": "timezones",
"id": "1"
}
},
"invoice-template": {
"links": {
"self": "http://example.org/api/rest/admin/accounts/23/relationships/invoice-template",
"related": "http://example.org/api/rest/admin/accounts/23/invoice-template"
},
"data": null
}
}
}
}