Hivebuy External API (v2)

Sections

Theme switcher

Replace a contract

Header Parameters

Authorizationstring

Path Parameters

companyIdstring Required

Company ID. Must be one of the IDs returned by GET /api/v2/companies/.

idstring Required

Row id. A row belonging to another company is 404 on every verb, never 403.

Body Parameters

namestring Required
descriptionstring | null
partnerstring | null

The counterparty, as free text.

partnerEmailstring | null
contractNumberstring | null

Your contract number.

statusstring

P pending, A approved, R rejected, AC active, IA inactive. Defaults to P.

Enum values:
PARACIA
contractTypestring

U unit, S supplier, HR hr, SE service, M maintenance, FR framework, WK work, SC service contract, PR purchase, RT rental. Defaults to U. A S (supplier) contract is the one whose DELETE deactivates the linked supplier.

Enum values:
USHRSEMFRWKSCPRRT
activeboolean
startDatestring | null
endDatestring | null
noticePeriodobject | null

With startDate and endDate set, the server computes cancellationDate from this.

Show child attributes

cancellationDatestring | null

Overwritten by the server whenever startDate, endDate and noticePeriod are all set, send it only when they are not.

reminderboolean

Whether to remind before the cancellation date.

reminderTimeinteger | null

Days of lead time; pulled forward off the computed cancellation date.

approvalNeededboolean
contractPricestring

Price per payment iteration, as a decimal string.

netAmountstring

Decimal string.

grossAmountstring

Decimal string.

vatstring

VAT as a decimal string.

additionalCostNetAmountstring | null

Decimal string.

totalLicenseAmountstring | null

Server-computed on every save (licenseAmount × netAmount + additionalCostNetAmount); a sent value does not stick.

licenseAmountinteger | null

Number of paid licenses.

freeLicenseAmountinteger | null
licenseAlertboolean

Alert when license usage crosses licenseThreshold.

licenseThresholdinteger | null
ownerstring | null

Must be an active member of this company.

departmentstring | null

Must belong to this company.

categorystring | null

Must belong to this company.

companySupplierstring | null

Must belong to this company.

recurrenceobject | null

How the contract recurs. Written inline with the contract; on update, include the id to change the existing row rather than replace it.

Show child attributes

Response

200
Object

The updated contract, in the read shape.

Response Attributes

idstring
namestring
descriptionstring | null
partnerstring | null

The counterparty, as free text.

partnerEmailstring | null
contractNumberstring | null

Your contract number.

statusstring

P pending, A approved, R rejected, AC active, IA inactive. Defaults to P.

Enum values:
PARACIA
contractTypestring

U unit, S supplier, HR hr, SE service, M maintenance, FR framework, WK work, SC service contract, PR purchase, RT rental. Defaults to U. A S (supplier) contract is the one whose DELETE deactivates the linked supplier.

Enum values:
USHRSEMFRWKSCPRRT
activeboolean
startDatestring | null
endDatestring | null
noticePeriodobject | null

With startDate and endDate set, the server computes cancellationDate from this.

Show child attributes

cancellationDatestring | null

Overwritten by the server whenever startDate, endDate and noticePeriod are all set, send it only when they are not.

reminderboolean

Whether to remind before the cancellation date.

reminderTimeinteger | null

Days of lead time; pulled forward off the computed cancellation date.

approvalNeededboolean
contractPricestring

Price per payment iteration, as a decimal string.

netAmountstring

Decimal string.

grossAmountstring

Decimal string.

vatstring

VAT as a decimal string.

additionalCostNetAmountstring | null

Decimal string.

totalLicenseAmountstring | null

Server-computed on every save (licenseAmount × netAmount + additionalCostNetAmount); a sent value does not stick.

licenseAmountinteger | null

Number of paid licenses.

freeLicenseAmountinteger | null
licenseAlertboolean

Alert when license usage crosses licenseThreshold.

licenseThresholdinteger | null
ownerstring | null

Must be an active member of this company.

departmentstring | null

Must belong to this company.

categorystring | null

Must belong to this company.

companySupplierstring | null

Must belong to this company.

recurrenceobject | null

How the contract recurs. Written inline with the contract; on update, include the id to change the existing row rather than replace it.

Show child attributes

contractPriceCurrencystring

Currency of contractPrice. Read-only, the company currency.

readOnly
netAmountCurrencystring

Currency of netAmount. Read-only, the company currency.

readOnly
grossAmountCurrencystring

Currency of grossAmount. Read-only, the company currency.

readOnly
additionalCostNetAmountCurrencystring

Currency of additionalCostNetAmount. Read-only, the company currency.

readOnly
totalLicenseAmountCurrencystring

Currency of totalLicenseAmount. Read-only, the company currency.

readOnly
totalContractPricestring

Read-only: contractPrice × the recurrence's payment iterations.

readOnly
totalContractPriceCurrencystring

Currency of totalContractPrice. Read-only, the company currency.

readOnly
filesarray
readOnly

Show child attributes

createdAtstring
readOnly
updatedAtstring
readOnly
deletedstring | null
readOnly
400
Object

Validation failed. attr names the field, in snake_case.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

401
Object

Missing, invalid, or expired API key, or a session credential was used instead of an API key.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

403
Object

Authenticated but not entitled: the key's user is not an active member of this company, the External API feature (or the resource's own feature) is not enabled for it, the key lacks the scope this verb needs, or a browser session was used.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

404
Object

No such row for this company, including a row that belongs to another company, and a soft-deleted row you tried to write to. The API does not confirm whether the id exists elsewhere.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

429
Object

Rate limit exceeded (60 requests per minute per API key). Retry after the number of seconds given in the message.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

PUT

/

Select
1

Response