openapi: 3.2.0 info: title: Operations Hub Core.projects.billings API version: 0.1.1 description: '' servers: [] tags: - name: core.projects.billings paths: /api/core/v1/projects/{project_id}/billings: get: operationId: list_project_billings summary: List Billings for Project parameters: - in: path name: project_id schema: title: Project Id type: string required: true - in: query name: search schema: anyOf: - type: string - type: 'null' description: Search by name (case-insensitive) title: Search required: false description: Search by name (case-insensitive) - in: query name: sort schema: anyOf: - type: string - type: 'null' description: Sort by field (prefix with - for descending) title: Sort required: false description: Sort by field (prefix with - for descending) - in: query name: paginate schema: default: true description: Enable pagination (false returns all results) title: Paginate type: boolean required: false description: Enable pagination (false returns all results) - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ProjectBillingResponse' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' description: List all child items for a parent with pagination, search, and sorting. tags: - core.projects.billings security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: create_project_billing summary: Create Billing parameters: - in: path name: project_id schema: title: Project Id type: string required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ProjectBillingResponse' description: Create a new child item for the parent. tags: - core.projects.billings requestBody: content: application/json: schema: $ref: '#/components/schemas/ProjectBillingCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/core/v1/projects/{project_id}/billings/{billing_id}: get: operationId: get_project_billing summary: Get Billing parameters: - in: path name: project_id schema: title: Project Id type: string required: true - in: path name: billing_id schema: title: Billing Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ProjectBillingResponse' description: Get a single child item. tags: - core.projects.billings security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: update_project_billing summary: Update Billing parameters: - in: path name: project_id schema: title: Project Id type: string required: true - in: path name: billing_id schema: title: Billing Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ProjectBillingResponse' description: Update a child item. tags: - core.projects.billings requestBody: content: application/json: schema: $ref: '#/components/schemas/ProjectBillingUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: delete_project_billing summary: Delete Billing parameters: - in: path name: project_id schema: title: Project Id type: string required: true - in: path name: billing_id schema: title: Billing Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: Soft delete a child item. tags: - core.projects.billings security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: ProjectBillingResponse: additionalProperties: false description: Schema for ProjectBilling response. properties: updated_at: description: Last update timestamp format: date-time title: Updated At type: string id: description: Project billing ID title: Id type: integer project_id: description: Project ID title: Project Id type: integer billing_lead: anyOf: - $ref: '#/components/schemas/ProjectContactObject' - type: 'null' description: Project contact acting as billing lead address: anyOf: - type: string - type: 'null' description: Billing address title: Address address_state: anyOf: - type: string - type: 'null' description: Billing address state title: Address State invoice_recipient: anyOf: - $ref: '#/components/schemas/CustomerObject' - type: 'null' description: Customer receiving the invoice payment_terms_comment: anyOf: - type: string - type: 'null' description: Free-text comment for payment terms title: Payment Terms Comment payment_terms: anyOf: - type: string - type: 'null' description: Payment terms code title: Payment Terms purchase_order_required: anyOf: - type: boolean - type: 'null' description: Whether a purchase order is required title: Purchase Order Required purchase_order_number: anyOf: - type: string - type: 'null' description: Purchase order number title: Purchase Order Number purchase_order_value: anyOf: - type: number - type: string - type: 'null' description: Purchase order value title: Purchase Order Value currency: anyOf: - type: string - type: 'null' description: ISO 4217 currency code title: Currency invoicing_method: anyOf: - type: string - type: 'null' description: Invoicing method title: Invoicing Method invoicing_instructions: anyOf: - type: string - type: 'null' description: Invoicing instructions title: Invoicing Instructions invoicing_email: anyOf: - type: string - type: 'null' description: Invoicing email(s) title: Invoicing Email additional_invoice_approval_required: anyOf: - type: boolean - type: 'null' description: Whether an additional invoice approval is required title: Additional Invoice Approval Required invoice_approver_full_name: anyOf: - type: string - type: 'null' description: Invoice approver full name title: Invoice Approver Full Name invoice_approver_email: anyOf: - type: string - type: 'null' description: Invoice approver email title: Invoice Approver Email invoice_frequency: anyOf: - type: string - type: 'null' description: Invoice frequency title: Invoice Frequency sales_tax_exemption_certificate: anyOf: - type: boolean - type: 'null' description: Whether a sales tax exemption certificate applies title: Sales Tax Exemption Certificate sales_tax_exemption_certificate_number: anyOf: - type: string - type: 'null' description: Sales tax exemption certificate number title: Sales Tax Exemption Certificate Number receive_daily_reports: anyOf: - type: boolean - type: 'null' description: Answer to 'Would you like to receive daily reports?' title: Receive Daily Reports specific_report_requirements: anyOf: - type: boolean - type: 'null' description: Answer to 'Specific report requirements?' title: Specific Report Requirements receive_draft_charge_statements: anyOf: - type: boolean - type: 'null' description: Answer to 'Do you want to receive draft charge statements?' title: Receive Draft Charge Statements draft_charge_statement_frequency: anyOf: - enum: - WEEKLY - MONTHLY type: string - type: 'null' description: Draft charge statement delivery frequency title: Draft Charge Statement Frequency vendor: anyOf: - $ref: '#/components/schemas/VendorObject' - type: 'null' description: Vendor required: - updated_at - id - project_id title: ProjectBillingResponse type: object ProjectContactRole: description: 'All possible roles for ProjectContact (used in responses). Note: The backend historically uses the typo''d value REPORT_RECEPIENT and we intentionally preserve it for API compatibility.' enum: - PRIMARY_CONTACT - REPORT_RECEPIENT - INVOICE_APPROVER - SITE_CONTACT - QHSE_CONTACT title: ProjectContactRole type: string CustomerObject: additionalProperties: false description: Nested customer object for responses (no timestamps). properties: id: title: Id type: integer number: anyOf: - type: string - type: 'null' title: Number display_name: title: Display Name type: string netsuite_customer_id: anyOf: - type: integer - type: 'null' description: NetSuite customer ID title: Netsuite Customer Id currency: anyOf: - $ref: '#/components/schemas/CurrencyIdCodeObject' - type: 'null' description: Customer currency (id and code only) required: - id - display_name title: CustomerObject type: object CurrencyIdCodeObject: additionalProperties: false description: Nested currency object with only id and code (no timestamps). properties: id: title: Id type: integer code: title: Code type: string required: - id - code title: CurrencyIdCodeObject type: object ProjectContactObject: additionalProperties: false description: Nested project contact object for Project response (no timestamps). properties: id: title: Id type: integer role: anyOf: - $ref: '#/components/schemas/ProjectContactRole' - type: 'null' customer_contact_name: anyOf: - type: string - type: 'null' title: Customer Contact Name customer_type: title: Customer Type type: string required: - id - customer_type title: ProjectContactObject type: object Error: additionalProperties: false description: Error response schema. properties: code: $ref: '#/components/schemas/ErrorCode' message: title: Message type: string required: - code - message title: Error type: object ProjectBillingCreate: additionalProperties: false description: Schema for creating a ProjectBilling. properties: billing_lead_id: anyOf: - type: integer - type: 'null' description: Project contact acting as billing lead title: Billing Lead Id address: anyOf: - type: string - type: 'null' description: Billing address title: Address address_state: anyOf: - type: string - type: 'null' description: Billing address state title: Address State invoice_recipient_id: anyOf: - type: integer - type: 'null' description: Customer receiving the invoice title: Invoice Recipient Id payment_terms_comment: anyOf: - type: string - type: 'null' description: Free-text comment for payment terms title: Payment Terms Comment payment_terms: anyOf: - type: string - type: 'null' description: Payment terms code title: Payment Terms purchase_order_required: anyOf: - type: boolean - type: 'null' description: Whether a purchase order is required title: Purchase Order Required purchase_order_number: anyOf: - type: string - type: 'null' description: Purchase order number title: Purchase Order Number purchase_order_value: anyOf: - type: number - type: string - type: 'null' description: Purchase order value title: Purchase Order Value currency: anyOf: - type: string - type: 'null' description: ISO 4217 currency code title: Currency invoicing_method: anyOf: - type: string - type: 'null' description: Invoicing method title: Invoicing Method invoicing_instructions: anyOf: - type: string - type: 'null' description: Invoicing instructions title: Invoicing Instructions invoicing_email: anyOf: - type: string - type: 'null' description: Invoicing email(s) title: Invoicing Email additional_invoice_approval_required: anyOf: - type: boolean - type: 'null' description: Whether an additional invoice approval is required title: Additional Invoice Approval Required invoice_approver_full_name: anyOf: - type: string - type: 'null' description: Invoice approver full name title: Invoice Approver Full Name invoice_approver_email: anyOf: - type: string - type: 'null' description: Invoice approver email title: Invoice Approver Email invoice_frequency: anyOf: - type: string - type: 'null' description: Invoice frequency title: Invoice Frequency sales_tax_exemption_certificate: anyOf: - type: boolean - type: 'null' description: Whether a sales tax exemption certificate applies title: Sales Tax Exemption Certificate sales_tax_exemption_certificate_number: anyOf: - type: string - type: 'null' description: Sales tax exemption certificate number title: Sales Tax Exemption Certificate Number receive_daily_reports: anyOf: - type: boolean - type: 'null' description: Answer to 'Would you like to receive daily reports?' title: Receive Daily Reports specific_report_requirements: anyOf: - type: boolean - type: 'null' description: Answer to 'Specific report requirements?' title: Specific Report Requirements receive_draft_charge_statements: anyOf: - type: boolean - type: 'null' description: Answer to 'Do you want to receive draft charge statements?' title: Receive Draft Charge Statements draft_charge_statement_frequency: anyOf: - enum: - WEEKLY - MONTHLY type: string - type: 'null' description: Draft charge statement delivery frequency title: Draft Charge Statement Frequency vendor_id: anyOf: - type: integer - type: 'null' description: Vendor ID title: Vendor Id title: ProjectBillingCreate type: object ProjectBillingUpdate: additionalProperties: false description: Schema for updating a ProjectBilling (partial). properties: billing_lead_id: anyOf: - type: integer - type: 'null' description: Project contact acting as billing lead title: Billing Lead Id address: anyOf: - type: string - type: 'null' description: Billing address title: Address address_state: anyOf: - type: string - type: 'null' description: Billing address state title: Address State invoice_recipient_id: anyOf: - type: integer - type: 'null' description: Customer receiving the invoice title: Invoice Recipient Id payment_terms_comment: anyOf: - type: string - type: 'null' description: Free-text comment for payment terms title: Payment Terms Comment payment_terms: anyOf: - type: string - type: 'null' description: Payment terms code title: Payment Terms purchase_order_required: anyOf: - type: boolean - type: 'null' description: Whether a purchase order is required title: Purchase Order Required purchase_order_number: anyOf: - type: string - type: 'null' description: Purchase order number title: Purchase Order Number purchase_order_value: anyOf: - type: number - type: string - type: 'null' description: Purchase order value title: Purchase Order Value currency: anyOf: - type: string - type: 'null' description: ISO 4217 currency code title: Currency invoicing_method: anyOf: - type: string - type: 'null' description: Invoicing method title: Invoicing Method invoicing_instructions: anyOf: - type: string - type: 'null' description: Invoicing instructions title: Invoicing Instructions invoicing_email: anyOf: - type: string - type: 'null' description: Invoicing email(s) title: Invoicing Email additional_invoice_approval_required: anyOf: - type: boolean - type: 'null' description: Whether an additional invoice approval is required title: Additional Invoice Approval Required invoice_approver_full_name: anyOf: - type: string - type: 'null' description: Invoice approver full name title: Invoice Approver Full Name invoice_approver_email: anyOf: - type: string - type: 'null' description: Invoice approver email title: Invoice Approver Email invoice_frequency: anyOf: - type: string - type: 'null' description: Invoice frequency title: Invoice Frequency sales_tax_exemption_certificate: anyOf: - type: boolean - type: 'null' description: Whether a sales tax exemption certificate applies title: Sales Tax Exemption Certificate sales_tax_exemption_certificate_number: anyOf: - type: string - type: 'null' description: Sales tax exemption certificate number title: Sales Tax Exemption Certificate Number receive_daily_reports: anyOf: - type: boolean - type: 'null' description: Answer to 'Would you like to receive daily reports?' title: Receive Daily Reports specific_report_requirements: anyOf: - type: boolean - type: 'null' description: Answer to 'Specific report requirements?' title: Specific Report Requirements receive_draft_charge_statements: anyOf: - type: boolean - type: 'null' description: Answer to 'Do you want to receive draft charge statements?' title: Receive Draft Charge Statements draft_charge_statement_frequency: anyOf: - enum: - WEEKLY - MONTHLY type: string - type: 'null' description: Draft charge statement delivery frequency title: Draft Charge Statement Frequency vendor_id: anyOf: - type: integer - type: 'null' description: Vendor ID title: Vendor Id title: ProjectBillingUpdate type: object VendorObject: additionalProperties: false description: Nested vendor object for responses (no timestamps). properties: id: title: Id type: integer number: anyOf: - type: string - type: 'null' title: Number display_name: title: Display Name type: string required: - id - display_name title: VendorObject type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer