Skip to main content

order_balances

Creates, updates, deletes, gets or lists an order_balances resource.

Overview​

Nameorder_balances
TypeResource
Idovh.me.order_balances

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
balance_namestringCredit balance name (wire: balanceName)
amountobjectAmount applied from the balance

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbalance_name, order_idGet this object properties (Beta version)
listselectorder_idx_pagination_modeList credit balances applied on this Order (Beta version)
createinsertorder_id, balance_nameUse a credit balance on this Order (Beta version)
deletedeletebalance_name, order_idRemove a credit balance from this Order (Beta version)

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_namestringCredit balance name (wire: balanceName)
order_idinteger (wire: orderId)
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​

Get this object properties (Beta version)

SELECT
balance_name,
amount
FROM ovh.me.order_balances
WHERE balance_name = '{{ balance_name }}' -- required
AND order_id = '{{ order_id }}' -- required
;

INSERT examples​

Use a credit balance on this Order (Beta version)

INSERT INTO ovh.me.order_balances (
balance_name,
order_id
)
SELECT
'{{ balance_name }}' /* required */,
'{{ order_id }}'
RETURNING
balance_name,
amount
;

DELETE examples​

Remove a credit balance from this Order (Beta version)

DELETE FROM ovh.me.order_balances
WHERE balance_name = '{{ balance_name }}' --required
AND order_id = '{{ order_id }}' --required
;