Charges
Create Charge
Create a new Charge record.
POST
Create Charge
A charge (internal name CoworkerCharge) is a one-off debit billed to a customer at a location. It records the item, quantity, amount, optional tax, discount, credit, and invoicing timing; a recurring charge is eligible only when the customer’s main contract is due for renewal.
Authentication
This endpoint requires OAuth2 authentication. Include a valid bearer token in the
Authorization header.
The authenticated user must be a full unrestricted administrator or have the Charge-Create role.Request Body
Required Fields
integer
required
ID of the customer billed for this charge; the customer’s invoicing location controls access..
integer
required
ID of the location that issued this charge and whose currency applies..
integer
required
Number of units billed by this charge; defaults to 1..
number
required
Internal monetary discount amount; charge creation uses the system default and this field is not exposed to the agent..
number
required
Internal monetary credit amount; charge creation uses the system default and this field is not exposed to the agent..
number
required
Total monetary amount charged to the customer..
Optional Fields
string
Description of the billed item or service..
string
Optional customer-facing text to display for the resulting invoice line instead of Description..
boolean
Whether this recurring charge is invoiced only when the customer has a main contract due for renewal..
string
Optional UTC date and time before which this charge is not eligible to be invoiced..
string
Optional purchase-order reference used for invoice grouping and billing..
integer
Optional ID of the tax rate applied to this charge; required when the issuing location requires tax rates..
integer
Optional ID of the financial account that categorises this charge; required when the issuing location requires financial accounts..
boolean
Whether this charge has been added to an invoice; changing an invoiced charge is blocked for locked periods and its amount cannot change after payment..
string
Optional UTC date and time when the underlying sale occurred..
boolean
Internal flag for team-member charges; it bypasses the normal tax-rate and financial-account validation and must not be set by the agent..
string
System-maintained display name of the customer time credit associated with this charge..
string
System-maintained display name of the customer pass associated with this charge..
string
System-maintained display name of the customer product sale associated with this charge..
string
System-maintained name of the plan associated with this charge..
string
System-maintained GUID of the customer product sale that generated this charge, when applicable..
string
System-maintained GUID of the booking that generated this charge, when applicable..
string
Optional UTC date and time from which this recurring charge may be invoiced..
string
Optional UTC date and time after which this recurring charge must stop being invoiced..
Code Examples
Response
200
integer
HTTP status code.
200 on success.string
A human-readable message confirming the creation.
object
Contains the
Id of the newly created record.boolean
true if the charge was created successfully.array
null on success.Example Response
400
string
A summary of the validation error(s), in the format
PropertyName: error message.any
null on validation failure.object[]
Array of validation errors.
boolean
false when the request fails validation.Example Response