Skip to main content
PUT
/
api
/
billing
/
coworkerbookingcredits
{
  "Status": 123,
  "Message": "<string>",
  "Value": "<any>",
  "WasSuccessful": true,
  "Errors": [
    {
      "AttemptedValue": "<any>",
      "Message": "<string>",
      "PropertyName": "<string>"
    }
  ]
}
Updates an existing CoworkerBookingCredit record. You must include the Id of the record to update along with all required fields.

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 CoworkerBookingCredit-Edit role.

Request Body

Required Fields

Id
integer
required
The Id of the CoworkerBookingCredit record to update.
CoworkerId
integer
required
ID of the customer this credit is assigned to.
BusinessId
integer
required
ID of the location issuing the credit.
TotalCredit
number
required
Total credit amount originally assigned.

Optional Fields

Description
string
Optional description or label for this credit.
ElegibleResourceTypes
integer[]
Resource types this credit can be used for. If empty, the credit is valid for all resource types.
AddedElegibleResourceTypes
integer[]
Resource type IDs to add to ElegibleResourceTypes.
RemovedElegibleResourceTypes
integer[]
Resource type IDs to remove from ElegibleResourceTypes.
ElegibleProducts
integer[]
Products this credit can be used for. If empty, applies to all products.
AddedElegibleProducts
integer[]
Product IDs to add to ElegibleProducts.
RemovedElegibleProducts
integer[]
Product IDs to remove from ElegibleProducts.
ElegibleTariffs
integer[]
Plans (tariffs) this credit is restricted to. If empty, applies to customers on any plan.
AddedElegibleTariffs
integer[]
Plan IDs to add to ElegibleTariffs.
RemovedElegibleTariffs
integer[]
Plan IDs to remove from ElegibleTariffs.
ValidFrom
string
Date from which this credit is valid.
ExpireDate
string
Date on which this credit expires.
CaneBeUsedForBookings
boolean
Whether this credit can be used to pay for bookings. Restrict to specific resource types with ElegibleResourceTypes.
CaneBeUsedForEvents
boolean
Whether this credit can be used to pay for event sign-ups. Restrict to specific categories with EventCategories.
EventCategories
integer[]
Event categories this credit can be used for. If empty, applies to all event categories.
AddedEventCategories
integer[]
Event category IDs to add to EventCategories.
RemovedEventCategories
integer[]
Event category IDs to remove from EventCategories.
IsUniversalCredit
boolean
Whether this is a universal credit applicable to products, time passes and other charges. Restrict with ElegibleProducts, ElegiblePasses and AppliesToCharges; if all are empty the credit applies to all products, passes and charges.
UseCreditPrice
boolean
Whether to use the credit price instead of the standard booking price when this credit is applied.
CoworkerContractUniqueId
string
Unique ID of the contract that originated this credit.
ElegiblePasses
integer[]
Time passes this credit can be used for. If empty, applies to all passes.
AddedElegiblePasses
integer[]
Pass IDs to add to ElegiblePasses.
RemovedElegiblePasses
integer[]
Pass IDs to remove from ElegiblePasses.
AppliesToCharges
boolean
Whether this universal credit applies to other charges.

Code Examples

curl -X PUT \
  "https://spaces.nexudus.com/api/billing/coworkerbookingcredits" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "CoworkerId": 0,
    "BusinessId": 0,
    "TotalCredit": 0,
    "Id": 87654321
}'

Response

200

Status
integer
HTTP status code. 200 on success.
Message
string
A human-readable message confirming the update.
Value
object
Contains the Id of the updated record.
WasSuccessful
boolean
true if the coworkerbookingcredit was updated successfully.
Errors
array
null on success.
Example Response
{
  "Status": 200,
  "Message": "CoworkerBookingCredit was successfully updated.",
  "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": "RemainingCredit: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "RemainingCredit"
    }
  ],
  "WasSuccessful": false
}