Skip to main content
PATCH
/
purchases
/
{id}
Partial update purchase (draft only)
curl --request PATCH \
  --url https://api.piriod.com/purchases/{id}/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-simple-workspace: <x-simple-workspace>' \
  --data '
{
  "supplier": "<string>",
  "document": 123,
  "number": 123,
  "date": "2023-12-25",
  "lines": [
    {
      "name": "<string>",
      "amount": 123,
      "quantity": 123,
      "description": "<string>",
      "exempt": false,
      "tax": 123,
      "tax_percent": 123,
      "discount": 123,
      "discount_scheme": "%",
      "code": "<string>",
      "code_scheme": "<string>",
      "retention": 123,
      "retention_percent": 0
    }
  ],
  "due_date": "2023-12-25",
  "note": "<string>",
  "amount": 123,
  "exempt": 123,
  "tax": 123,
  "tax_percent": 123,
  "subtotal": 123,
  "total": 123,
  "retention": 123,
  "discount": 123,
  "discount_scheme": "%",
  "tax_settings": {},
  "metadata": {}
}
'
{
  "supplier": "<string>",
  "document": 123,
  "number": 123,
  "date": "2023-12-25",
  "lines": [
    {
      "name": "<string>",
      "amount": 123,
      "quantity": 123,
      "id": 123,
      "description": "<string>",
      "exempt": false,
      "tax": 123,
      "tax_percent": 123,
      "total": 123,
      "discount": 123,
      "discount_scheme": "%",
      "code": "<string>",
      "code_scheme": "<string>",
      "retention": 123,
      "retention_percent": 0
    }
  ],
  "id": 123,
  "due_date": "2023-12-25",
  "note": "<string>",
  "amount": 123,
  "exempt": 123,
  "tax": 123,
  "tax_percent": 123,
  "subtotal": 123,
  "total": 123,
  "total_adjusted": 123,
  "retention": 123,
  "discount": 123,
  "discount_scheme": "%",
  "tax_settings": {},
  "status": "draft",
  "biller_status": "<string>",
  "tax_agency": {},
  "local_file": "<string>",
  "imported": true,
  "test_mode": true,
  "metadata": {},
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://piriod-d406ac55.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use header Authorization: Token <api_token>. API tokens are obtained from the Piriod dashboard.

Headers

x-simple-workspace
string
required

Workspace (account) identifier. Required for every request.

x-piriod-test-mode
boolean
default:false

Whether to operate against test-mode data. Defaults to false.

Path Parameters

id
string
required

Resource identifier.

Body

application/json
supplier
string
required

Supplier ID.

document
integer
required

Purchase-document type ID.

number
integer
required
date
string<date>
required
lines
object[]
required
due_date
string<date> | null
note
string | null
Maximum string length: 100
amount
number | null
exempt
number | null
tax
number | null
tax_percent
number | null
subtotal
number | null
total
number | null
retention
number | null
discount
number | null
discount_scheme
enum<string> | null
Available options:
%,
$
tax_settings
object

Country-specific tax-agency configuration.

metadata
object

Response

200 - application/json

Updated purchase.

supplier
string
required

Supplier ID.

document
integer
required

Purchase-document type ID.

number
integer
required
date
string<date>
required
lines
object[]
required
id
integer
read-only
due_date
string<date> | null
note
string | null
Maximum string length: 100
amount
number | null
exempt
number | null
tax
number | null
tax_percent
number | null
subtotal
number | null
total
number | null
total_adjusted
number | null
read-only
retention
number | null
discount
number | null
discount_scheme
enum<string> | null
Available options:
%,
$
tax_settings
object

Country-specific tax-agency configuration.

status
enum<string>
read-only
Available options:
draft,
finalized
biller_status
string
read-only
tax_agency
object
read-only
local_file
string<uri> | null
read-only
imported
boolean
read-only
test_mode
boolean
read-only
metadata
object
created
string<date-time>
read-only
updated
string<date-time>
read-only