FieldEx Developer
developer notes

Patch Contracts

The PartialUpdate API allows you to update a subset of the fields in the contract record. This is useful in cases where you need to update a contract without having to update all of the fields.

Method API Endpoint
PATCH {{endpoint}}/api/ext/contracts

Headers

Key Value
Content-Type application/json
Authorization Bearer {{token}}

Example Request

{
    "id": 1,
    "customer": {
        "id": 3,
        "name": "1 Load Test [DO NOT DELETE]",
        "customerExternalId": null
    },
    "salesOrder": null,
    "custodian": {
        "externalId": "contact1"
    },
    "active": true,
    "status": "NEW",
    "startDateTime": "2023-10-04T16:00:00.000Z",
    "endDateTime": "2023-11-29T16:00:00.000Z",
    "ref_no": "contract1",
    "contractItems": [
        {
            "id": null,
            "serialNumber": "",
            "qty": 1,
            "qtyAvailable": "",
            "updateInventory": false,
            "assets": null,
            "accessory": null,
            "bin": null,
            "assetsCode": "",
            "status": "ON_RENT"
        },
        {
            "id": null,
            "serialNumber": "",
            "qty": 1,
            "qtyAvailable": "",
            "updateInventory": false,
            "assets": null,
            "accessory": null,
            "bin": null,
            "status": "ON_RENT"
        }
    ]
}

Example Response

//status - 200
{
  "id": 7489,
  "contractNumber": "ACV-00007489",
  "status": "NEW",
  "active": true,
  "startDateTime": "2023-11-26T16:00:00.000Z",
  "endDateTime": "2023-11-29T16:00:00.000Z",
  "customer": {
    "id": 80797,
    "name": "TestNov27",
    "email": null,
    "isDeleted": "N"
  },
  "salesOrder": null,
  "custodian": {
    "id": 8958,
    "title": "Mr.",
    "fullName": "test"
  },
  "createdByUser": {
    "id": 3,
    "login": "load.tech1@trial.custella.com",
    "firstName": "Technician",
    "lastName": "User",
    "email": "preeti@fieldex.com",
    "fullName": "Technician User"
  },
  "lastModifiedByUser": {
    "id": 3,
    "login": "load.tech1@trial.custella.com",
    "firstName": "Technician",
    "lastName": "User",
    "email": "preeti@fieldex.com",
    "fullName": "Technician User"
  },
  "createdDate": "2023-11-27T07:26:42Z",
  "lastModifiedDate": "2023-11-27T07:26:42Z",
  "ref_no": "123",
  "contractItems": null
}