# List purchase orders Retrieve purchase orders for a project Endpoint: GET /projects/{projectId}/purchaseOrders Version: 1.0.0 Security: ApiKeyAuth ## Path parameters: - `projectId` (string, required) Project identifier (alias or ID) Example: "nike-spring-2024" ## Query parameters: - `accountId` (any) Filter by account ID(s) or codes Example: ["2150"] - `startDate` (string) Return results on or after this date (ISO 8601) Example: "2024-01-01" - `endDate` (string) Return results on or before this date (ISO 8601) Example: "2024-01-31" - `hasAttachments` (boolean) Filter by whether attachments are present Example: true - `status` (any) Filter by purchase order status Example: ["approved","pending"] - `expands` (array) Include related data in the response Enum: "contact", "actuals", "items", "items.account" - `idMode` (string) ID interpretation mode. Controls how path and query parameter IDs (like lineId, accountId, phaseId) are interpreted - 'user' for human-readable IDs (account codes, phase names), 'system' for database IDs (UUIDs/nanoids). Also affects the format of IDs in responses. Enum: "user", "system" ## Response 200 fields (application/json): - `purchaseOrders` (array, required) - `purchaseOrders.id` (string, required) Purchase order identifier Example: "po-2024-001" - `purchaseOrders.purchaseOrderId` (string,null) Purchase order number Example: "PO-NIKE-2024-001" - `purchaseOrders.title` (string,null) Purchase order title Example: "Camera Equipment Rental" - `purchaseOrders.date` (string,null) Purchase order date Example: "2024-03-15T12:00:00Z" - `purchaseOrders.amount` (number, required) Total amount Example: 25000 - `purchaseOrders.paidAmount` (number, required) Amount paid Example: 12500 - `purchaseOrders.status` (string, required) Purchase order status Enum: "draft", "approved", "rejected", "pending", "paid" - `purchaseOrders.attachments` (array) Attached files - `purchaseOrders.attachments.id` (string, required) File identifier (DigitalOcean Spaces object key) Example: "files/2024/03/budget-report.pdf" - `purchaseOrders.attachments.name` (string, required) Original filename Example: "call-sheet-day-3.pdf" - `purchaseOrders.attachments.type` (string, required) MIME type Example: "application/pdf" - `purchaseOrders.attachments.size` (integer, required) File size in bytes Example: 1048576 - `purchaseOrders.notes` (string,null) Additional notes Example: "Equipment rental for 3-day shoot at downtown location" - `purchaseOrders.items` (array) Line items - `purchaseOrders.items.id` (string, required) Item identifier Example: "po-item-001" - `purchaseOrders.items.description` (string,null) Item description Example: "RED Komodo Camera Kit - 5 days" - `purchaseOrders.items.quantity` (number, required) Item quantity Example: 10 - `purchaseOrders.items.unitPrice` (number, required) Price per unit Example: 125 - `purchaseOrders.items.totalPrice` (number, required) Total line price Example: 1250 - `purchaseOrders.items.accountId` (string,null) Associated account ID Example: "/production/camera" - `purchaseOrders.items.account` (object) - `purchaseOrders.items.account.type` (string, required) Type of budget line Enum: "line", "account", "subtotal", "markup", "fringes" - `purchaseOrders.items.account.id` (string, required) Budget line identifier (system ID) Example: "line-001" - `purchaseOrders.items.account.accountId` (string,null) Account identifier (user-friendly ID like account code) Example: "2150" - `purchaseOrders.items.account.description` (string,null) Budget line description Example: "RED Camera Package Rental" - `purchaseOrders.items.account.path` (string, required) Hierarchical path in budget tree (e.g., /2000/2150) Example: "/production/equipment/cameras" - `purchaseOrders.items.account.totals` (object, required) Calculated totals for each phase Example: {"estimate":25000,"actual":22500,"variance":2500} - `purchaseOrders.items.account.tags` (array) Tags for categorization and filtering Example: ["Day-1","A-Camera","Equipment"] - `purchaseOrders.items.account.contact` (object) - `purchaseOrders.items.account.contact.id` (string, required) Contact identifier Example: "contact-studio-001" - `purchaseOrders.items.account.contact.contactTitle` (string,null) Contact display title Example: "Sunset Studios - Production Company" - `purchaseOrders.items.account.contact.name` (string,null) Contact name Example: "Alex Rivera" - `purchaseOrders.items.account.contact.email` (string,null) Contact email address Example: "alex.rivera@sunsetstudios.com" - `purchaseOrders.items.account.contact.company` (string,null) Contact company Example: "Sunset Studios Inc." - `purchaseOrders.items.account.contact.type` (string,null) Contact type (Person, Company, etc.) Example: "Person" - `purchaseOrders.items.account.contact.jobTitle` (string,null) Contact job title Example: "Director of Photography" - `purchaseOrders.items.account.contact.rate` (number,null) Contact hourly rate Example: 150 - `purchaseOrders.items.account.contact.secureInfo` (object) - `purchaseOrders.items.account.contact.secureInfo.address` (string,null) Contact address Example: "123 Sunset Blvd, Los Angeles, CA 90028" - `purchaseOrders.items.account.contact.secureInfo.phone` (string,null) Contact phone number Example: "310-555-1234" - `purchaseOrders.items.account.contact.secureInfo.taxIdLast4` (string,null) Last 4 digits of tax ID Example: "4567" - `purchaseOrders.items.account.contact.origin` (object) - `purchaseOrders.items.account.contact.origin.origin` (string,null) How the contact was created Enum: "onboarding", "manual" - `purchaseOrders.items.account.contact.origin.createdAt` (string,null) Contact creation timestamp Example: "2024-02-15T08:00:00Z" - `purchaseOrders.items.account.contact.origin.createdByUser` (object) - `purchaseOrders.items.account.contact.origin.createdByUser.id` (string, required) User identifier Example: "user-001" - `purchaseOrders.items.account.contact.origin.createdByUser.name` (string, required) User name Example: "Sarah Chen" - `purchaseOrders.items.account.contact.origin.createdByUser.email` (string, required) User email address Example: "sarah.chen@sunsetstudios.com" - `purchaseOrders.items.account.contact.startwork` (array) Startwork agreements - `purchaseOrders.items.account.contact.startwork.id` (string, required) Startwork agreement identifier Example: "startwork-001" - `purchaseOrders.items.account.contact.startwork.title` (string, required) Agreement title Example: "Independent Contractor Agreement" - `purchaseOrders.items.account.contact.startwork.signedOn` (string, required) Signature timestamp Example: "2024-03-01T10:00:00Z" - `purchaseOrders.items.account.contact.linkedUser` (object) - `purchaseOrders.items.account.contact.bankInfo` (array) Banking information - `purchaseOrders.items.account.contact.bankInfo.id` (string, required) Bank account identifier Example: "bank-acc-001" - `purchaseOrders.items.account.contact.bankInfo.bankName` (string, required) Bank name Example: "Chase Bank" - `purchaseOrders.items.account.contact.bankInfo.accountType` (string, required) Account type (checking, savings, etc.) Example: "checking" - `purchaseOrders.items.account.contact.bankInfo.accountLast4` (string, required) Last 4 digits of account number Example: "4567" - `purchaseOrders.items.account.contact.taxDocuments` (array) Tax documents - `purchaseOrders.items.account.contact.attachments` (array) File attachments - `purchaseOrders.items.account.contact.projects` (object) Associated projects - `purchaseOrders.items.account.phaseData` (object) Detailed phase-specific data (expandable) - `purchaseOrders.actuals` (array) Associated actual entries - `purchaseOrders.actuals.id` (string, required) Actual entry identifier Example: "actual-001" - `purchaseOrders.actuals.description` (string,null) Actual entry description Example: "Camera rental for shoot days" - `purchaseOrders.actuals.amount` (number,null) Actual amount Example: 5250 - `purchaseOrders.actuals.date` (string,null) Actual entry date Example: "2024-03-15T12:00:00Z" - `purchaseOrders.actuals.accountId` (any) Associated account ID(s) - `purchaseOrders.actuals.expanded` (boolean, required) Whether this actual has sub-actuals - `purchaseOrders.actuals.type` (string) Actual entry type Example: "invoice" - `purchaseOrders.actuals.ref` (string,null) Reference identifier Example: "INV-2024-0315" - `purchaseOrders.actuals.payId` (string,null) Payment identifier Example: "pay-xyz-789" - `purchaseOrders.actuals.status` (string) Actual entry status Example: "completed" - `purchaseOrders.actuals.tags` (array) Associated tags - `purchaseOrders.actuals.purchaseOrderId` (string,null) Associated purchase order ID Example: "po-2024-001" - `purchaseOrders.actuals.transactionId` (string,null) Associated transaction ID Example: "txn-abc-123" - `purchaseOrders.actuals.subactuals` (array) Sub-actual entries - `purchaseOrders.actuals.subactuals.id` (string, required) Sub-actual identifier Example: "subactual-001" - `purchaseOrders.actuals.subactuals.description` (string,null) Sub-actual description Example: "Lighting equipment rental" - `purchaseOrders.actuals.subactuals.amount` (number, required) Sub-actual amount Example: 2500 - `purchaseOrders.actuals.subactuals.date` (string,null) Sub-actual date Example: "2024-03-10T09:00:00Z" ## Response 401 fields (application/json): - `error` (string, required) Error message Example: "Invalid request parameters" - `details` (object) Additional error details Example: {"field":"projectId","reason":"Project not found"} - `code` (string) Error code Example: "VALIDATION_ERROR" ## Response 404 fields (application/json): - `error` (string, required) Error message Example: "Invalid request parameters" - `details` (object) Additional error details Example: {"field":"projectId","reason":"Project not found"} - `code` (string) Error code Example: "VALIDATION_ERROR" ## Response 500 fields (application/json): - `error` (string, required) Error message Example: "Invalid request parameters" - `details` (object) Additional error details Example: {"field":"projectId","reason":"Project not found"} - `code` (string) Error code Example: "VALIDATION_ERROR"