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[attributes][invoice-period-id] Invoice period id
data[attributes][timezone] Timezone
data[relationships][contractor] Contractor
data[relationships][invoice-template] Invoice template

Request

Headers

Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOjE5LCJhdWQiOlsiYWRtaW4iXSwiZXhwIjoxNzY3MzU4NTYwfQ.Uf9EiarQqw5fB7QC5X0M_yyu1GsQ2lX7kh8WiKaWtBA
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],"timezone":"Europe/Kyiv"},"relationships":{"contractor":{"data":{"type":"contractors","id":4}}}}}

Response

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/vnd.api+json
location: http://example.org/api/rest/admin/accounts/23
vary: Accept
etag: W/"8dde65831a28012f5f26139623a2c415"
cache-control: max-age=0, private, must-revalidate
x-request-id: ba4f83b9-dddb-4e50-b7d8-6b617aaf7c80
x-runtime: 0.018928
content-length: 1005

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": "fd868b74-e7d8-11f0-bf40-0a63caf27539",
      "origination-capacity": 100,
      "termination-capacity": 110,
      "total-capacity": 100,
      "send-invoices-to": null,
      "invoice-period-id": null,
      "timezone": "Europe/Kyiv"
    },
    "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"
        }
      },
      "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
      }
    }
  }
}