Accounts API

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

Version: HTTP/1.0
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MzE1Nzg3NDYsInN1YiI6MTR9.u22tLIwFFAGJh9qE5pJQjnzeSt5hXVoQmR3n_cqQH_8
Host: example.org
Cookie: 

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

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/vnd.api+json
Vary: Accept
ETag: W/"1fcb62c544b838762b299d35135550d6"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 5074365e-ddbd-4d5b-bc34-90ae80161dca
X-Runtime: 0.098799
Content-Length: 1148

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
      }
    }
  }
}