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

# Create Buyer Profile

> Creates a subject-scoped buyer profile (buyer identity + global shipping address) that the agent can prefill during a checkout run. Payment data is never stored. Returns the created profile.

**API scope required**: `agent-checkouts.buyer-profiles.create`



## OpenAPI

````yaml post /unstable/agent-checkouts/buyer-profiles
openapi: 3.0.3
info:
  title: Crossmint Agent Checkouts API
  version: unstable
  description: >-
    Drive a real, automated browser session through any merchant's checkout on
    behalf of a signed-in user.


    You hand the API a product URL, an optional natural-language instruction,
    and a hard maximum cost. Crossmint runs a browser through the merchant's
    checkout pages, pausing for *user actions* (shipping, payment, anything only
    a human can answer) which you respond to with values that satisfy a supplied
    JSON Schema. There are no webhooks in v1 — poll the checkout until it
    reaches a terminal state.


    ## Base URL


    `https://www.crossmint.com/api` (production) ·
    `https://staging.crossmint.com/api` (staging)


    ## Authentication


    Every request requires **two** credentials:


    - `X-API-KEY` — a client-side API key (`ck_...`) with the
    `agent-checkouts.*` scopes.

    - `Authorization: Bearer <jwt>` — a JWT identifying the end user, issued by
    an external auth provider your project trusts. Without it the API returns
    `401`.


    <Note>This API lives under the `unstable` namespace. The schema may change —
    pin and re-test on upgrades.</Note>
servers:
  - url: https://www.crossmint.com/api
    description: Production
  - url: https://staging.crossmint.com/api
    description: Staging
security:
  - ApiKeyAuth: []
    BearerAuth: []
tags:
  - name: Agent Checkouts
    description: Create, poll, respond to, and cancel browser-driven checkouts.
  - name: Buyer Profiles
    description: >-
      Subject-scoped buyer identity and shipping address the agent can prefill
      during a checkout run. Payment data is never stored.
paths:
  /unstable/agent-checkouts/buyer-profiles:
    post:
      tags:
        - Buyer Profiles
      summary: Create Buyer Profile
      description: >-
        Creates a subject-scoped buyer profile (buyer identity + global shipping
        address) that the agent can prefill during a checkout run. Payment data
        is never stored. Returns the created profile.


        **API scope required**: `agent-checkouts.buyer-profiles.create`
      operationId: createBuyerProfile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBuyerProfileRequest'
            examples:
              Buyer with shipping:
                summary: Create a profile with name, contact, and shipping
                value:
                  label: Home
                  name:
                    first: Ada
                    last: Lovelace
                  contact:
                    email: ada@example.com
                    phone: +44 20 7946 0000
                  shipping:
                    addressLines:
                      - 12 Analytical Engine Way
                    locality: London
                    postalCode: EC1A 1BB
                    countryCode: GB
      responses:
        '201':
          description: The buyer profile was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerProfile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    CreateBuyerProfileRequest:
      type: object
      required:
        - shipping
      properties:
        label:
          type: string
          minLength: 1
          maxLength: 120
          description: Optional human-readable label for the profile.
        name:
          $ref: '#/components/schemas/BuyerProfileName'
        contact:
          $ref: '#/components/schemas/BuyerProfileContact'
        shipping:
          $ref: '#/components/schemas/BuyerProfileShipping'
    BuyerProfile:
      type: object
      description: The full buyer profile, returned by create, get, list items, and update.
      required:
        - id
        - shipping
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The buyer profile id. Pass it as `buyerProfileId` when creating a
            checkout.
        label:
          type: string
          minLength: 1
          maxLength: 120
          description: Optional human-readable label for the profile.
        name:
          $ref: '#/components/schemas/BuyerProfileName'
        contact:
          $ref: '#/components/schemas/BuyerProfileContact'
        shipping:
          $ref: '#/components/schemas/BuyerProfileShipping'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    BuyerProfileName:
      type: object
      description: Optional buyer name. Both parts are optional.
      properties:
        first:
          type: string
          minLength: 1
          maxLength: 100
          description: Given name.
        last:
          type: string
          minLength: 1
          maxLength: 100
          description: Family name.
    BuyerProfileContact:
      type: object
      description: Optional buyer contact details.
      properties:
        email:
          type: string
          format: email
          maxLength: 254
          description: Contact email address.
        phone:
          type: string
          minLength: 1
          maxLength: 40
          description: Contact phone number.
    BuyerProfileShipping:
      type: object
      description: >-
        Global shipping address. `administrativeAreaCode` and `postalCode` are
        nullable for global-address compatibility.
      required:
        - addressLines
        - locality
        - countryCode
      properties:
        addressLines:
          type: array
          minItems: 1
          items:
            type: string
            minLength: 1
            maxLength: 200
          description: Positional street address lines (at least one).
        locality:
          type: string
          minLength: 1
          maxLength: 120
          description: City or locality.
        administrativeAreaCode:
          type: string
          minLength: 1
          nullable: true
          description: ISO 3166-2 subdivision (state/province) code, or null.
        postalCode:
          type: string
          minLength: 1
          nullable: true
          description: Postal or ZIP code, or null when the address has none.
        countryCode:
          type: string
          minLength: 2
          maxLength: 2
          pattern: ^[A-Za-z]{2}$
          description: ISO 3166-1 alpha-2 country code (2 letters).
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        message:
          type: string
  responses:
    BadRequest:
      description: The request body or parameters were invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Missing or invalid authentication. A valid `X-API-KEY` and
        `Authorization: Bearer <jwt>` are both required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The API key lacks the required scope, or Agent Checkouts is not enabled
        for this project.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Client-side API key (`ck_...`) with the `agent-checkouts.*` scopes.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT identifying the end user, issued by an external auth provider your
        project trusts.

````