Draft Contracts

Updates a draft contract

Changed on

Replaces 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.

put/draft-contracts/{draft_contract_id}

Request

Request body

subsidiary_idstring uuid required
customer_idstring uuid required

Must reference a customer that already exists in Rillet. Use POST /customers first if needed.

namestring required
close_datestring date required
start_datestring date
end_datestring date
scope'FULL' | 'REVENUE_RECOGNITION_ONLY' required

The "FULL" scope includes revenue recognition and invoicing handled in Rillet. With the "REVENUE_RECOGNITION_ONLY" scope, invoicing is handled outside Rillet.

purchase_order_numberstring

Optional purchase order number, carried onto the contract created from this draft and from there onto every invoice it generates.

shipping_customer_idstring uuid nullable

A UUID, or null to explicitly select nothing. Omitting the field is not the same as sending null.

billing_address_idstring uuid nullable

A UUID, or null to explicitly select nothing. Omitting the field is not the same as sending null.

shipping_address_idstring uuid nullable

A UUID, or null to explicitly select nothing. Omitting the field is not the same as sending null.

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

idstring uuid required
subsidiary_idstring uuid required
customer_idstring uuid required
namestring required
close_datestring date required
start_datestring date
end_datestring date
scope'FULL' | 'REVENUE_RECOGNITION_ONLY'

The "FULL" scope includes revenue recognition and invoicing handled in Rillet. With the "REVENUE_RECOGNITION_ONLY" scope, invoicing is handled outside Rillet.

purchase_order_numberstring

Purchase order number set on the draft. Null when none was set.

shipping_customer_idstring uuid nullable

The customer the draft ships to. Equal to customer_id when the draft ships to its billing customer. Null when no ship-to customer is stored.

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 from number to string, and format from no format to number for 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