الانتقال إلى المحتوى الرئيسي
POST
Creates a contract with 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.

الجسم

The contract to create.

Creates a contract with its service lines. Name, ClientId and at least one service line are required; each line needs Name and LaborTermsId. Returns the contract in the GET /v1/contracts/{contractId} shape.

Name
string | null

Name of the contract. Required.

مثال:

"All Labor Terms Example"

ClientId
integer<int64> | null

The client the contract bills. Required.

مثال:

88

IsForAllLocations
boolean | null

Whether the contract covers every one of the client's locations. Default true.

LocationIds
integer<int64>[] | null

The locations covered when IsForAllLocations is false: at least one, each the client's own. Ignored otherwise.

Reference
string | null

Free-text reference printed on the contract's invoices.

مثال:

"MSA-2025-014"

StartDate
string<date-time> | null

Date coverage starts, a calendar date. Defaults to today in the service provider's zone.

مثال:

"2026-01-15T00:00:00.0000000+00:00"

EndDate
string<date-time> | null

Date coverage ends, a calendar date, after StartDate. Left out, the contract is open-ended.

ProrateTypeId
integer<int32> | null

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

مثال:

0

AutoInvoiceTicketProducts
boolean | null

Sweep approved ticket products for this client into the next recurring invoice. Only with IsForAllLocations true. Default false.

RepeatPeriodId
integer<int32> | null

1 Monthly (default), 2 Quarterly, 3 Yearly, 4 Half Yearly.

مثال:

1

DaysBeforeInvoiceCreation
integer<int32> | null

Days before the billing period ends that the invoice is created, 0-31. Default 0.

مثال:

0

DaysUntilDue
integer<int32> | null

Days the client has to pay. Defaults to the service provider's invoice setting.

مثال:

30

AutoApproveAndSend
boolean | null

Approve and send each invoice raised from the contract automatically. Default false.

ContactIds
integer<int64>[] | null

The client's contacts who can auto-approve the contract's invoices.

InvoiceTemplateId
integer<int64> | null

Invoice template for the contract's invoices. Left out, the service provider's default applies.

InvoiceEmailTemplateId
integer<int64> | null

Email template for the contract's invoices. Left out, the service provider's default applies.

BrandingThemeId
string<uuid> | null

Accounting-system branding theme for the contract's invoices.

ServiceLines
object[] | null

The service lines. At least one.

الاستجابة

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[]