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

# Register a business

> Register a shop or barber with the payment processor so the business can accept
card payments and receive payouts.



## OpenAPI

````yaml /api-reference/Businesses/openapi.yaml post /businesses
openapi: 3.0.0
info:
  title: Businesses
  version: 0.1.0
  contact:
    name: Guile Engineering
    url: https://www.guile.app
    email: engineering@guile.app
  license:
    name: MIT
    url: https://opensource.org/license/mit
  description: >-
    The Business API provides operations for business registration on the Guile
    platform.
servers:
  - url: https://api.guile.app
    variables: {}
  - url: https://guile.fly.dev
    variables: {}
security: []
tags:
  - name: Businesses
    description: Business registration, balance, and payout setup
paths:
  /businesses:
    post:
      tags:
        - Businesses
      summary: Register a business
      description: >-
        Register a shop or barber with the payment processor so the business can
        accept

        card payments and receive payouts.
      operationId: registerBusiness
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createBusinessRegistration'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/businessRegistration'
        '400':
          description: >-
            Bad Request.

            The request body, request headers, and/or query parameters are not
            well-formed.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/badRequest](https://docs.guile.app/problems/badRequest)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '401':
          description: >-
            Unauthorized.

            The operation requires authentication but no authentication or
            insufficient authentication was given.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/unauthorized](https://docs.guile.app/problems/unauthorized)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '403':
          description: >-
            Forbidden.

            The authenticated caller is not authorized to perform the requested
            operation.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/forbidden](https://docs.guile.app/problems/forbidden)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '409':
          description: >-
            Conflict.

            The request conflicts with the state of the application.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/conflict](https://docs.guile.app/problems/conflict)

            *
            [https://docs.guile.app/problems/businessAlreadyRegistered](https://docs.guile.app/problems/businessAlreadyRegistered)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '422':
          description: >-
            Unprocessable Entity.

            The request body and/or query parameters were well-formed but
            otherwise invalid.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/unprocessableEntity](https://docs.guile.app/problems/unprocessableEntity)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '429':
          description: >-
            Too Many Requests.

            The client has sent too many requests in a given amount of time.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/tooManyRequests](https://docs.guile.app/problems/tooManyRequests)
          headers:
            Retry-After:
              required: true
              description: The number of seconds to wait before retrying the request.
              schema:
                type: integer
                format: uint32
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
      security:
        - BearerAuth: []
components:
  schemas:
    createBusinessRegistration:
      type: object
      required:
        - paymentProcessor
      properties:
        paymentProcessor:
          allOf:
            - $ref: '#/components/schemas/paymentProcessor'
          description: The name of the external service providing payment processing.
        stripe:
          allOf:
            - $ref: '#/components/schemas/createStripeBusinessRegistration'
          description: |-
            Properties required to register a business with Stripe.
            This is required when `paymentProcessor` is `stripe`
      description: >-
        Properties required to register a business for payment processing and
        payouts.
    businessRegistration:
      type: object
      required:
        - id
        - paymentProcessor
        - state
        - allows
      properties:
        id:
          $ref: '#/components/schemas/resourceId'
        paymentProcessor:
          allOf:
            - $ref: '#/components/schemas/paymentProcessor'
          description: The name of the external service providing payment processing.
        state:
          allOf:
            - $ref: '#/components/schemas/BusinessState'
          description: The state of the business registration.
        allows:
          allOf:
            - $ref: '#/components/schemas/businessAllows'
          description: The capabilities allowed for this business.
      description: >-
        Representation of a registered business for payment processing and
        payouts.
    apiProblem:
      type: object
      required:
        - type
        - title
        - occurredAt
        - id
        - status
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/uri'
          description: A URI reference that identifies the problem type.
        title:
          type: string
          maxLength: 120
          description: >-
            A short, human-readable summary of the problem type. The title is
            usually the same for all

            problems with the same `type`.
        occurredAt:
          type: string
          format: date-time
          description: >-
            The date-time when this problem occurred, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date-time `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived
            and immutable.
        detail:
          type: string
          maxLength: 256
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: >-
            The unique identifier for this problem. This is an immutable opaque
            string.
        status:
          allOf:
            - $ref: '#/components/schemas/statusCode'
          description: >-
            The [HTTP status
            code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)for
            this

            occurrence of the problem.
        instance:
          allOf:
            - $ref: '#/components/schemas/uri'
          maxLength: 2048
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. This is the URI of an

            API resource that the problem is related to, with a unique error
            correlation ID URI fragment.
        attributes:
          type: object
          additionalProperties: {}
          description: >-
            Additional optional attributes related to the problem. This data
            conforms to the schema

            associated with the error type.
        recovery:
          allOf:
            - $ref: '#/components/schemas/clientFailureRecovery'
          description: The recovery contract for this problem occurrence.
        problems:
          type: array
          items:
            $ref: '#/components/schemas/problem'
          maxItems: 128
          description: |-
            Optional root-causes if there are multiple problems in the request
            or API call processing.
      description: >-
        API problem or error response, as per

        [RFC 9457
        application/problem+json](https://tools.ietf.org/html/rfc9457).
    paymentProcessor:
      type: string
      enum:
        - stripe
      description: Supported payment processors within the Guile platform.
    createStripeBusinessRegistration:
      type: object
      required:
        - businessType
        - address
        - dateOfBirth
      properties:
        businessType:
          allOf:
            - $ref: '#/components/schemas/stripeBusinessType'
          description: The stuctural type of the business for registration.
        address:
          allOf:
            - $ref: '#/components/schemas/usAddress'
          description: The business address for tax purposes.
        dateOfBirth:
          allOf:
            - $ref: '#/components/schemas/tokenizedDate'
          description: The date of birth for the legal owner of the business.
        givenName:
          type: string
          description: >-
            The legal given name of the business owner, if different than the
            name in the Guile platform.
        surname:
          type: string
          description: >-
            The legal surname of the business owner, if different than the name
            in the Guile platform.
        payoutMethodId:
          type: string
          description: The identifier of the payment method to use for payouts.
        individual:
          allOf:
            - $ref: '#/components/schemas/stripeBusinessIndividualFields'
          description: Required properties when `businessType` is `individual`.
        company:
          allOf:
            - $ref: '#/components/schemas/stripeBusinessCompanyFields'
          description: Required properties when `businessType` is `company`.
      description: |-
        Fields needed to for all Stripe business registrations.
        See https://docs.stripe.com/connect/required-verification-information.
    resourceId:
      type: string
      description: >-
        The unique, opaque system identifier for a resource.

        This case-sensitive ID is also used as path parameters in URLs or in
        other

        properties or parameters that reference a resource by ID rather than
        URL.
    BusinessState:
      type: string
      enum:
        - approved
        - pending
        - rejected
    businessAllows:
      type: object
      required:
        - payouts
        - instantPayouts
        - cardPayments
      properties:
        payouts:
          type: boolean
          description: If `true`, the business is allowed to receive payouts.
        instantPayouts:
          type: boolean
          description: If `true`, the business is allowed to receive instant payouts.
        cardPayments:
          type: boolean
          description: If `true`, the business is allowed to receive card payments.
      description: The capabilities allowed for a business.
    uri:
      type: string
      maxLength: 1024
      format: uri
      description: A URI reference to an internal or external resource.
    statusCode:
      type: integer
      format: uint16
      minimum: 100
      maximum: 599
      description: The HTTP status code for a response.
    clientFailureRecovery:
      type: object
      required:
        - outcome
        - retry
      properties:
        outcome:
          allOf:
            - $ref: '#/components/schemas/clientFailureOutcome'
          description: The known outcome of the request.
        retry:
          allOf:
            - $ref: '#/components/schemas/clientRetryDirective'
          description: The safe retry action for the request.
        sessionAction:
          allOf:
            - $ref: '#/components/schemas/clientSessionAction'
          description: The session action required before the request can continue.
        rateLimit:
          allOf:
            - $ref: '#/components/schemas/rateLimit'
          description: The rate limit state that prevented the request.
      description: The recovery contract for a failed client request.
    problem:
      type: object
      required:
        - type
        - title
        - occurredAt
        - id
        - status
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/uri'
          description: A URI reference that identifies the problem type.
        title:
          type: string
          maxLength: 120
          description: >-
            A short, human-readable summary of the problem type. The title is
            usually the same for all

            problems with the same `type`.
        occurredAt:
          type: string
          format: date-time
          description: >-
            The date-time when this problem occurred, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date-time `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived
            and immutable.
        detail:
          type: string
          maxLength: 256
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: >-
            The unique identifier for this problem. This is an immutable opaque
            string.
        status:
          allOf:
            - $ref: '#/components/schemas/statusCode'
          description: >-
            The [HTTP status
            code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)for
            this

            occurrence of the problem.
        instance:
          allOf:
            - $ref: '#/components/schemas/uri'
          maxLength: 2048
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. This is the URI of an

            API resource that the problem is related to, with a unique error
            correlation ID URI fragment.
        attributes:
          type: object
          additionalProperties: {}
          description: >-
            Additional optional attributes related to the problem. This data
            conforms to the schema

            associated with the error type.
      description: >-
        Standard problem or error response, as per

        [RFC 9457
        application/problem+json](https://tools.ietf.org/html/rfc9457).
    stripeBusinessType:
      type: string
      enum:
        - individual
        - company
      description: Types of business registrations within Stripe.
    usAddress:
      type: object
      required:
        - address1
        - locality
        - regionCode
        - postalCode
        - countryCode
      properties:
        address1:
          type: string
          maxLength: 35
          description: >-
            The first line of the postal address. In the US, this typically
            includes

            the building number and street name.
        address2:
          type: string
          maxLength: 35
          description: |-
            The second line of the street address. This should only be used
            if it has a value. Typical values include building numbers, suite
            numbers, and other identifying information beyond the first line
            of the postal address.
        locality:
          type: string
          maxLength: 30
          description: The city/town/municipality of the address.
          example: Atlanta
        regionCode:
          type: string
          minLength: 2
          maxLength: 2
          pattern: ^[A-Za-z]{2}$
          description: The state, district, or outlying area of the postal address.
          example: VT
        postalCode:
          type: string
          minLength: 5
          maxLength: 10
          pattern: ^\d{5}(?:[- ]?\d{4})?$
          description: >-
            A group of five or nine numbers that are added to a postal address
            to

            assist the sorting of mail.
          example: 20521-9000
        countryCode:
          type: string
          minLength: 2
          maxLength: 2
          pattern: ^[A-Za-z]{2}$
          description: The ISO-3611 alpha-2 value for a country.
          example: CA
      description: A postal address within the United States or US territories.
    tokenizedDate:
      type: object
      required:
        - day
        - month
        - year
      properties:
        day:
          type: integer
          format: int8
          minimum: 1
          maximum: 31
          description: The numerical day of the date.
        month:
          type: integer
          format: int8
          minimum: 1
          maximum: 12
          description: >-
            The numerical month of the date, with January set to 1 and December
            set to 12.
        year:
          type: integer
          format: int16
          minimum: 1900
          maximum: 2025
          description: The four digit value of the year for the date.
      description: A calendar date split into separate components.
    stripeBusinessIndividualFields:
      type: object
      required:
        - last4ssn
      properties:
        last4ssn:
          type: string
          minLength: 4
          maxLength: 4
          pattern: ^\d{4}$
          description: The last 4 digits of the business owner's Social Security Number.
      description: >-
        Required properties for registering a business for an individual in
        Stripe.
    stripeBusinessCompanyFields:
      type: object
      required:
        - businessName
        - ein
      properties:
        businessName:
          type: string
          minLength: 1
          maxLength: 250
          description: The legal name of the business entity.
        ein:
          type: string
          minLength: 9
          maxLength: 10
          pattern: ^\d{2}-?\d{7}$
          description: >-
            The US Employer Identification Number for the business in the
            XX-XXXXXXX format.
      description: Required properties for registering a business for a company in Stripe.
    clientFailureOutcome:
      type: string
      enum:
        - notApplied
        - unknown
      description: The known outcome of a failed client request.
    clientRetryDirective:
      type: string
      enum:
        - doNotRetry
        - retrySameRequest
        - retrySameRequestAfterDelay
      description: The safe retry action for a failed client request.
    clientSessionAction:
      type: string
      enum:
        - refresh
        - signIn
      description: The session action required before a failed request can continue.
    rateLimit:
      type: object
      required:
        - limit
        - remaining
        - resetsAt
      properties:
        limit:
          type: integer
          format: uint64
          description: The maximum number of requests allowed in the active window.
        remaining:
          type: integer
          format: uint64
          description: The number of requests remaining in the active window.
        resetsAt:
          type: string
          format: date-time
          description: >-
            The date-time when the active window resets, in [RFC
            3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC.
      description: The rate limit state for the request.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````