Services API

create new entry

POST /api/rest/admin/billing/services

Parameters

Name Description
data[type] Resource type (services)
data[attributes][name] Name
data[attributes][initial-price] Initial price
data[attributes][renew-price] Renew price
data[attributes][renew-at] Renew at
data[attributes][renew-period] Renew period
data[attributes][variables] Variables
data[relationships][account] Account
data[relationships][service-type] Service type

Request

Headers

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

Route

POST /api/rest/admin/billing/services

Body

{"data":{"type":"services","attributes":{"name":"name","initial-price":1.23,"renew-price":3.24},"relationships":{"account":{"data":{"type":"accounts","id":"51"}},"service-type":{"data":{"type":"service-types","id":"13"}}}}}

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/"d62e528d971e6c35bba60aec5344ebb8"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 6d11c49c-bc90-4d21-aed1-d4796bc9c9a3
X-Runtime: 0.041808
Content-Length: 966

Status

201 Created

Body

{
  "data": {
    "id": "7",
    "type": "services",
    "links": {
      "self": "http://example.org/api/rest/admin/billing/services/7"
    },
    "attributes": {
      "name": "name",
      "variables": null,
      "state": "Active",
      "initial-price": "1.23",
      "renew-price": "3.24",
      "created-at": "2024-11-14T09:55:50.387Z",
      "renew-at": null,
      "renew-period": "Disabled",
      "uuid": "10d70e12-713f-49e4-94bb-b2a64aeeb165"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/services/7/relationships/account",
          "related": "http://example.org/api/rest/admin/billing/services/7/account"
        },
        "data": {
          "type": "accounts",
          "id": "51"
        }
      },
      "service-type": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/services/7/relationships/service-type",
          "related": "http://example.org/api/rest/admin/billing/services/7/service-type"
        }
      },
      "transactions": {
        "links": {
          "self": "http://example.org/api/rest/admin/billing/services/7/relationships/transactions",
          "related": "http://example.org/api/rest/admin/billing/services/7/transactions"
        }
      }
    }
  }
}