{"openapi":"3.1.0","info":{"title":"GET /api/v1/customers/{customer_id}","version":"1.0.0","description":"Get customer"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/customers/{customer_id}":{"get":{"tags":["customers"],"summary":"Get customer","description":"Retrieve a specific customer by their unique ID.","operationId":"get_customer","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer 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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CustomerResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"get_customer_api_v1_customers__customer_id__get"}}},"components":{"schemas":{"CustomerContactResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Contact UUID."},"customer_id":{"type":"string","title":"Customer Id","description":"Customer 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., 'Billing', 'Technical')."},"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","customer_id","name","created_at","updated_at"],"title":"CustomerContactResponse","description":"Response schema for a customer contact."},"CustomerResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Customer UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"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."},"name":{"type":"string","title":"Name","description":"Customer name."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Customer email."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Customer address."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Customer 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":"Customer 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":"Customer status.","default":"active"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Business category."},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether customer is soft deleted.","default":false},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Timestamp when customer was deleted."},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id","description":"Linked Stripe customer ID."},"registry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Id","description":"Counterparty registry entry this customer is linked to; null when unlinked."},"registry_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Name","description":"Canonical name of the linked registry entry (resolved)."},"invoice_footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Footer","description":"Custom invoice footer/payment instructions for this customer."},"contacts":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomerContactResponse"},"type":"array"},{"type":"null"}],"title":"Contacts","description":"Customer contacts."}},"additionalProperties":true,"type":"object","required":["id","business_id","created_at","updated_at","name"],"title":"CustomerResponse","description":"Response schema for a customer.\n\nContains customer details and any linked external IDs.","example":{"address":"123 Main Street, Suite 100, San Francisco, CA 94102","business_id":"019ab37c-b051-7000-8000-000000000001","category":"Wholesale","created_at":"2024-01-10T10:30:00Z","credit_limit_cents":1000000,"email":"billing@acme.com","id":"019ab37c-c057-7000-8000-000000000001","name":"Acme Corporation","phone":"(555) 123-4567","status":"active","stripe_customer_id":"cus_Abc123XYZ","tax_id":"12-3456789","updated_at":"2024-01-15T14:00:00Z","website":"https://acme.com"},"examples":[{"address":"123 Main Street, Suite 100, San Francisco, CA 94102","business_id":"019ab37c-b051-7000-8000-000000000001","category":"Wholesale","created_at":"2024-01-10T10:30:00Z","credit_limit_cents":1000000,"email":"billing@acme.com","id":"019ab37c-c057-7000-8000-000000000001","name":"Acme Corporation","phone":"(555) 123-4567","status":"active","stripe_customer_id":"cus_Abc123XYZ","tax_id":"12-3456789","updated_at":"2024-01-15T14:00:00Z","website":"https://acme.com"}]},"SuccessEnvelope_CustomerResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CustomerResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CustomerResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}