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

# Mint a counterparty credential for a business's web domain

> Mints the domain-bound business entity credential a merchant hosts at /.well-known/baselayer-counterparty-credential so arriving agents can verify the business behind the site. No agent key: the credential binds to the domain, and TLS supplies the possession proof at fetch time.



## OpenAPI

````yaml /api-reference/openapi.json post /credentials/counterparty
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /credentials/counterparty:
    post:
      tags:
        - Credentials
      summary: Mint a counterparty credential for a business's web domain
      description: >-
        Mints the domain-bound business entity credential a merchant hosts at
        /.well-known/baselayer-counterparty-credential so arriving agents can
        verify the business behind the site. No agent key: the credential binds
        to the domain, and TLS supplies the possession proof at fetch time.
      operationId: mint_counterparty_credential
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1.CounterpartyCredentialMintRequest'
          application/vnd.baselayer.v1+json:
            schema:
              $ref: '#/components/schemas/v1.CounterpartyCredentialMintRequest'
        required: true
      responses:
        '201':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1.CounterpartyCredentialMintResponse'
            application/vnd.baselayer.v1+json:
              schema:
                $ref: '#/components/schemas/v1.CounterpartyCredentialMintResponse'
        '404':
          description: >-
            The business_ref is unknown or was issued to another organization —
            the two are indistinguishable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
                title: ResourceNotFound
                description: Could not locate the resource for the given URI.
                examples:
                  - code: 1
                    message: Could not locate the resource for the given URI.
                    metadata: {}
        '409':
          description: >-
            The domain does not match the business's verified website domain,
            the registration is not active and undissolved, or registry truth
            has lapsed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
                title: CounterpartyCredentialDomainNotVerified
                description: >-
                  The requested domain does not match the business's verified
                  website domain; a counterparty credential binds only to a
                  domain the business is known to operate.
                examples:
                  - code: 6305
                    message: >-
                      The requested domain does not match the business's
                      verified website domain; a counterparty credential binds
                      only to a domain the business is known to operate.
                    metadata: {}
        '422':
          description: >-
            The mint payload failed validation, or the domain cannot be reduced
            to a canonical form.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
                title: InvalidCredentialMintPayload
                description: The credential mint payload failed validation.
                examples:
                  - code: 6303
                    message: The credential mint payload failed validation.
                    metadata: {}
      security:
        - APIKeyHeader: []
components:
  schemas:
    v1.CounterpartyCredentialMintRequest:
      additionalProperties: false
      description: |-
        Body for ``POST /credentials/counterparty``: mint the domain-bound
        business entity credential a merchant hosts for counterparty
        verification (ENG-6598).

        No agent key and no disclosure selection: the credential binds to the
        merchant's domain rather than a presenting key, and every claim is
        public-record fact, always disclosed.
      properties:
        business_ref:
          description: >-
            Pairwise reference to the verified business the counterparty
            credential attests, as issued to the calling organization.
          maxLength: 255
          minLength: 1
          title: Business Ref
          type: string
        domain:
          description: >-
            The domain the credential binds to — must match the business's
            verified website domain. A full URL is reduced to its hostname.
          maxLength: 512
          minLength: 1
          title: Domain
          type: string
      required:
        - business_ref
        - domain
      title: CounterpartyCredentialMintRequest (v1)
      type: object
    v1.CounterpartyCredentialMintResponse:
      description: |-
        Body for the counterparty mint route: the hostable wire credential
        and its issuance facts.

        ``credential`` is one plain EdDSA JWS (``typ: bl-counterparty+jwt``) —
        the merchant serves it verbatim at
        ``https://<domain>/.well-known/baselayer-counterparty-credential``.
      properties:
        credential:
          description: The counterparty credential JWS wire string.
          title: Credential
          type: string
        credential_type:
          $ref: '#/components/schemas/v1.IssuedCredentialType'
          description: Always COUNTERPARTY for this route.
        jti:
          description: The credential's unique token id; the issuance-record handle.
          title: Jti
          type: string
        business_ref:
          description: The pairwise business reference minted for.
          title: Business Ref
          type: string
        subject:
          description: >-
            The credential's public business DID (the JWT sub claim), derived
            from the entity's registry coordinates.
          title: Subject
          type: string
        domain:
          description: The canonical domain the credential is bound to.
          title: Domain
          type: string
        issued_at:
          description: Issuance instant (the JWT's iat).
          format: date-time
          title: Issued At
          type: string
        expires_at:
          description: Expiry instant (the JWT's exp).
          format: date-time
          title: Expires At
          type: string
        disclosed_fields:
          description: The business.* claim paths the credential carries, in wire form.
          items:
            type: string
          title: Disclosed Fields
          type: array
        active_keys:
          description: >-
            The attestation-primitive keys backing the business_verification
            block.
          items:
            type: string
          title: Active Keys
          type: array
      required:
        - credential
        - credential_type
        - jti
        - business_ref
        - subject
        - domain
        - issued_at
        - expires_at
      title: CounterpartyCredentialMintResponse (v1)
      type: object
    APIError:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
        uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Uri
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
        - code
        - message
      title: APIError
      description: >-
        APIError is a Pydantic model for standardizing error responses from the
        API.


        This class is used internally by APIException for JSON serialization.

        Users should typically work with APIException directly in exception
        catalogs.
    v1.IssuedCredentialType:
      description: |-
        The KYA credential layer.

        L2 is the audience-scoped pairwise DID ("same customer returning");
        L3 is the selectively disclosed verified-identity credential. Both ride
        the same SD-JWT-VC wire format; the layer decides what the issuer JWT
        carries. Counterparty is the counterparty-verification credential
        (ENG-6598): a domain-bound business entity attestation a merchant
        hosts for arriving agents — plain JWS, no selective disclosure, no
        agent key.
      enum:
        - L2
        - L3
        - COUNTERPARTY
      title: IssuedCredentialType
      type: string
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````