Skip to main content
POST
Create purchase agreement

Authorizations

Authorization
string
header
required

An API token from Sign in, sent as Authorization: Bearer <token>. Tokens last 30 days.

Body

application/json
partner_id
integer
required

Vendor partner ID. The id of an existing record in the partners_partners table.

Example:

12

type
enum<string>
required

Agreement type: blanket_order or purchase_template.

Available options:
blanket_order,
purchase_template
Example:

"blanket_order"

currency_id
integer
required

Currency ID. The id of an existing record in the currencies table.

Example:

1

company_id
integer
required

Company ID. The id of an existing record in the companies table.

Example:

1

lines
object[]
required

Array of agreement lines with writable fields from the purchase agreement form. Must have at least 1 items.

Example:
user_id
integer | null

Buyer user ID. The id of an existing record in the users table.

Example:

2

starts_at
string | null

Agreement validity start date (YYYY-MM-DD). Must be a valid date. Must be a date after or equal to today.

Example:

"2026-02-20"

ends_at
string | null

Agreement validity end date (YYYY-MM-DD). Must be a valid date. Must be a date after or equal to starts_at.

Example:

"2026-08-20"

reference
string | null

Reference text. Must not be greater than 255 characters.

Example:

"AG-2026-Q1"

description
string | null

Terms and conditions / notes.

Example:

"Blanket agreement for monthly supply."

Response

Created