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

# Quote or buy

> step quote prices a phone number, domain, mailbox or WhatsApp account from live connected service data and returns a quote with the amount due now, the monthly cost and when it expires; nothing is charged. step buy buys what a current quote priced. Send an Idempotency-Key. phone_number with pay_with wallet spends prepaid credit; with card the answer carries a checkout_url that a person must open. Domains, mailboxes and WhatsApp accounts follow the workspace's billing. A changed price answers 409; ask for a new quote. Follow the result with GET /purchases?operation_id=. Needs an owner or admin. Requires write access. This operation can change workspace data or trigger an external side effect; review the request before sending it and do not retry blindly after a timeout.



## OpenAPI

````yaml /openapi.json post /api/v1/public/purchases
openapi: 3.1.0
info:
  description: >-
    Customer-facing API for managing outreach, leads, conversations, voice
    agents, knowledge bases, analytics, and webhooks.
  title: Sendora Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.sendora.ai
security: []
tags:
  - description: Leads, lead lists, importing, enriching and finding new prospects.
    name: Leads
  - description: Build, run and measure outreach, and enroll leads.
    name: Campaigns
  - description: Read and send messages, and manage who must not be contacted.
    name: Conversations
  - description: >-
      Voice and chat agents, their tools, knowledge bases, voices and website
      widgets.
    name: Agents
  - description: >-
      Start calls, and manage phone numbers, SMS registration, sending accounts
      and email domains.
    name: Calls and numbers
  - description: Webhooks, jobs, analytics and the Copilot assistant.
    name: Platform
  - description: Manage client workspaces, plans and branding.
    name: Agency
paths:
  /api/v1/public/purchases:
    post:
      tags:
        - Platform
      summary: Quote or buy
      description: >-
        step quote prices a phone number, domain, mailbox or WhatsApp account
        from live connected service data and returns a quote with the amount due
        now, the monthly cost and when it expires; nothing is charged. step buy
        buys what a current quote priced. Send an Idempotency-Key. phone_number
        with pay_with wallet spends prepaid credit; with card the answer carries
        a checkout_url that a person must open. Domains, mailboxes and WhatsApp
        accounts follow the workspace's billing. A changed price answers 409;
        ask for a new quote. Follow the result with GET
        /purchases?operation_id=. Needs an owner or admin. Requires write
        access. This operation can change workspace data or trigger an external
        side effect; review the request before sending it and do not retry
        blindly after a timeout.
      operationId: buy_api_v1_public_purchases_post
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - in: header
          name: Authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                title: Response Buy Api V1 Public Purchases Post
                type: object
          description: Successful Response
        '401':
          description: The X-API-Key header is missing, invalid, expired, or revoked.
        '402':
          description: >-
            The workspace is suspended for billing, or the request would exceed
            a plan or usage limit.
        '403':
          description: >-
            The key is valid but lacks the required scope, or the workspace has
            no active plan, lacks the entitlement, or has this feature turned
            off or view-only.
        '410':
          description: The workspace behind this key has been deleted.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: >-
            An unexpected Sendora error occurred. Retry only if the operation is
            safe to repeat.
        '503':
          description: >-
            An entitlement or billing check is temporarily unavailable. Retry
            after the Retry-After interval.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >-
            curl -X POST 'https://api.sendora.ai/api/v1/public/purchases' -H
            "X-API-Key: $SENDORA_API_KEY" -H "Content-Type: application/json" \
              -d '{"step":"quote","kind":"phone_number"}'
        - label: Python
          lang: python
          source: >-
            import requests


            url = 'https://api.sendora.ai/api/v1/public/purchases'

            headers = {'X-API-Key': '$SENDORA_API_KEY'}

            response = requests.post(url, headers=headers, json={'step':
            'quote', 'kind': 'phone_number'})

            response.raise_for_status()

            print(response.json())
        - label: JavaScript
          lang: javascript
          source: >-
            const response = await
            fetch("https://api.sendora.ai/api/v1/public/purchases", {
              method: "POST",
              headers: { 'X-API-Key': process.env.SENDORA_API_KEY, 'Content-Type': 'application/json' },
              body: JSON.stringify({"step": "quote", "kind": "phone_number"}),
            });

            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
        - label: Go
          lang: go
          source: >-
            req, err := http.NewRequest("POST",
            "https://api.sendora.ai/api/v1/public/purchases",
            bytes.NewBufferString(`{"step": "quote", "kind": "phone_number"}`))

            if err != nil { log.Fatal(err) }

            req.Header.Set("X-API-Key", os.Getenv("SENDORA_API_KEY"))

            req.Header.Set("Content-Type", "application/json")

            resp, err := http.DefaultClient.Do(req)

            if err != nil { log.Fatal(err) }

            defer resp.Body.Close()
