ProductBookingCredits
Create ProductBookingCredit
Create a new ProductBookingCredit record.
POST
Create ProductBookingCredit
A ProductBookingCredit represents an amount of credit linked to a Product. When a customer purchases the product, the credit is automatically released as a CoworkerBookingCredit on the customer’s account.
When is the credit released?
- Admin sale (via CoworkerProduct): An admin can choose to release the credit before payment by setting ActivateNow = true when selling the product.
- Member purchase (online, active contract): Credits are released immediately unless the Store.AlwaysInvoice business setting is enabled, in which case credits release after payment.
- Contact purchase (online, no active contract): Credits are released after the product is paid.
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 ProductBookingCredit-Create role.Enums
eRecurrentChargePattern
eRecurrentChargePattern
Request Body
Required Fields
string
required
Credit name.
integer
required
ID of the product linked to this record.
number
required
Credit amount that will be released to the customer’s account as a CoworkerBookingCredit. Release timing depends on purchase method: admin sales can release before payment (ActivateNow), member purchases release immediately (unless Store.AlwaysInvoice is set), and contact purchases release after payment.
Optional Fields
integer[]
List of eligible resource types this credit can be used for. If empty, the credit is valid for all resource types.
integer[]
List of eligible products this universal credit can be used to purchase. If empty and IsUniversalCredit is true, the credit applies to all products.
integer[]
List of eligible tariffs (plans) this credit is valid for.
integer
Expiration period in months (legacy field, use ExpiresIn with ExpirationType instead).
integer
Expiration period in weeks (legacy field, use ExpiresIn with ExpirationType instead).
boolean
Whether this credit can be used to pay for bookings. Restrict to specific resource types with ElegibleResourceTypes.
boolean
Whether this credit can be used to pay for event sign-ups. Restrict to specific categories with EventCategories.
integer[]
List of event categories this credit is valid for. If empty and CaneBeUsedForEvents is true, the credit is valid for all events.
integer
Expiration type: PricePlan (expires at end of billing period of the main contract - customer must have a main contract), Day, Week, Month, Year, or LastDayOfMonth. See
eRecurrentChargePattern? enum above.integer
Number of periods (of ExpirationType) until the released credit expires.
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.
integer[]
List of eligible time passes this universal credit can be used to purchase. If empty and IsUniversalCredit is true, the credit applies to all passes.
boolean
Whether this universal credit applies to other charges beyond products and passes.
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 productbookingcredit 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