Skip to main content
POST
Approve or reject

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

id
string
required

The contract ID.

Body

application/json

A decision on the version that waits, and the updatedAt of the version the person decided on.

decision
enum<string>
required

approve generates the line items and makes the version the one in force. reject rejects a draft, or discards a pending change.

Available options:
approve,
reject
basedOnUpdatedAt
string<date-time>
required

The updatedAt of the draft or pending change as the person read it. When it changed since, the decision is refused with 409 CONTRACT_CHANGED.

reason
string

Why the version is rejected. An approval refuses it.

Maximum string length: 200
text
string

Notes on the rejection. An approval refuses it.

Maximum string length: 2000

Response

The decided contract

A set of priced lines with a fixed term, owned by one customer and billed in one currency. The fields show the version in force: the last approved one, or the draft while nothing is approved yet. A change that waits for approval is in pendingChange.

id
string
required

Unique identifier for a contract.

Pattern: ^ctr_[a-zA-Z0-9]+$
object
enum<string>
required
Available options:
contract
merchantId
string
required

Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
customerId
string
required

Unique identifier for a customer

Pattern: ^cus_[a-zA-Z0-9]+$
currency
string
required
status
enum<string>
required

draft and rejected hold while the contract was never approved. After approval the status follows the dates, on the customer's clock: scheduled before contractStart, active from it, and ended once contractEnd or terminatedAt has passed.

Available options:
draft,
rejected,
scheduled,
active,
ended
createdAt
string<date-time>
required

When the contract was first written: the createdAt of its first version. It does not change when a version is approved or changed.

externalReference
object | null
required

The record in another system, such as a CRM deal, that the contract comes from. A create that names a record that already has a contract returns that contract and creates nothing.

name
string
required
contractStart
string<date-time>
required
contractEnd
string<date-time>
required
billingAnchor
string<date-time> | null
required

The date the contract's billing cycles are counted from.

billingStartsAt
string<date-time> | null
required

The date billing starts, when it is not the contract start.

upliftPercent
string | null
required

The yearly price uplift, in percent.

note
string | null
required
autoCharge
boolean
required
bankTransferOnly
boolean
required
autoApprove
object
required

Two separate choices. contract: approve the contract, and each change to it, when it is written. It needs the contracts:approve permission. invoices: approve its invoices when they are collected.

terminatedAt
string<date-time> | null
required

The date the contract was ended early.

terminationReason
string | null
required
lines
object[]
required
updatedAt
string<date-time>
required

When this version last changed. Send it back as basedOnUpdatedAt to edit it.

createdByPrincipalId
string | null
required
pendingChange
object | null
required

The change that waits for a decision, in the same shape as the contract.

decidedAt
string<date-time> | null
required

When the version in force was approved or rejected.

decidedByPrincipalId
string | null
required
rejectReason
string | null
required
rejectText
string | null
required
validation
object[]

The reasons the draft or pending change cannot be approved. Empty when it can, or when nothing waits. Present on the answer to one contract, not on a list.

conflicts
object[]

Where the draft or pending change shares an item or a billable metric with another live contract of the customer. Present on the answer to one contract, not on a list.