# Create accounting integration Create a new accounting integration. The behavior depends on the existing active integration: - If no active integration exists: Creates and returns new integration - If active integration exists with same vendor and vendor_account_id: Returns the existing active integration - If active integration exists with same vendor but different vendor_account_id: Returns 409 error - If active integration exists with different vendor: Returns 409 error This ensures only one active integration exists per account. Endpoint: POST /v3/accounting/integration Version: 1.0.0-alpha Security: oauth2 ## Request fields (application/json): - `vendor` (string, required) The accounting vendor/system. ERP partners must request Brex to create a vendor ID for them to use this field. Example: "ERP_A" - `vendor_account_id` (string, required) The vendor account ID to tie this integration to Example: "vendor_account_id" ## Response 200 fields (application/json): - `integration_id` (string, required) Unique identifier for the integration Example: "int_abc123" - `vendor` (string, required) The accounting vendor/system. ERP partners must request Brex to create a vendor ID for them to use this field. - `vendor_account_id` (string, required) The vendor account ID this integration is tied to Example: "customer_account_id" - `status` (string, required) Current status of the integration Enum: "ACTIVE", "DISABLED" - `created_at` (string, required) Timestamp when the integration was created Example: "2025-08-15T10:00:00Z" ## Response 400 fields (application/json): - `error_code` (string, required) Machine-readable error code Enum: "ACTIVE_INTEGRATION_EXISTS", "FORBIDDEN", "INTEGRATION_NOT_ACTIVE", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "UNAUTHORIZED", "DUPLICATE_ACCOUNTING_RECORD_IDS", "ACCOUNTING_RECORD_NOT_READY_FOR_EXPORT", "VENDOR_ACCOUNT_ID_MISMATCH" - `message` (string, required) Human-readable error message Example: "The request is malformed or contains invalid data." - `details` (object,null) Additional error context - `details.existing_integration_id` (string) ID of the existing active integration Example: "int_abc123" - `details.existing_vendor` (string) Vendor of the existing integration Example: "ERP_A" - `details.requested_vendor` (string) Vendor that was requested to be created Example: "ERP_B" - `details.integration_id` (string) Integration ID associated with the error Example: "int_abc123" - `details.current_status` (string) Current status of the integration when the error occurred Example: "DISABLED" - `details.duplicate_accounting_record_ids` (array) Accounting record IDs that triggered the error Example: ["accr_abc123","accr_def456"] - `details.not_ready_for_export_accounting_record_ids` (array) Accounting record IDs that are not ready for export Example: ["accr_ghi789"] - `details.not_found_export_entry_source_ids` (array) Accounting record IDs that could not be found Example: ["accr_ghi789"] ## Response 401 fields (application/json): - `error_code` (string, required) Machine-readable error code Enum: "ACTIVE_INTEGRATION_EXISTS", "FORBIDDEN", "INTEGRATION_NOT_ACTIVE", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "UNAUTHORIZED", "DUPLICATE_ACCOUNTING_RECORD_IDS", "ACCOUNTING_RECORD_NOT_READY_FOR_EXPORT", "VENDOR_ACCOUNT_ID_MISMATCH" - `message` (string, required) Human-readable error message Example: "The request is malformed or contains invalid data." - `details` (object,null) Additional error context - `details.existing_integration_id` (string) ID of the existing active integration Example: "int_abc123" - `details.existing_vendor` (string) Vendor of the existing integration Example: "ERP_A" - `details.requested_vendor` (string) Vendor that was requested to be created Example: "ERP_B" - `details.integration_id` (string) Integration ID associated with the error Example: "int_abc123" - `details.current_status` (string) Current status of the integration when the error occurred Example: "DISABLED" - `details.duplicate_accounting_record_ids` (array) Accounting record IDs that triggered the error Example: ["accr_abc123","accr_def456"] - `details.not_ready_for_export_accounting_record_ids` (array) Accounting record IDs that are not ready for export Example: ["accr_ghi789"] - `details.not_found_export_entry_source_ids` (array) Accounting record IDs that could not be found Example: ["accr_ghi789"] ## Response 403 fields (application/json): - `error_code` (string, required) Machine-readable error code Enum: "ACTIVE_INTEGRATION_EXISTS", "FORBIDDEN", "INTEGRATION_NOT_ACTIVE", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "UNAUTHORIZED", "DUPLICATE_ACCOUNTING_RECORD_IDS", "ACCOUNTING_RECORD_NOT_READY_FOR_EXPORT", "VENDOR_ACCOUNT_ID_MISMATCH" - `message` (string, required) Human-readable error message Example: "The request is malformed or contains invalid data." - `details` (object,null) Additional error context - `details.existing_integration_id` (string) ID of the existing active integration Example: "int_abc123" - `details.existing_vendor` (string) Vendor of the existing integration Example: "ERP_A" - `details.requested_vendor` (string) Vendor that was requested to be created Example: "ERP_B" - `details.integration_id` (string) Integration ID associated with the error Example: "int_abc123" - `details.current_status` (string) Current status of the integration when the error occurred Example: "DISABLED" - `details.duplicate_accounting_record_ids` (array) Accounting record IDs that triggered the error Example: ["accr_abc123","accr_def456"] - `details.not_ready_for_export_accounting_record_ids` (array) Accounting record IDs that are not ready for export Example: ["accr_ghi789"] - `details.not_found_export_entry_source_ids` (array) Accounting record IDs that could not be found Example: ["accr_ghi789"] ## Response 409 fields (application/json): - `error_code` (string, required) Machine-readable error code Enum: "ACTIVE_INTEGRATION_EXISTS", "FORBIDDEN", "INTEGRATION_NOT_ACTIVE", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "UNAUTHORIZED", "DUPLICATE_ACCOUNTING_RECORD_IDS", "ACCOUNTING_RECORD_NOT_READY_FOR_EXPORT", "VENDOR_ACCOUNT_ID_MISMATCH" - `message` (string, required) Human-readable error message Example: "The request is malformed or contains invalid data." - `details` (object,null) Additional error context - `details.existing_integration_id` (string) ID of the existing active integration Example: "int_abc123" - `details.existing_vendor` (string) Vendor of the existing integration Example: "ERP_A" - `details.requested_vendor` (string) Vendor that was requested to be created Example: "ERP_B" - `details.integration_id` (string) Integration ID associated with the error Example: "int_abc123" - `details.current_status` (string) Current status of the integration when the error occurred Example: "DISABLED" - `details.duplicate_accounting_record_ids` (array) Accounting record IDs that triggered the error Example: ["accr_abc123","accr_def456"] - `details.not_ready_for_export_accounting_record_ids` (array) Accounting record IDs that are not ready for export Example: ["accr_ghi789"] - `details.not_found_export_entry_source_ids` (array) Accounting record IDs that could not be found Example: ["accr_ghi789"] ## Response 500 fields (application/json): - `error_code` (string, required) Machine-readable error code Enum: "ACTIVE_INTEGRATION_EXISTS", "FORBIDDEN", "INTEGRATION_NOT_ACTIVE", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "UNAUTHORIZED", "DUPLICATE_ACCOUNTING_RECORD_IDS", "ACCOUNTING_RECORD_NOT_READY_FOR_EXPORT", "VENDOR_ACCOUNT_ID_MISMATCH" - `message` (string, required) Human-readable error message Example: "The request is malformed or contains invalid data." - `details` (object,null) Additional error context - `details.existing_integration_id` (string) ID of the existing active integration Example: "int_abc123" - `details.existing_vendor` (string) Vendor of the existing integration Example: "ERP_A" - `details.requested_vendor` (string) Vendor that was requested to be created Example: "ERP_B" - `details.integration_id` (string) Integration ID associated with the error Example: "int_abc123" - `details.current_status` (string) Current status of the integration when the error occurred Example: "DISABLED" - `details.duplicate_accounting_record_ids` (array) Accounting record IDs that triggered the error Example: ["accr_abc123","accr_def456"] - `details.not_ready_for_export_accounting_record_ids` (array) Accounting record IDs that are not ready for export Example: ["accr_ghi789"] - `details.not_found_export_entry_source_ids` (array) Accounting record IDs that could not be found Example: ["accr_ghi789"]