Skip to main content
PUT
/
v1
/
contracts
/
{id}
Update contract
curl --request PUT \
  --url https://api.useaira.com/v1/contracts/{id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "paymentAccount": {
    "businessName": "<string>",
    "taxId": "<string>",
    "taxIdType": "cnpj",
    "tradeName": "<string>",
    "email": "[email protected]",
    "address": {
      "zipCode": "<string>",
      "number": "<string>",
      "street": "<string>",
      "neighborhood": "<string>",
      "city": "<string>",
      "state": "AC",
      "country": "Brasil",
      "complement": "<string>"
    }
  },
  "contract": {
    "startDate": "2023-12-25",
    "endDate": "2023-12-25",
    "billingEndDay": 16,
    "planIds": [
      "<string>"
    ],
    "rateAdjustmentIndex": "none",
    "paymentSettings": {
      "scheduledPaymentDay": 16,
      "dueOffsetDays": 6
    },
    "billingSettings": {
      "billingCycleMinimumAmount": 1
    },
    "customFields": {
      "customField1": "value1",
      "customField2": [
        "value2",
        "value3"
      ]
    }
  },
  "paymentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
{
  "contract": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "startDate": "2023-12-25",
    "endDate": "2023-12-25",
    "billingEndDay": 16,
    "status": "active",
    "plans": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "description": "<string>"
      }
    ],
    "paymentSettings": {
      "scheduledPaymentDay": 16,
      "dueOffsetDays": 6
    },
    "billingSettings": {
      "billingCycleMinimumAmount": 1
    },
    "sendNotifications": true,
    "rateAdjustmentIndex": "none",
    "customFields": {
      "customField1": "value1",
      "customField2": [
        "value2",
        "value3"
      ]
    }
  },
  "customer": {
    "id": "<string>",
    "externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f",
    "name": "Acme Inc.",
    "customFields": {
      "customField1": "value1",
      "customField2": [
        "value2",
        "value3"
      ]
    }
  },
  "paymentAccount": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "businessName": "<string>",
    "taxId": "<string>",
    "taxIdType": "cnpj",
    "tradeName": "<string>",
    "email": "[email protected]",
    "address": {
      "zipCode": "<string>",
      "number": "<string>",
      "street": "<string>",
      "neighborhood": "<string>",
      "city": "<string>",
      "state": "AC",
      "country": "Brasil",
      "complement": "<string>"
    }
  }
}

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

id
string<uuid>
required

The contract id.

Body

application/json

A contract object.

A contract object.

paymentAccount
object
required

New Payment Account details.

contract
object
required

New Contract details.

paymentAccountId
string<uuid>

Existing payment account ID. If provided, a new payment account will not be created. Note: You cannot provide both a paymentAccountId and a new paymentAccount object at the same time.

Response

The request was successfully processed, and the contract has been updated. The response contains the details of the updated contract.

The request was successfully processed, and the contract has been updated. The response contains the details of the updated contract.

contract
object
required

Schema defining the contract details.

customer
object
required

Schema representing a customer.

paymentAccount
object
required

Schema representing a payment account.