Charges

Charges (Enterprise) #

When a request is made via the API that may incur any additional charges, this will return with a HTTP status response of:

402 Payment Required

The request will not have been actioned. In order to action this an identical request should be made with an additional header value of:

accept-charges: true

Example #

This request will attempt to create a new Customer with the following details without accepting charges:

  • Name: "New customer"
  • Description: "This is my new customer"
  • Enabled: false
  • TimeZone : "America/Los_Angeles",
  • Culture: "en-US"
  • PbxConnectionProfile
    • Crossbar Rest Api: "https://hostrest"
    • Blackhole Websocket Api: "wss//:hostwebsocket"
    • ~.pbx.kazoo.name.~ AccountId: "accountid"
    • ~.pbx.kazoo.name.~ Api Key: "apikey"

Request #

POST /api/v1.0/customers HTTP/1.1
Content-Type: application/json
Authorization: Bearer {TOKEN}
Connection: keep-alive
{
	"name": "New customer",
	"description": "This is my new customer",
	"enabled": false,
	"timezone": "America/Los_Angeles",
	"culture": "en-US",
	"pbxConnectionProfile": {
		"_type": "KazooPbxConnectionProfile",
		"hostRest": "http://hostrest",
		"hostWebsocket": "wss//:hostwebsokcet",
		"accountId": "accountid",
		"apiKey": "apikey"
	}
}

Response #

HTTP/1.1 402 Payment Required
Content-Type: application/json; charset=utf-8
Content-Length: xx
{
	"name": "New customer",
	"description": "This is my new customer",
	"enabled": false,
	"timezone": "America/Los_Angeles",
	"culture": "en-US",
	"pbxConnectionProfile": {
		"_type": "KazooPbxConnectionProfile",
		"hostRest": "http://hostrest",
		"hostWebsocket": "wss//:hostwebsokcet",
		"accountId": "accountid",
		"apiKey": "apikey"
	}
}