Invoices API

create new entry

POST /api/rest/admin/billing/invoices

Parameters

Name Description
data[type] Resource type (invoices)
data[attributes][start-date] Start date
data[attributes][end-date] End date
data[relationships][account] Account

Request

Headers

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

Route

POST /api/rest/admin/billing/invoices

Body

{"data":{"type":"invoices","attributes":{"start-date":"2024-10-14","end-date":"2024-11-14"},"relationships":{"account":{"data":{"type":"accounts","id":"46"}}}}}

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/"ceab785a126f721ee765bf34a1d9ab8a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 4468084a-cbe0-4663-bffb-61d98ad2af6d
X-Runtime: 0.037328
Content-Length: 2260

Status

201 Created

Body

{
  "data": {
    "id": "19",
    "type": "invoices",
    "links": {
      "self": "http://example.org/api/rest/admin/billing/invoices/19"
    },
    "attributes": {
      "reference": "19",
      "state": "New",
      "invoice-type": "Manual",
      "start-date": "2024-10-14T00:00:00.000Z",
      "end-date": "2024-11-14T00:00:00.000Z",
      "pdf-path": null,
      "odt-path": null,
      "amount-spent": "0.0",
      "amount-earned": "0.0",
      "originated-amount-spent": "0.0",
      "originated-amount-earned": "0.0",
      "originated-calls-count": 0,
      "originated-successful-calls-count": 0,
      "originated-calls-duration": 0,
      "originated-billing-duration": 0,
      "originated-first-call-at": null,
      "originated-last-call-at": null,
      "terminated-amount-spent": "0.0",
      "terminated-amount-earned": "0.0",
      "terminated-calls-count": 0,
      "terminated-successful-calls-count": 0,
      "terminated-calls-duration": 0,
      "terminated-billing-duration": 0,
      "terminated-first-call-at": null,
      "terminated-last-call-at": null,
      "services-amount-spent": "0.0",
      "services-amount-earned": "0.0",
      "service-transactions-count": 0
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/invoices/19/relationships/account",
          "related": "http://example.org/api/rest/admin/billing/invoices/19/account"
        },
        "data": {
          "type": "accounts",
          "id": "46"
        }
      },
      "originated-destinations": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/invoices/19/relationships/originated-destinations",
          "related": "http://example.org/api/rest/admin/billing/invoices/19/originated-destinations"
        }
      },
      "originated-networks": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/invoices/19/relationships/originated-networks",
          "related": "http://example.org/api/rest/admin/billing/invoices/19/originated-networks"
        }
      },
      "terminated-destinations": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/invoices/19/relationships/terminated-destinations",
          "related": "http://example.org/api/rest/admin/billing/invoices/19/terminated-destinations"
        }
      },
      "terminated-networks": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/invoices/19/relationships/terminated-networks",
          "related": "http://example.org/api/rest/admin/billing/invoices/19/terminated-networks"
        }
      },
      "service-data": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/invoices/19/relationships/service-data",
          "related": "http://example.org/api/rest/admin/billing/invoices/19/service-data"
        }
      }
    }
  }
}