v1

latestOpenAPI 3.0.02026-07-24161215397.4 KB
Credits

Update an existing set of credits.

Update an existing set of credits.

Required scopes: flex.space.credits.update

put/api/v2/organizations/{orgSlug}/credits/{creditsId}

Path parameters

creditsIdstring required

Id of the credits.

orgSlugstring required

organization slug

Request body

countnumber

The number of credits granted.

Example request

{
  "count": 5
}

Response

_idstring

The _id of the set of credits.

companystring

The _id of the company with which the set of credits are associated.

memberstring

The _id of the member with which the set of credits are associated.

feestring

The _id of the one-off fee with which the set of credits are associated.

membershipstring

The _id of the membership with which the set of credits are associated.

intervalLength'month' | 'once'

Determines the recurrence of the credits. Can be either "month" or "once". If unspecified the set of credits issued will be set as "once".

startDatestring

The start date of the monthly recurring credits. Should be used only for the set of credits with "intervalLength" set to "month".

endDatestring

The end date of the monthly recurring credits.

validFromstring

The start date from which the credits are valid.

validTostring

The end date for which the credits are valid. Can be set for both monthly recurring are once credits.

validFor'rates' | 'resourceTypes' | 'all'

The type of the credits and what they're valid for.

resourceTypesstring[]

The resource types for which the credits is applied.

parentstring

The parent set of credits of the current set of credits.

resourceRatesstring[]

An array that contains the _ids of the resource rates for which the credits will be valid. If left empty the credits will be valid for all rates.

countnumber

The number of credits granted.

usedCountnumber

The number of credits used.

Example response

{
  "_id": "603dfbc260f4054084125d30",
  "company": "603dfbc260f4054084125d30",
  "member": "603dfbc260f4054084125d33",
  "fee": "603dfbc260f4054084125d33",
  "membership": "603dfbc260f4054084125d33",
  "startDate": "2024-01-01T00:00:00Z",
  "endDate": "2024-01-01T00:00:00Z",
  "validFrom": "2024-01-01T00:00:00Z",
  "validTo": "2024-01-01T00:00:00Z",
  "resourceTypes": [
    "603dfbc260f4054084125d30"
  ],
  "bookings": [
    {
      "count": 2,
      "booking": "603dfbc260f4054084125d30",
      "occurrenceDate": "2024-01-01T00:00:00Z"
    }
  ],
  "parent": "603dfbc260f4054084125d30",
  "resourceRates": [
    "603dfbc260f4054084125d30"
  ],
  "count": 2,
  "usedCount": 1
}