> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nmbr.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Import a partner-supplied OAuth connection

> Register a QuickBooks or Xero connection using OAuth tokens the partner obtained directly from the provider. Pair with the partner integration credentials configured by support.



## OpenAPI

````yaml /spec/openapi.json post /integrations/{integration}/connection
openapi: 3.0.0
info:
  title: Nmbr API
  description: API to interact with Nmbr Payroll
  version: 1.0.0
servers:
  - url: https://sandbox.nmbr.co/services/payroll
security:
  - CompanyToken: []
tags:
  - name: Accounting Codes
  - name: Accounting Code Rules
  - name: Adjustments
  - name: Allowances
  - name: Allowance Line Items
  - name: Allowance Types
  - name: Async Tasks
  - name: Bank Accounts
  - name: Business Entities
  - name: Business Entity Verifications
  - name: Business Entity ROE Authorizations
  - name: Business Presets
  - name: Calculations
  - name: Companies
  - name: Contractors
  - name: Deductions
  - name: Deduction Line Items
  - name: Deduction Types
  - name: Earnings
  - name: Earning Line Items
  - name: Earning Types
  - name: Effective Tax Properties
  - name: Employees
  - name: Employee Benefits
  - name: Employee Benefit Line Items
  - name: Employee Benefit Types
  - name: Employer Benefits
  - name: Employer Benefit Line Items
  - name: Employer Benefit Types
  - name: Employer Statutory Withholding Line Items
  - name: Employer Statutory Withholding Types
  - name: Forms
  - name: Form Batches
  - name: Form Types
  - name: Holidays
  - name: Integrations
  - name: Journal Entries
  - name: Overtime Rates
  - name: Partners
  - name: Pay Rates
  - name: Pay Schedules
  - name: Pay Splits
  - name: Pay Stubs
  - name: Payments
  - name: Payrolls
  - name: Reimbursements
  - name: Reimbursement Line Items
  - name: Reimbursement Types
  - name: Remittance Accounts
  - name: Remittance Account Enrollments
  - name: Reports
  - name: Statutory Withholding Line Items
  - name: Statutory Withholding Types
  - name: Tags
  - name: Tag Groups
  - name: Tax Properties
  - name: Tax Property Templates
  - name: Tokens
  - name: Usage Records
  - name: Usage Summaries
  - name: Vacation Pay
  - name: Vacation Pay Settings
  - name: Webhooks
  - name: Work Assignments
paths:
  /integrations/{integration}/connection:
    post:
      tags:
        - Integrations
      summary: Import a partner-supplied OAuth connection
      description: >-
        Register a QuickBooks or Xero connection using OAuth tokens the partner
        obtained directly from the provider. Pair with the partner integration
        credentials configured by support.
      operationId: integrations-connection
      parameters:
        - name: integration
          in: path
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    business_entity_id:
                      type: string
                    access_token:
                      type: string
                      description: >-
                        OAuth access token issued by the partner's QBO/Xero app
                        for the customer.
                    access_token_expires_in:
                      type: number
                      description: Lifetime of the access token, in seconds.
                      format: decimal
                      minimum: 0
                    refresh_token:
                      type: string
                      description: Long-lived refresh token paired with the access token.
                    refresh_token_expires_in:
                      type: number
                      description: Lifetime of the refresh token, in seconds.
                      format: decimal
                      minimum: 0
                    realm_id:
                      type: string
                      description: >-
                        QuickBooks company id (QBO `realmId`). Required for
                        QuickBooks, ignored for Xero.
                - type: object
                  required:
                    - business_entity_id
                    - access_token
                    - access_token_expires_in
                    - refresh_token
                    - refresh_token_expires_in
            example:
              business_entity_id: <id>
              access_token: <partner_access_token>
              access_token_expires_in: 3600
              refresh_token: <partner_refresh_token>
              refresh_token_expires_in: 5184000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The unique identifier of the object in Nmbr.
                    readOnly: true
                  object:
                    type: string
                    description: The type of the object in Nmbr (`"integration"`).
                    readOnly: true
                  data:
                    $ref: '#/components/schemas/Integration'
              example:
                id: <id>
                object: integration
                data:
                  label: Xero
                  is_enabled: true
                  type: accounting
                links:
                  self: /integrations/xero
components:
  schemas:
    Integration:
      type: object
      title: Integration
      properties:
        label:
          type: string
          nullable: true
        is_enabled:
          type: boolean
        type:
          type: string
          nullable: true
  securitySchemes:
    CompanyToken:
      type: http
      scheme: bearer

````