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

# Sign Up

> Sign up a customer for a project



## OpenAPI

````yaml POST /v1/customers/sign-up
openapi: 3.0.3
info:
  title: Unprice API
  version: 1.0.0
servers:
  - url: https://api.unprice.dev
    description: Production
  - url: http://localhost:8787
    description: Development
  - url: https://preview-api.unprice.dev
    description: Preview
security:
  - bearerAuth: []
paths:
  /v1/customers/sign-up:
    post:
      tags:
        - customers
      summary: sign up
      description: Sign up a customer for a project
      operationId: customers.signUp
      requestBody:
        description: Body of the request
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: The name of the customer
                  example: John Doe
                timezone:
                  type: string
                  description: >-
                    The timezone of the customer, if passed null the system will
                    use the project timezone
                  example: UTC
                defaultCurrency:
                  type: string
                  enum:
                    - USD
                    - EUR
                  description: >-
                    The default currency of the customer, if passed null the
                    system will use the project currency
                  example: USD
                email:
                  type: string
                  minLength: 1
                  format: email
                  description: The email of the customer
                  example: test@example.com
                billingInterval:
                  type: string
                  enum:
                    - month
                    - year
                    - week
                    - day
                    - minute
                    - onetime
                  description: >-
                    The billing interval of the customer to be used for the
                    subscription. If plan version is provided, the billing
                    interval will be the same as the plan version. If plan slug
                    is provided, the billing interval will be the default
                    billing interval of the plan.
                  example: month
                planSlug:
                  type: string
                  description: >-
                    If the plan id is not provided, you can pass a plan slug and
                    the system will intelligently pick the lastest plan for that
                    slug and sign up the customer for it
                  example: PRO
                sessionId:
                  type: string
                  description: >-
                    The session id of the customer. This is used to track
                    conversion from pricing pages
                  example: sess_1234567890
                planVersionId:
                  type: string
                  description: The plan version the customer is signing up for
                  example: pv_1234567890
                config:
                  type: array
                  items:
                    type: object
                    properties:
                      featurePlanId:
                        type: string
                        description: The feature plan id of the item
                        example: feature_plan_123
                      featureSlug:
                        type: string
                        description: The feature slug of the item
                        example: feature_slug_123
                      isUsage:
                        type: boolean
                        description: if the item is a usage item
                        example: true
                      units:
                        type: number
                        minimum: 1
                        description: units of the feature the user is subscribed to
                        example: 100
                      min:
                        type: number
                        nullable: true
                        description: minimum units of the feature the user is subscribed to
                        example: 100
                      limit:
                        type: number
                        nullable: true
                        description: limit of the feature the user is subscribed to
                        example: 100
                    required:
                      - featurePlanId
                      - featureSlug
                  description: >-
                    The configuration of the subscription items. This is
                    required if your features are quantity based when the
                    customer needs to set them. Pass as empty if you want the
                    system to automatically set the units from the plan
                    defaults.
                  example:
                    - featurePlanId: feature_plan_123
                      featureSlug: feature_slug_123
                      isUsage: true
                      units: 100
                creditLinePolicy:
                  type: string
                  enum:
                    - capped
                    - uncapped
                  default: uncapped
                  description: >-
                    Usage credit policy for the initial subscription phase.
                    Uncapped allows postpaid usage without wallet reservation;
                    capped uses a finite credit amount or derives one from
                    finite usage limits.
                  example: uncapped
                creditLineAmount:
                  type: integer
                  nullable: true
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                  description: >-
                    Optional capped usage credit amount in the currency's
                    smallest unit (for example, cents for USD/EUR). Leave null
                    or omit to derive from finite usage limits when
                    creditLinePolicy is capped.
                  example: 10000
                externalId:
                  type: string
                  description: >-
                    The external id you want to associate with the customer.
                    Could be the id of the user in your database
                  example: '1234567890'
                successUrl:
                  type: string
                  format: uri
                  description: >-
                    The success url if the customer signs up. This is the url
                    after the signup process, normally your dashboard
                  example: https://example.com/dashboard
                cancelUrl:
                  type: string
                  format: uri
                  description: >-
                    The cancel url if the customer cancels the signup. This is
                    the url after the signup process, normally your login page
                  example: https://example.com/login
                metadata:
                  type: object
                  properties:
                    country:
                      type: string
                    region:
                      type: string
                    city:
                      type: string
                  description: >-
                    The metadata of the customer, very important to pass
                    geolocation data if you want to segment later on
                  example:
                    country: US
                    region: CA
                    city: San Francisco
              required:
                - name
                - email
                - successUrl
                - cancelUrl
              description: The customer sign up request
      responses:
        '200':
          description: The result of the customer sign up
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the signup was successful
                    example: true
                  url:
                    type: string
                    format: uri
                    description: >-
                      The url to redirect the customer to, either to the success
                      or cancel url
                    example: https://example.com/dashboard
                  customerId:
                    type: string
                    description: >-
                      The unprice customer id generated by the system for this
                      customer
                    example: cus_1234567890
                required:
                  - success
                  - url
                  - customerId
        '400':
          description: >-
            The server cannot or will not process the request due to something
            that is perceived to be a client error (e.g., malformed request
            syntax, invalid request message framing, or deceptive request
            routing).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBadRequest'
        '401':
          description: >-
            Although the HTTP standard specifies "unauthorized", semantically
            this response means "unauthenticated". That is, the client must
            authenticate itself to get the requested response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
        '403':
          description: >-
            The client does not have access rights to the content; that is, it
            is unauthorized, so the server is refusing to give the requested
            resource. Unlike 401 Unauthorized, the client's identity is known to
            the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrForbidden'
        '404':
          description: >-
            The server cannot find the requested resource. In the browser, this
            means the URL is not recognized. In an API, this can also mean that
            the endpoint is valid but the resource itself does not exist.
            Servers may also send this response instead of 403 Forbidden to hide
            the existence of a resource from an unauthorized client. This
            response code is probably the most well known due to its frequent
            occurrence on the web.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
        '409':
          description: >-
            This response is sent when a request conflicts with the current
            state of the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrConflict'
        '412':
          description: >-
            The requested operation cannot be completed because certain
            conditions were not met. This typically occurs when a required
            resource state or version check fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrPreconditionFailed'
        '429':
          description: >-
            The user has sent too many requests in a given amount of time ("rate
            limiting")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrTooManyRequests'
        '500':
          description: >-
            The server has encountered a situation it does not know how to
            handle.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrInternalServerError'
components:
  schemas:
    ErrBadRequest:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
              description: A machine readable error code.
              example: BAD_REQUEST
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/BAD_REQUEST
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrUnauthorized:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
              description: A machine readable error code.
              example: UNAUTHORIZED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/UNAUTHORIZED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrForbidden:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - FORBIDDEN
              description: A machine readable error code.
              example: FORBIDDEN
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/FORBIDDEN
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - NOT_FOUND
              description: A machine readable error code.
              example: NOT_FOUND
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/NOT_FOUND
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrConflict:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - CONFLICT
              description: A machine readable error code.
              example: CONFLICT
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/CONFLICT
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrPreconditionFailed:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - PRECONDITION_FAILED
              description: A machine readable error code.
              example: PRECONDITION_FAILED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/PRECONDITION_FAILED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrTooManyRequests:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - TOO_MANY_REQUESTS
              description: A machine readable error code.
              example: TOO_MANY_REQUESTS
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/TOO_MANY_REQUESTS
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrInternalServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INTERNAL_SERVER_ERROR
              description: A machine readable error code.
              example: INTERNAL_SERVER_ERROR
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/INTERNAL_SERVER_ERROR
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
  securitySchemes:
    bearerAuth:
      bearerFormat: root key
      type: http
      scheme: bearer
      x-speakeasy-example: UNPRICE_API_KEY

````