Skip to main content

credit_balances

Creates, updates, deletes, gets or lists a credit_balances resource.

Overview​

Namecredit_balances
TypeResource
Idovh.me.credit_balances

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
balance_namestringBalance name (wire: balanceName)
amountobjectBalance amount
balance_detailsarrayBalance details, amounts by serviceID (wire: balanceDetails)
bookedarrayMovement already booked on orders
creation_datestring (date-time)Balance creation date (wire: creationDate)
expiringarrayMovement expiring soon
last_updatestring (date-time)Balance last update (wire: lastUpdate)
typestringBalance type (BONUS, DEPOSIT, PREPAID_ACCOUNT, VOUCHER)
usablebooleanBalance usable

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbalance_nameRetrieve a credit balance
listselecttype, x_pagination_modeRetrieve all credit balances

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
balance_namestringBalance name (wire: balanceName)
typestringFilter by balance type
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Retrieve a credit balance

SELECT
balance_name,
amount,
balance_details,
booked,
creation_date,
expiring,
last_update,
type,
usable
FROM ovh.me.credit_balances
WHERE balance_name = '{{ balance_name }}' -- required
;