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

# Get a contract

> Get a contract. <h3>OAuth</h3>Required scopes: <code>invoices.readonly</code> or <code>invoices</code>



## OpenAPI

````yaml /assets/openapi.json get /contracts/v1/{contractId}
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /contracts/v1/{contractId}:
    get:
      tags:
        - Contracts
      summary: Get a contract
      description: >-
        Get a contract. <h3>OAuth</h3>Required scopes:
        <code>invoices.readonly</code> or <code>invoices</code>
      operationId: getContract
      parameters:
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
        - in: path
          name: contractId
          required: true
          description: The id of the contract.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getContract'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - invoices
            - invoices.readonly
components:
  schemas:
    getContract:
      type: object
      properties:
        contract:
          type: object
          properties:
            action:
              type: string
              enum:
                - subscription
                - invoice
                - none
              description: Billing action associated with the contract.
            actionable:
              type: boolean
              description: Whether the contract triggers a billing action when signed.
            createDate:
              type: string
              format: date-time
              description: ISO timestamp of when the contract was created.
            customer:
              type: object
              properties:
                company:
                  description: Company details, present when the customer is a company.
                  type: object
                  properties:
                    logo:
                      description: Company logo file.
                      type: object
                      properties:
                        key:
                          type: string
                        url:
                          type: string
                      required:
                        - key
                        - url
                      additionalProperties: false
                    publicLogoUrl:
                      description: Public logo URL from logo.dev.
                      type: string
                    title:
                      description: Company name.
                      type: string
                  required:
                    - title
                  additionalProperties: false
                id:
                  type: string
                  format: uuid
                  description: Customer ID.
                user:
                  description: User details, present when the customer is a membership.
                  type: object
                  properties:
                    about:
                      description: User bio.
                      nullable: true
                      type: string
                    email:
                      description: User email address.
                      nullable: true
                      type: string
                    id:
                      type: string
                      format: uuid
                      description: User ID.
                    name:
                      description: First name.
                      nullable: true
                      type: string
                    phoneNumber:
                      description: Phone number.
                      nullable: true
                      type: string
                    photoUrl:
                      description: Profile photo URL.
                      nullable: true
                      type: string
                    surname:
                      description: Last name.
                      nullable: true
                      type: string
                  required:
                    - id
                  additionalProperties: false
              required:
                - id
              additionalProperties: false
              description: Customer associated with the contract.
            customerRef:
              type: string
              format: uuid
              description: ID of the customer (membership or company).
            endDate:
              description: Contract end date.
              type: string
              format: date-time
            expirationDate:
              type: string
              format: date-time
              description: Date after which the contract can no longer be signed.
            id:
              type: string
              format: uuid
              description: Unique identifier of the contract.
            issueDate:
              description: Date the contract was issued.
              type: string
              format: date-time
            items:
              description: Line items included in this contract.
              type: array
              items:
                type: object
                properties:
                  couponRef:
                    description: Applied coupon ID.
                    type: string
                    format: uuid
                  entire:
                    description: Whether the item covers the entire plan.
                    type: boolean
                  optionRef:
                    description: Shop product option ID.
                    type: string
                    format: uuid
                  period:
                    description: Billing period (e.g. month, year).
                    type: string
                  planRef:
                    description: Membership plan ID.
                    type: string
                    format: uuid
                  price:
                    description: Item price override.
                    type: number
                  productRef:
                    description: Shop product ID.
                    type: string
                    format: uuid
                  quantity:
                    type: number
                    description: Number of units.
                  resourceRef:
                    description: Resource ID.
                    type: string
                    format: uuid
                  tierRef:
                    description: Plan tier ID.
                    type: string
                    format: uuid
                  title:
                    type: string
                    description: Display name of the item.
                  type:
                    type: string
                    enum:
                      - plan
                      - resource
                      - oneOff
                    description: Item type.
                required:
                  - quantity
                  - title
                  - type
                additionalProperties: false
            locationRef:
              type: string
              format: uuid
              description: ID of the location this contract belongs to.
            signatureMethod:
              description: How the contract will be signed.
              type: string
              enum:
                - eSignature
                - manual
            signedDocument:
              description: Signed document file, present after the contract is signed.
              type: object
              properties:
                key:
                  type: string
                url:
                  type: string
              required:
                - key
                - url
              additionalProperties: false
            signers:
              type: array
              items:
                type: object
                properties:
                  declinedDate:
                    description: Date this signer declined.
                    type: string
                    format: date-time
                  email:
                    type: string
                    description: Signer email address.
                  id:
                    type: string
                    format: uuid
                    description: Signer ID.
                  name:
                    type: string
                    description: Signer first name.
                  order:
                    description: Signing order index.
                    type: number
                  phoneNumber:
                    description: Phone number.
                    type: string
                  signedDate:
                    description: Date this signer signed.
                    type: string
                    format: date-time
                  status:
                    description: Current signer status.
                    type: string
                  surname:
                    description: Signer last name.
                    type: string
                  type:
                    type: string
                    enum:
                      - location
                      - customer
                    description: Whether this is a location or customer signer.
                required:
                  - email
                  - id
                  - name
                  - type
                additionalProperties: false
              description: People required to sign this contract.
            startDate:
              description: Contract start date.
              type: string
              format: date-time
            status:
              type: string
              enum:
                - draft
                - issued
                - signed
                - declined
                - terminated
              description: Current contract status.
            templateRef:
              type: string
              format: uuid
              description: ID of the template used to generate this contract.
            terminationDate:
              description: Date the contract was terminated.
              type: string
              format: date-time
            terminationReason:
              description: Reason for termination.
              type: string
            timezoneId:
              type: string
              description: >-
                IANA timezone of the contract location (e.g. `Europe/London`).
                Used to interpret startDate, endDate, and expirationDate in
                local time.
            title:
              type: string
              description: Contract title.
            unsignedDocument:
              description: Unsigned document file, present after the contract is issued.
              type: object
              properties:
                key:
                  type: string
                url:
                  type: string
              required:
                - key
                - url
              additionalProperties: false
          required:
            - action
            - actionable
            - createDate
            - customer
            - customerRef
            - expirationDate
            - id
            - locationRef
            - signers
            - status
            - templateRef
            - timezoneId
            - title
          additionalProperties: false
          description: The contract.
      required:
        - contract
      additionalProperties: false
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read contracts, credit notes, discounts and invoices
            invoices: Read and write contract, credit notes, discounts and invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````