Updates a draft contract
Changed onReplaces the draft contract identified by draft_contract_id with the supplied payload. The body shape matches POST /draft-contracts — items and external_references on the existing record are fully replaced. Returns 404 if the id is not a draft contract in the organization.
Exceptions that keep stored data when the field is omitted:
- shipping_customer_id, billing_address_id, shipping_address_id: omit them to keep the draft's current ship-to customer and addresses, or send null to clear them.
- email_selection: omit it to keep the draft's current recipients.
This is for backward compatibility: integrations built before these fields existed won't clear them on every update. Kept values that no longer fit are dropped: the billing address and email selection when customer_id changes, a ship-to customer that was the previous billing customer, and any address or email its customer no longer holds.
A draft waiting for approval as a new contract can't be changed: the request answers 409. Once the approval request is rejected or cancelled, the draft can be changed and sent again.
Request
- Base URLhttps://api.rillet.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"external_references": [
{
"type": "xyzSystemId",
"id": "234",
"url": "https://xyzsystempage.com/ids/234"
}
],
"name": "Acme Corp - Annual subscription",
"amount": {
"amount": "1.01",
"currency": "USD"
},
"items": [
{
"price": {
"amount": {
"amount": "1.01",
"currency": "USD"
},
"interval_months": 1
},
"quantity": 1,
"discount": {
"amount_off": {
"amount": "1.01",
"currency": "USD"
}
},
"declared_ssp": {
"amount": "1.01",
"currency": "USD"
}
}
]
}Response
OK
Example response
{
"external_references": [
{
"type": "xyzSystemId",
"id": "234",
"url": "https://xyzsystempage.com/ids/234"
}
],
"amount": {
"amount": "1.01",
"currency": "USD"
},
"items": [
{
"price": {
"amount": {
"amount": "1.01",
"currency": "USD"
},
"interval_months": 1
},
"discount": {
"amount_off": {
"amount": "1.01",
"currency": "USD"
}
},
"declared_ssp": {
"amount": "1.01",
"currency": "USD"
}
}
],
"purchase_order_number": "PO-12345",
"billing_address": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Nashville",
"state": "TN",
"zip_code": "37201",
"country": "US"
},
"shipping_address": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Nashville",
"state": "TN",
"zip_code": "37201",
"country": "US"
}
}Changes
- breaking
the
//response's property type changed fromnumbertostring, and format from no format tonumberfor status - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- breaking