Skip to main content

billing_purchase_orders

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

Overview​

Namebilling_purchase_orders
TypeResource
Idovh.me.billing_purchase_orders

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerPurchase Order identifier
billing_group_idintegerBilling Group identifier (wire: billingGroupId)
activebooleanActive
creation_datestring (date-time)Creation date (wire: creationDate)
descriptionstringDescription
end_datestring (date)End date (wire: endDate)
last_updatestring (date-time)Last update date (wire: lastUpdate)
referencestringReference
start_datestring (date)Start date (wire: startDate)
statusstringStatus (CREATED, DELETED)
typestringType of a purchase order (PURCHASE_ORDER, REFERENCE_ORDER)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectidRetrieve information about a purchase order (Beta version)
listselectbilling_group_id, x_pagination_modeRetrieve all purchase orders (Beta version)
createinsertreference, start_date, typeCreate a purchase order (Beta version)
updateupdateidUpdate a purchase order (Beta version)
deletedeleteidDelete a purchase 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"}})
idintegerId
billing_group_idintegerBilling Group Identifier (wire: billingGroupId)
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 information about a purchase order (Beta version)

SELECT
id,
billing_group_id,
active,
creation_date,
description,
end_date,
last_update,
reference,
start_date,
status,
type
FROM ovh.me.billing_purchase_orders
WHERE id = '{{ id }}' -- required
;

INSERT examples​

Create a purchase order (Beta version)

INSERT INTO ovh.me.billing_purchase_orders (
active,
billing_group_id,
description,
end_date,
reference,
start_date,
type
)
SELECT
{{ active }},
{{ billing_group_id }},
'{{ description }}',
'{{ end_date }}',
'{{ reference }}' /* required */,
'{{ start_date }}' /* required */,
'{{ type }}' /* required */
RETURNING
id,
billing_group_id,
active,
creation_date,
description,
end_date,
last_update,
reference,
start_date,
status,
type
;

UPDATE examples​

Update a purchase order (Beta version)

UPDATE ovh.me.billing_purchase_orders
SET
active = {{ active }},
billing_group_id = {{ billing_group_id }},
description = '{{ description }}',
end_date = '{{ end_date }}',
reference = '{{ reference }}',
start_date = '{{ start_date }}',
type = '{{ type }}'
WHERE
id = '{{ id }}' --required;

DELETE examples​

Delete a purchase order (Beta version)

DELETE FROM ovh.me.billing_purchase_orders
WHERE id = '{{ id }}' --required
;