Query purchase orders

This endpoint allows you to query the purchase orders of a warehouse created during a period of time, or the detail of a specific purchase order —including its items and totals— by indicating its id in the URL.

GET https://app.fracttal.com/api/warehouse_purchase_orders/
GET https://app.fracttal.com/api/warehouse_purchase_orders/{id_movement}

Input parameters — Detail mode (by ID)

ParameterTypeRequiredDescription
id_movement (in URL)IntegerYes (for this mode)Id of the Purchase Order, sent as a URL path segment, not as a query parameter. Example: /api/warehouse_purchase_orders/53168742. Returns the header along with the items and totals blocks.

Input parameters — List mode

ParameterTypeRequiredDescription
warehouse_codeStringNoWarehouse code. If omitted, no warehouse filter is applied and purchase orders from all warehouses of the company are listed.
sinceStringOptionalQuery start date. Format: 'YYYY-MM-DDTHH:MM:SS-UTC' Example:'2016-07-12T20:00:00-03'. (Defaults to 30 days before)
untilStringOptionalQuery end date. Format: 'YYYY-MM-DDTHH:MM:SS-UTC' Example:'2016-07-12T20:00:00-03'. (Defaults to the current date).
pageIntegerOptionalPage number to query.
startIntegerOptionalStarting record number for the query.
limitIntegerOptionalEnding record number returned by the query.

Difference between modes

  • List mode (no id_movement in the URL): returns the header of each purchase order matching the filters, without the items or totals blocks.
  • Detail mode (id_movement in the URL): returns a single purchase order, with the header plus the items and totals blocks.

Output parameters

ParameterTypeDescription
id_movementIntegerMovement id
folio_sourceStringMovement id of the source warehouse
folio_targetStringMovement id of the destination warehouse
dateDateDelivery date
descriptionStringDescription of the entry.
documentStringReference
movements_types_descriptionStringMovement type
movements_states_descriptionStringMovement status description
warehouses_target_descriptionStringSource warehouse
warehouses_target_codeStringSource warehouse code
third_parties_nameStringThird party name
costs_center_descriptionStringCost center
responsible_descriptionStringResponsible party
priorities_descriptionStringPriority
date_createStringMovement creation date
third_parties_codeStringThird party code
third_parties_addressStringThird party address
third_parties_telephone_1StringThird party phone 1
third_parties_telephone_2StringThird party phone 2
third_parties_emailStringThird party email
number_detailsNumberNumber of items in the movement
id_movement_referenceIntegerId of the purchase order related to the material entry. Used to link a material entry record with a purchase order movement.
itemsArray of objectsItem detail of the purchase order. See the items structure below.
totalsObjectCalculated totals of the purchase order (subtotal, taxes, total). See the totals structure below.

items structure

Each element of the items array represents an item of the purchase order:

ParameterTypeDescription
codeStringItem code.
items_descriptionStringItem description.
units_descriptionStringUnit of measure description.
qtyNumberOrdered quantity.
qty_pendingNumberQuantity still pending to be received.
unit_costNumberUnit cost.
tax_nameString or nullName of the applied tax. null if the item has no tax assigned.
item_tax_rateNumberTax percentage. 0 when tax_name is null.

totals structure

ParameterTypeDescription
subtotalNumberSum of (qty × unit_cost) of all items, before taxes.
taxesArray of objectsBreakdown by tax type. See structure below.
totalNumberGrand total of the purchase order (subtotal + taxes).

Structure of each taxes element

ParameterTypeDescription
tax_nameStringTax name.
tax_rateNumberTax percentage.
tax_amountNumberCalculated tax amount for that type.

Notes:

  • If the purchase order has no items registered, items returns [] and totals returns { "subtotal": 0, "taxes": [], "total": 0 }.
  • If an item has no tax assigned, tax_name is null and item_tax_rate is 0.
  • Amounts are returned in the purchase order's own currency, without conversion (see currency_description / currency_symbol in the header).
  • The 22 existing header fields (table above) do not change — this is a backwards-compatible extension.

Errors

CodeCause
401Not authenticated.
404The specified warehouse_code does not exist (list mode, if sent).
404The specified id_movement does not exist (detail mode).

Example:

List mode

Request: (GET)https://app.fracttal.com/api/warehouse_purchase_orders/?warehouse_code=1254

{
    "success": true,
    "message": "200",
    "data": [
        {
            "id_movement": 2133,
            "folio_source": null,
            "folio_target": "TUER3640",
            "date": "2018-05-31",
            "description": null,
            "document": "PLAN JUNIO",
            "movements_types_description": "PURCHASE_ORDER",
            "movements_states_description": "NOT_DELIVERED",
            "warehouses_source_description": null,
            "warehouses_target_description": "ALMACEN",
            "third_parties_name": "Máchena",
            "costs_center_description": "PRODUCCIÓN",
            "costs_center_value": "11000",
            "responsible_description": " ",
            "conditions_description": "CREDITO 30 DIAS",
            "priorities_description": "VERY_HIGH",
            "date_create": "2018-05-25T16:15:09.253565+00:00",
            "third_parties_code": "234",
            "third_parties_address": null,
            "third_parties_telephone_1": "",
            "third_parties_telephone_2": "",
            "third_parties_email": null,
            "number_details": 1,
            "currency_description": "PESO CHILENO",
            "currency_symbol": "$",
            "id_movement_reference": 11111111,
            "items": [
                {
                    "code": "REP-001",
                    "items_description": "Rodamiento 6205",
                    "units_description": "Unidad",
                    "qty": 2,
                    "qty_pending": 0,
                    "unit_cost": 15000,
                    "tax_name": "IVA",
                    "item_tax_rate": 19
                }
            ],
            "totals": {
                "subtotal": 30000,
                "taxes": [
                    { "tax_name": "IVA", "tax_rate": 19, "tax_amount": 5700 }
                ],
                "total": 35700
            }
        }
    ],
    "total": 1
}

