Skip to main content
POST
/
api
/
billing
/
tariffbookingcredits
{
  "Status": 123,
  "Message": "<string>",
  "Value": "<any>",
  "WasSuccessful": true,
  "Errors": [
    {
      "AttemptedValue": "<any>",
      "Message": "<string>",
      "PropertyName": "<string>"
    }
  ]
}
A TariffBookingCredit represents an amount of credit linked to a plan (Tariff). When a customer’s contract on that plan renews, the credit is automatically released as a CoworkerBookingCredit on the customer’s account. Credit can be configured for two primary uses:
  • Bookings — set CaneBeUsedForBookings to allow the credit to pay for bookings. Use ElegibleResourceTypes to restrict the credit to specific resource types; if left empty the credit is valid for all resource types.
  • Events — set CaneBeUsedForEvents to allow the credit to pay for event sign-ups. Use EventCategories to restrict to specific event categories; if left empty the credit is valid for all events.
Setting IsUniversalCredit enables the credit for products, time passes, and other charges. Use ElegibleProducts, ElegiblePasses, and AppliesToCharges to restrict which products or passes the credit is valid for. If all restriction lists are empty the universal credit applies to all products, passes and charges. Use ServiceRenewalTime to control how often the credit is renewed (e.g. weekly, monthly).

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

Enums

ValueName
1Week
2CalendarMonth
3TariffMonth
4Year
5Day

Request Body

Required Fields

Name
string
required
Credit name.
TariffId
integer
required
Tariff Id.
Credit
number
required
Credit amount.

Optional Fields

ElegibleResourceTypes
integer[]
Elegible Resource Types.
ElegibleProducts
integer[]
Elegible Products.
ElegibleTariffs
integer[]
Elegible Tariffs.
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.
ServiceRenewalTime
integer
Service renewal time period. See eTimeSpanWeekMonth enum above.
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.
ElegiblePasses
integer[]
Elegible Passes.
AppliesToCharges
boolean
Whether this universal credit applies to other charges.

Code Examples

curl -X POST \
  "https://spaces.nexudus.com/api/billing/tariffbookingcredits" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "Name": "",
    "TariffId": 0,
    "Credit": 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 tariffbookingcredit was created successfully.
Errors
array
null on success.
Example Response
{
  "Status": 200,
  "Message": "TariffBookingCredit 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": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}