API Documentation
Contracts ¶
Contracts ¶
For more details on contracts please refer to the help article.
The contract object represents recurring financial commitments such as recurring budgets. Recurring commitments are either created automatically or triggered manually.
Please note that we rate limit POST requests for generating recurring budgets to 50 requests per minute.
Supported attributes
-
interval_id (integer)
-
next_occurrence_on (date)
-
ends_on (date)
-
template_id (integer)
-
copy_purchase_order_number (boolean)
-
copy_expenses (boolean)
The following interval_id values are available:
-
1 (monthly)
-
2 (bi-weekly)
-
3 (weekly)
-
4 (annual)
-
5 (semiannual)
-
6 (quarterly)
The following attributes are mandatory:
-
interval_id
-
template_id
-
next_occurrence_on (on create only)
In addition, next_occurrence_on date must be after today and after template’s date. Also, ends_on date has to be on or after next_occurrence_on if set.
Note that template_id has to point to a valid financial object, such as a budget that is to be recurred.
Supported filter params
-
id (integer)
-
contract_interval_id (integer)
-
starts_on (date)
-
ends_on (date)
-
next_occurrence_on (date)
Filter operations are supported on this endpoint.
Supported sort params
No sorting is supported on this endpoint. Default sorting is by id, ascending.
GET /api/v2/contracts
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonHeaders
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"data": [
{
"id": "1",
"type": "contracts",
"attributes": {
"ends_on": null,
"starts_on": "2025-10-27",
"next_occurrence_on": "2025-11-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "244"
}
},
"template": {
"meta": {
"included": false
}
}
}
},
{
"id": "2",
"type": "contracts",
"attributes": {
"ends_on": null,
"starts_on": "2025-10-27",
"next_occurrence_on": "2025-11-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "244"
}
},
"template": {
"meta": {
"included": false
}
}
}
},
{
"id": "3",
"type": "contracts",
"attributes": {
"ends_on": null,
"starts_on": "2025-10-27",
"next_occurrence_on": "2025-11-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "244"
}
},
"template": {
"meta": {
"included": false
}
}
}
}
],
"links": {
"first": "http://api-test.productive.io/api/v2/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30",
"last": "http://api-test.productive.io/api/v2/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30"
},
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 3,
"page_size": 30,
"max_page_size": 200
}
}Get contractsGET/api/v2/contracts
GET /api/v2/contracts/4
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonHeaders
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"data": {
"id": "4",
"type": "contracts",
"attributes": {
"ends_on": null,
"starts_on": "2025-10-27",
"next_occurrence_on": "2025-11-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "245"
}
},
"template": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}Gets a contractGET/api/v2/contracts/{id}
- id
number(required) Example: 1contract id
- template_id
number(required) Example: 1template id
POST /api/v2/contracts
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"attributes": {
"interval_id": 1,
"next_occurrence_on": "Nov 1, 2025"
},
"relationships": {
"template": {
"data": {
"type": "deals",
"id": "128"
}
}
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"data": {
"id": "6",
"type": "contracts",
"attributes": {
"ends_on": null,
"starts_on": "2025-10-25",
"next_occurrence_on": "2025-11-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "246"
}
},
"template": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}POST /api/v2/contracts
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"attributes": {
"interval_id": 1,
"next_occurrence_on": "2025-11-01"
},
"relationships": {
"template": {
"data": {
"type": "deals",
"id": "0"
}
}
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "attribute is invalid",
"source": {
"pointer": "data/attributes/template"
}
}
]
}Create a contractPOST/api/v2/contracts
PATCH /api/v2/contracts/10
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"attributes": {
"ends_on": "Nov 30, 2025"
},
"relationships": {
"template": {
"data": {
"type": "deals",
"id": "134"
}
}
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"data": {
"id": "10",
"type": "contracts",
"attributes": {
"ends_on": "2025-11-30",
"starts_on": "2025-10-27",
"next_occurrence_on": "2025-11-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "250"
}
},
"template": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}PATCH /api/v2/contracts/11
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"attributes": {
"next_occurrence_on": "Oct 22, 2025"
},
"relationships": {
"template": {
"data": {
"type": "deals",
"id": "136"
}
}
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "must be after today",
"source": {
"pointer": "data/attributes/next_occurrence_on"
}
},
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "must be after budget date",
"source": {
"pointer": "data/attributes/next_occurrence_on"
}
}
]
}PATCH /api/v2/contracts/12
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"attributes": {
"next_occurrence_on": "Oct 27, 2025"
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "must be after budget date",
"source": {
"pointer": "data/attributes/next_occurrence_on"
}
}
]
}PATCH /api/v2/contracts/13
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"attributes": {
"next_occurrence_on": "Oct 27, 2025"
},
"relationships": {
"template": {
"data": {
"type": "deals",
"id": "139"
}
}
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "must be after budget date",
"source": {
"pointer": "data/attributes/next_occurrence_on"
}
}
]
}PATCH /api/v2/contracts/15
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonBody
{
"data": {
"type": "contracts",
"relationships": {
"template": {
"data": {
"type": "deals",
"id": "142"
}
}
}
}
}Headers
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "must be after budget date",
"source": {
"pointer": "data/attributes/next_occurrence_on"
}
}
]
}Update a contractPATCH/api/v2/contracts/{id}
- id
number(required) Example: 1contract id
- template_id
number(required) Example: 1template id
DELETE /api/v2/contracts/16
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonDeletes a contractDELETE/api/v2/contracts/{id}
- id
number(required) Example: 1contract id
- template_id
number(required) Example: 1template id
POST /api/v2/contracts/19/generate
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+jsonHeaders
Content-Type: application/vnd.api+json; charset=utf-8Body
{
"data": {
"id": "19",
"type": "contracts",
"attributes": {
"ends_on": null,
"starts_on": "2025-10-27",
"next_occurrence_on": "2022-03-01",
"interval_id": 1,
"copy_purchase_order_number": false,
"copy_expenses": false,
"use_rollover_hours": false
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "257"
}
},
"template": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}Generates new budgetPOST/api/v2/contracts/{id}/generate
- id
number(required) Example: 1contract id
- template_id
number(required) Example: 1template id
Generated by aglio on 25 Oct 2025