FieldEx Developer
developer notes

Create Contract

The ContractCreate API allows you to create a new Contract. The request body includes customer information, status, and other relevant information.

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

Headers

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

Example Request

{
    "id": null,
    "customer": {
        "id": 3,
        "name": "1 Load Test [DO NOT DELETE]",
        "customerExternalId": null
    },
    "salesOrder": null,
    "custodian": {
        "externalId": "null"
    },
    "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 - 201
{
    "id": null,
    "customer": {
        "id": 80797,
        "name": "TestNov27"
    },
    "salesOrder": null,
    "custodian": {
        "id": 8958
    },
    "active": true,
    "status": "NEW",
    "startDateTime": "2023-11-26T16:00:00.000Z",
    "endDateTime": "2023-11-29T16:00:00.000Z",
    "ref_no": "123",
    "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"
        }
    ]
}