Skip to main content
POST
/
api
/
billing
/
coworkerbookingcreditusehistories
{
  "Status": 123,
  "Message": "<string>",
  "Value": "<any>",
  "WasSuccessful": true,
  "Errors": [
    {
      "AttemptedValue": "<any>",
      "Message": "<string>",
      "PropertyName": "<string>"
    }
  ]
}
A CoworkerBookingCreditUseHistory records each time a CoworkerBookingCredit was consumed. Each entry captures the amount of credit deducted and links back to the booking, event attendance, or invoice line that triggered the use. Use the read-only denormalised fields (BookingFromTime, BookingResourceName, EventAttendeeCalendarEventName, etc.) to inspect what the credit was spent on without needing to fetch the related records separately.

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 CoworkerBookingCreditUseHistory-Create role.

Request Body

Required Fields

CoworkerBookingCreditId
integer
required
ID of the booking credit that was consumed.
CreditUsed
number
required
Amount of credit consumed by this entry.

Optional Fields

Description
string
Optional description or note for this credit use entry.
BookingId
integer
ID of the booking this credit was applied to, if the credit was used for a booking.
CoworkerInvoiceLineId
integer
ID of the invoice line this credit was applied to, if the credit was used against an invoice.
EventAttendeeId
integer
ID of the event attendance record this credit was applied to, if the credit was used for an event.

Code Examples

curl -X POST \
  "https://spaces.nexudus.com/api/billing/coworkerbookingcreditusehistories" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "CoworkerBookingCreditId": 0,
    "CreditUsed": 0
}'

Response

200

Status
integer
HTTP status code. 200 on success.
Message
string
A human-readable message confirming the creation.
Value
object
Contains the Id of the newly created record.
WasSuccessful
boolean
true if the coworkerbookingcreditusehistory was created successfully.
Errors
array
null on success.
Example Response
{
  "Status": 200,
  "Message": "CoworkerBookingCreditUseHistory was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}

400

Message
string
A summary of the validation error(s), in the format PropertyName: error message.
Value
any
null on validation failure.
Errors
object[]
Array of validation errors.
WasSuccessful
boolean
false when the request fails validation.
Example Response
{
  "Message": "CreditUsed: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "CreditUsed"
    }
  ],
  "WasSuccessful": false
}