Example — purchase order with no items

{
    "success": true,
    "message": "200",
    "data": [
        {
            "id_movement": 2140,
            "folio_source": null,
            "folio_target": "TUER3651",
            "date": "2018-06-02",
            "description": null,
            "document": "PLAN JUNIO",
            "movements_types_description": "PURCHASE_ORDER",
            "movements_states_description": "NOT_DELIVERED",
            "warehouses_source_description": null,
            "warehouses_target_description": "ALMACEN",
            "third_parties_name": "Máchena",
            "costs_center_description": "PRODUCCIÓN",
            "costs_center_value": "11000",
            "responsible_description": " ",
            "conditions_description": "CREDITO 30 DIAS",
            "priorities_description": "VERY_HIGH",
            "date_create": "2018-06-01T10:05:00.000000+00:00",
            "third_parties_code": "234",
            "third_parties_address": null,
            "third_parties_telephone_1": "",
            "third_parties_telephone_2": "",
            "third_parties_email": null,
            "number_details": 0,
            "currency_description": "PESO CHILENO",
            "currency_symbol": "$",
            "id_movement_reference": 11111112,
            "items": [],
            "totals": {
                "subtotal": 0,
                "taxes": [],
                "total": 0
            }
        }
    ],
    "total": 1
}

Detail mode

Request: (GET)https://app.fracttal.com/api/warehouse_purchase_orders/53168742

{
    "success": true,
    "message": "200",
    "data": [
        {
            "id_movement": 53168742,
            "folio_source": null,
            "folio_target": "TUER4820",
            "date": "2026-08-15",
            "description": null,
            "document": "PLAN AGOSTO",
            "movements_types_description": "PURCHASE_ORDER",
            "movements_states_description": "NOT_DELIVERED",
            "warehouses_source_description": null,
            "warehouses_target_description": "ALMACEN",
            "third_parties_name": "Proveedor Ejemplo",
            "costs_center_description": "PRODUCCIÓN",
            "costs_center_value": "11000",
            "responsible_description": " ",
            "conditions_description": "CREDITO 30 DIAS",
            "priorities_description": "MEDIUM",
            "date_create": "2026-08-10T09:30:00.000000+00:00",
            "third_parties_code": "512",
            "third_parties_address": null,
            "third_parties_telephone_1": "",
            "third_parties_telephone_2": "",
            "third_parties_email": null,
            "number_details": 1,
            "currency_description": "PESO CHILENO",
            "currency_symbol": "$",
            "id_movement_reference": 22222222,
            "items": [
                {
                    "code": "REP-014",
                    "items_description": "Filtro de aceite",
                    "units_description": "Unidad",
                    "qty": 4,
                    "qty_pending": 4,
                    "unit_cost": 8500,
                    "tax_name": "IVA",
                    "item_tax_rate": 19
                }
            ],
            "totals": {
                "subtotal": 34000,
                "taxes": [
                    { "tax_name": "IVA", "tax_rate": 19, "tax_amount": 6460 }
                ],
                "total": 40460
            }
        }
    ],
    "total": 1
}

Response — Error (401 / 404)

{
    "success": false,
    "message": "404",
    "data": null
}

TEST CONNECTION

OpenAPI definition

{
  "openapi": "3.1.0",
  "info": {
    "title": "query-purchase-orders",
    "version": "2-En"
  },
  "servers": [
    {
      "url": "https://app.fracttal.com/api/warehouse_purchase_orders"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "Query purchase orders",
        "description": "This endpoint allows you to query the purchase orders of a warehouse created during a period of time.",
        "operationId": "query-purchase-orders",
        "parameters": [
          {
            "name": "warehouse_code",
            "in": "query",
            "required": false,
            "schema": { "type": "string" },
            "description": "Warehouse code. If omitted, no warehouse filter is applied."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": { "type": "string" }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": { "type": "string" }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer" }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": { "type": "integer" }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer" }
          }
        ],
        "deprecated": false,
        "security": []
      }
    },
    "/{id_movement}": {
      "get": {
        "summary": "Query the detail of a purchase order",
        "description": "Returns the header of a specific purchase order along with the items and totals blocks.",
        "operationId": "query-purchase-order-detail",
        "parameters": [
          {
            "name": "id_movement",
            "in": "path",
            "required": true,
            "schema": { "type": "integer" },
            "description": "Id of the Purchase Order."
          }
        ],
        "deprecated": false,
        "security": []
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
Path Params
string
required
Response

Language
LoadingLoading…