{"openapi":"3.1.0","info":{"title":"PUT /api/v1/vendors/{id}","version":"1.0.0","description":"Update vendor"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/vendors/{id}":{"put":{"tags":["vendors"],"summary":"Update vendor","description":"Update vendor contact information.","operationId":"update_vendor_api_v1_vendors__id__put","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CounterpartyStatus":{"type":"string","enum":["active","inactive","blocked"],"title":"CounterpartyStatus","description":"Status values for customers and vendors."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VendorContactResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Contact UUID."},"vendor_id":{"type":"string","title":"Vendor Id","description":"Vendor UUID."},"name":{"type":"string","title":"Name","description":"Contact name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Contact phone."},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"Contact role (e.g., 'Sales', 'Support')."},"is_primary":{"type":"boolean","title":"Is Primary","description":"Whether this is the primary contact.","default":false},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about this contact."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","vendor_id","name","created_at","updated_at"],"title":"VendorContactResponse","description":"Response schema for a vendor contact."},"VendorResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Vendor UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"name":{"type":"string","title":"Name","description":"Vendor name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Vendor email address."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Vendor business address."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Vendor phone number."},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id","description":"Tax identification number."},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","description":"Vendor website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal notes."},"credit_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Limit Cents","description":"Credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Default payment term ID."},"status":{"type":"string","title":"Status","description":"Vendor status.","default":"active"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Business category."},"default_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Location Id","description":"Default ship-from location ID for purchase orders."},"default_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Location Name","description":"Default ship-from location name (resolved)."},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether vendor is soft deleted.","default":false},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Timestamp when vendor was deleted."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"contacts":{"anyOf":[{"items":{"$ref":"#/components/schemas/VendorContactResponse"},"type":"array"},{"type":"null"}],"title":"Contacts","description":"Vendor contacts."}},"additionalProperties":true,"type":"object","required":["id","business_id","name","created_at","updated_at"],"title":"VendorResponse","description":"Response schema for a vendor.\n\nVendors are companies or individuals you purchase from.\nThey are linked to bills for expense tracking.","example":{"address":"123 Industrial Way, Oakland, CA 94612","business_id":"019ab37c-bus1-7000-8000-000000000001","category":"Raw Materials","created_at":"2024-01-10T10:30:00Z","email":"orders@acmesupplies.com","id":"019ab37c-vend-7000-8000-000000000001","name":"Acme Supplies","phone":"(555) 987-6543","status":"active","tax_id":"98-7654321","updated_at":"2024-01-15T14:00:00Z"}},"VendorUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated vendor name."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Updated email address."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Updated address."},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone","description":"Updated phone number."},"tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Tax Id","description":"Updated tax ID."},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website","description":"Updated website URL."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Updated internal notes."},"credit_limit_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Credit Limit Cents","description":"Updated credit limit in cents."},"default_payment_term_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Term Id","description":"Updated default payment term ID."},"status":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyStatus"},{"type":"null"}],"description":"Updated status."},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Updated category."}},"type":"object","title":"VendorUpdateRequest","description":"Request schema for updating a vendor.\n\nAll fields are optional - only include fields you want to change.","example":{"address":"456 Industrial Way, Suite 200, Oakland, CA 94612","credit_limit_cents":500000,"name":"Acme Supplies Inc."}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}