Purchase Order API

Manage purchase orders — retrieval, creation, modification, closing and document download

Base URL

https://{tenant}.logzi.com/api/order_out/

Every request returns a JSON response. On success result.code == 1, on failure result.code == 0.

GET/api/order_out/get

Retrieve a single purchase order by identifier, with full details.

Query parameters

ParameterTypeRequiredDescription
idintUnique identifier of the purchase order

Example request

GET /api/order_out/get?id=55
X-API-KEY: {your_api_key}
GET/api/order_out/list

Retrieve a paginated list of purchase orders with filtering options.

Query parameters

ParameterTypeRequiredDescription
list_offsetintPagination offset (default: 0)
list_countintNumber of records per page
list_sort[field]stringName of the field to sort by
list_sort[sort]stringSort direction: ASC or DESC
list_condition[identify]stringFilter by identifier (LIKE)
list_condition[company_name]stringFilter by supplier name (LIKE)
list_condition[status_id]intFilter by status
list_condition[date_create_from]dateCreation date — from (YYYY-MM-DD)
list_condition[date_create_to]dateCreation date — to (YYYY-MM-DD)
list_condition[partner_id]intFilter by supplier partner ID

Example request

GET /api/order_out/list?list_offset=0&list_condition[status_id]=1
X-API-KEY: {your_api_key}
POST/api/order_out/save

Create or update a purchase order. For a new order use data[id] = 0; for an update, provide the existing ID.

POST fields — data object

FieldTypeRequiredDescription
idint0 = new order, >0 = update
company_idintCompany identifier
company_user_idintResponsible staff member ID
company_address_idintCompany site ID
currency_idintCurrency identifier
partner_idintSupplier partner identifier
date_performdateDelivery deadline (YYYY-MM-DD)
comment_topstringComment visible to the supplier
comment_bottomstringInternal comment
jobnumber_idintJob number identifier
project_idintProject identifier
itemarrayArray of line items (see below)

Line item fields — data[item][]

FieldTypeRequiredDescription
product_idintProduct identifier
quantityfloatOrdered quantity
pricefloatNet unit price
tax_idintVAT rate identifier
price_discountfloatDiscount percentage
store_idintDestination warehouse identifier
removeint1 = remove item on update

POST fields — params object (optional)

FieldTypeRequiredDescription
closeint1 = automatically close after save
downloadint1 = generate PDF after save

Example request

POST /api/order_out/save
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "id": 0,
    "company_id": 1,
    "company_user_id": 3,
    "company_address_id": 1,
    "currency_id": 1,
    "partner_id": 8,
    "date_perform": "2024-07-01",
    "item": [
      { "product_id": 2, "quantity": 100, "price": 500, "tax_id": 2 }
    ]
  }
}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": { "id": 56, "identify": "SZR-2024-0056" }
}
POST/api/order_out/delete

Delete a purchase order. Only an open order (status_id=1) can be deleted.

POST fields — data object

FieldTypeRequiredDescription
receipt_idintIdentifier of the order to delete

Example request

POST /api/order_out/delete
X-API-KEY: {your_api_key}
Content-Type: application/json

{ "data": { "receipt_id": 55 } }
POST/api/order_out/close

Close a purchase order. Only an open order (status_id=1) can be closed.

POST fields — data object

FieldTypeRequiredDescription
receipt_idintIdentifier of the order to close

Example request

POST /api/order_out/close
X-API-KEY: {your_api_key}
Content-Type: application/json

{ "data": { "receipt_id": 55 } }
GET/api/order_out/download

Download the purchase order document in various formats.

Query parameters

ParameterTypeRequiredDescription
receipt_idintIdentifier of the order
file_typestringpdf, pdf-string, pdf-string-sample, stream
languagestringName of the template language folder (e.g. hungarian)
template_idintCustom print template ID

Example request

GET /api/order_out/download?receipt_id=55&file_type=pdf
X-API-KEY: {your_api_key}

Get in touch with us

Interested in our software? Feel free to write to us!

Need help?

If you can't find the answer and need assistance

Create your account now,
pay later!

Try it free for 3 days, no risk, no obligation!