Purchase Orders Service
The `PurchaseOrdersService` provides a dedicated method for creating Purchase Order records in Acumatica.
Importing Helpers
To create a purchase order, you will need to import the `PurchaseOrderBuilder` and, optionally, `QueryOptions`.
from easy_acumatica.models.purchase_order_builder import PurchaseOrderBuilder
from easy_acumatica.models.query_builder import QueryOptions
Service Method
create_purchase_order(api_version, builder, options=None)
This method creates a new Purchase Order. You must provide a `PurchaseOrderBuilder` object containing the purchase order details. You can use the builder to set top-level fields like the `VendorID` and add detail lines for each item being purchased.
# 1. Build the purchase order payload
po_payload = (
PurchaseOrderBuilder()
.vendor_id("GOODFRUITS")
.location("MAIN")
.add_detail(
BranchID="HEADOFFICE",
InventoryID="APPLES",
OrderQty=100,
UOM="LB"
)
.hold(False)
)
# 2. Use the service to create the purchase order
new_po = client.purchase_orders.create_purchase_order(
"24.200.001",
builder=po_payload
)
ON THIS PAGE
Introduction
Importing Helpers
Service Method
- create_purchase_order