الانتقال إلى المحتوى الرئيسي
PATCH
Updates a contract and its service lines.

التفويضات

X-API-Key
string
header
مطلوب

Your Gorelo API key. See Generate API key. If your data is hosted in Australia, click the base URL at the top of this page and select https://api.aue.gorelo.io.

معلمات المسار

contractId
integer<int64>
مطلوب

Identifier of the contract.

الجسم

Fields to change.

Partial update of a contract. Every field is optional and a field left out keeps its value; a clearable field clears with null. ServiceLines, and each line's LineItems, replace their set, matched by Id.

Name
string | null

Name of the contract. Not clearable.

ClientId
integer<int64> | null

Not accepted: a contract's client can't change, as in the app.

StatusId
integer<int32> | null

1 Active or 3 Archived: the app's Restore and Archive. 2 Expired follows from EndDate and can't be set.

مثال:

3

Reference
string | null

Free-text reference printed on the contract's invoices. Send null to clear it.

StartDate
string<date-time> | null

Date coverage starts, a calendar date. Refused with 409 once an invoice has been generated from the contract. Line items keep their own dates. Not clearable.

EndDate
string<date-time> | null

Date coverage ends, a calendar date. Send null to make the contract open-ended.

RepeatPeriodId
integer<int32> | null

1 Monthly, 2 Quarterly, 3 Yearly, 4 Half Yearly. Refused with 409 once an invoice has been generated.

DaysBeforeInvoiceCreation
integer<int32> | null

Days before the billing period ends that the invoice is created.

DaysUntilDue
integer<int32> | null

Days the client has to pay.

AutoApproveAndSend
boolean | null

Approve and send each invoice raised from the contract automatically.

ContactIds
integer<int64>[] | null

The auto-approve contacts, replacing the set. [] removes them all.

IsForAllLocations
boolean | null

Whether the contract covers all the client's locations. False needs LocationIds, sent or already stored.

LocationIds
integer<int64>[] | null

The locations covered, replacing the set. Read only when the contract is location-scoped.

ProrateTypeId
integer<int32> | null

0 Do not prorate, 1 Prorate and add to next invoice, 2 Prorate and generate standalone invoice.

AutoInvoiceTicketProducts
boolean | null

Sweep approved ticket products into the next recurring invoice. Only on an all-locations contract.

InvoiceTemplateId
integer<int64> | null

Invoice template for the contract's invoices. Send null to clear it; the default then applies.

InvoiceEmailTemplateId
integer<int64> | null

Email template for the contract's invoices. Send null to clear it; the default then applies.

BrandingThemeId
string<uuid> | null

Accounting-system branding theme for the contract's invoices. Send null to clear it.

ServiceLines
object[] | null

The service lines, replacing the set: an entry with an Id updates that line, one without adds a line, and a line left out is removed. Leave the field out to keep the lines as they are.

الاستجابة

OK

StatusCode
enum<integer>
الخيارات المتاحة:
100,
101,
102,
103,
200,
201,
202,
203,
204,
205,
206,
207,
208,
226,
300,
301,
302,
303,
304,
305,
306,
307,
308,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
410,
411,
412,
413,
414,
415,
416,
417,
421,
422,
423,
424,
426,
428,
429,
431,
451,
500,
501,
502,
503,
504,
505,
506,
507,
508,
510,
511
IsSuccess
boolean
Data
object

Everything about one contract: the client and locations it covers, its billing schedule, and each service line with the actual products/labor billed on it.

DataContext
object | null
مثال:

null

Notifications
object[]