components:
  schemas:
    PurchaseRequest:
      properties:
        contact_details:
          anyOf:
            - $ref: '#/components/schemas/DomainContact'
            - type: 'null'
          description: 'domain: the registrant''s contact details'
        domain_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'mailbox: the domain''s `id` from List domains'
          title: Domain Id
        domain_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 'domain: the name from the quote'
          title: Domain Name
        kind:
          description: Kind returned by the Sendora API.
          enum:
            - phone_number
            - domain
            - mailbox
            - channel_account
          title: Kind
          type: string
        mailboxes:
          anyOf:
            - items:
                $ref: >-
                  #/components/schemas/api__v1__billing__routes__add_ons__MailboxSpec
              maxItems: 5
              type: array
            - type: 'null'
          description: 'mailbox: up to five mailboxes to create'
          title: Mailboxes
        pay_with:
          default: wallet
          description: >-
            phone_number: wallet spends prepaid credit now; card returns a
            checkout link a person must open
          enum:
            - card
            - wallet
          title: Pay With
          type: string
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          description: 'phone_number: the number from the quote, with country code'
          title: Phone Number
        provider:
          anyOf:
            - const: whatsapp
              type: string
            - type: 'null'
          description: 'channel_account: whatsapp'
          title: connected service
        quote_id:
          anyOf:
            - maxLength: 80
              minLength: 1
              type: string
            - type: 'null'
          description: 'buy: the `id` from the quote'
          title: Quote Id
        registration_years:
          default: 1
          description: Registration years returned by the Sendora API.
          maximum: 1
          minimum: 1
          title: Registration Years
          type: integer
        selection:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
              maxProperties: 2
              type: object
            - type: 'null'
          description: >-
            quote: phone_number: {phone_number}. domain: {domain_name,
            registration_years}. mailbox: {domain_id, quantity}.
            channel_account: {connected service: whatsapp}
          title: Selection
        step:
          description: >-
            quote prices one thing and charges nothing; buy spends against a
            current quote
          enum:
            - quote
            - buy
          title: Step
          type: string
      required:
        - step
        - kind
      title: PurchaseRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          description: Detail returned by the Sendora API.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      required: []
      title: HTTPValidationError
      type: object
    DomainContact:
      properties:
        address_line1:
          description: Address line1 returned by the Sendora API.
          maxLength: 250
          minLength: 1
          title: Address Line1
          type: string
        city:
          description: City returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: City
          type: string
        country:
          description: Country returned by the Sendora API.
          maxLength: 2
          minLength: 2
          title: Country
          type: string
        email:
          description: Email returned by the Sendora API.
          maxLength: 320
          minLength: 3
          title: Email
          type: string
        first_name:
          description: First name returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: First Name
          type: string
        last_name:
          description: Last name returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: Last Name
          type: string
        postal_code:
          description: Postal code returned by the Sendora API.
          maxLength: 40
          minLength: 1
          title: Postal Code
          type: string
        state:
          description: State returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: State
          type: string
      required:
        - first_name
        - last_name
        - email
        - address_line1
        - city
        - state
        - country
        - postal_code
      title: DomainContact
      type: object
    api__v1__billing__routes__add_ons__MailboxSpec:
      properties:
        first_name:
          description: First name returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: First Name
          type: string
        last_name:
          description: Last name returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: Last Name
          type: string
        platform:
          description: Platform returned by the Sendora API.
          pattern: ^(GOOGLE|MICROSOFT)$
          title: Platform
          type: string
        username:
          description: Username returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: Username
          type: string
      required:
        - first_name
        - last_name
        - username
        - platform
      title: MailboxSpec
      type: object
    ValidationError:
      properties:
        loc:
          description: Loc returned by the Sendora API.
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          description: Msg returned by the Sendora API.
          title: Message
          type: string
        type:
          description: Type returned by the Sendora API.
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Customer API key created in the Sendora dashboard.
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.