Create a spend control

Create a new spend control owned by your business, with an initial set of rules. Configuration is typed for each rule type — see GET /spend_controls/rule_types for the supported shape per rule type.

Required permissions: spend_control:create.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

X-Penny-As-Businessstring or nullOptional

Act on behalf of another business that has granted you access. Requires the business:act_as permission.

Request

This endpoint expects an object.
rule_configslist of objectsOptional

The rules to configure on the new spend control. Each rule_type may appear at most once.

Response

The newly created spend control.
spend_control_idstring
Penny's unique identifier for this spend control.
versioninteger
A number that increases each time this spend control's configuration changes. Use it to confirm you are looking at the latest configuration.
version_timedatetime
The date and time this spend control's configuration was last changed.
activeboolean
Whether this spend control's rules are currently being enforced against transactions.
statusenum
The current lifecycle state of the spend control. 'active' means the rules are being enforced. 'deactivated' means enforcement has been paused and can be resumed. 'deleting' means removal has been requested and is in progress. 'deleted' means the spend control has been removed and is kept only for historical reference.
Allowed values:
ruleslist of objects
The full external configuration of every rule in this spend control.
business_idstring
The identifier of the business that owns this spend control.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error