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

# Register an ERC-20 (including B20) for DIRECT credentials

> Registers an ERC-20 contract on Base or Base Sepolia for DIRECT credentials (x402/ap2/mpp). Use source byo for your own ERC-20, or source b20 for a B20 token (ERC-20 compatible), including Credential Tokens. Validates the contract on-chain and reads decimals/symbol/name. Idempotent per (owner, network, contract).




## OpenAPI

````yaml /openapi.yaml post /api/tokens/register
openapi: 3.1.0
info:
  title: mag3nt API
  version: '2026-07-16'
  description: >
    Payment infrastructure for AI agents. Issue virtual cards backed by
    credentials, pay for API access via x402/AP2/MPP protocols, and settle in
    USDC on Base. Also covers Native Token Rails membership and recurring
    billing agreements, ERC-20 project token registration (including B20) and
    prepaid MAG3NT fee metering for DIRECT (non-custodial) settlement, the
    credential marketplace and Credential Token (CT) markets, account-wide token
    holdings, and signed webhooks for payment and subscription lifecycle events.
  contact:
    name: mag3nt
    url: https://mag3nt.com
  license:
    name: Proprietary
    url: https://github.com/mag3nt-com/mag3nt-node/blob/main/LICENSE
servers:
  - url: https://mag3nt.com
    description: Production
  - url: https://staging.mag3nt.com
    description: Staging, Base mainnet
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Universal outbound protocol payments
  - name: Cards
    description: Virtual payment card lifecycle
  - name: Keys
    description: Developer API key management
  - name: Funding
    description: Treasury deposits and balances
  - name: x402
    description: HTTP 402 payment protocol
  - name: AP2
    description: Agent-to-Agent Payment Protocol
  - name: MPP
    description: Micropayment Protocol with streaming
  - name: Pay Links
    description: Shareable payment URLs
  - name: Withdrawals
    description: Withdraw unspent funds back to wallet
  - name: Settlement
    description: On-chain settlement status
  - name: Webhooks
    description: Signed payment and subscription lifecycle notifications for sellers
  - name: Status
    description: System health and configuration
  - name: Membership
    description: Native Token Rails membership tiers, checkout, and auto-renew
  - name: Billing
    description: Recurring billing agreements funded by AP2 open mandates
  - name: Tokens
    description: >-
      Register an ERC-20 contract (including B20 tokens) for DIRECT credential
      settlement
  - name: Fees
    description: Prepaid MAG3NT fee meter for DIRECT settlement overage
  - name: Marketplace
    description: >-
      List and transfer credential businesses (proof of record) on the mag3nt
      marketplace
  - name: Credential Tokens
    description: Credential Token (CT) launch and Uniswap V4 markets
  - name: Holdings
    description: Account-wide Credential Token balances
externalDocs:
  description: mag3nt documentation
  url: https://docs.mag3nt.com
paths:
  /api/tokens/register:
    post:
      tags:
        - Tokens
      summary: Register an ERC-20 (including B20) for DIRECT credentials
      description: >
        Registers an ERC-20 contract on Base or Base Sepolia for DIRECT
        credentials (x402/ap2/mpp). Use source byo for your own ERC-20, or
        source b20 for a B20 token (ERC-20 compatible), including Credential
        Tokens. Validates the contract on-chain and reads decimals/symbol/name.
        Idempotent per (owner, network, contract).
      operationId: tokensRegister
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contract
              properties:
                contract:
                  type: string
                  example: 0x1234...abcd
                network:
                  type: string
                  enum:
                    - eip155:8453
                    - eip155:84532
                  default: eip155:8453
                symbol:
                  type: string
                  description: >-
                    Optional symbol override (falls back to the on-chain
                    symbol()).
                source:
                  type: string
                  enum:
                    - byo
                    - b20
                  default: byo
      responses:
        '200':
          description: Registered (or already registered)
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    $ref: '#/components/schemas/ProjectToken'
                  already_added:
                    type: boolean
        '400':
          description: >-
            Invalid contract, unsupported network, or the contract does not
            implement decimals()
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ProjectToken:
      type: object
      description: >-
        A registered ERC-20 for DIRECT settlement. source byo = your ERC-20;
        source b20 = a B20 token (ERC-20 compatible), including Credential
        Tokens.
      properties:
        id:
          type: string
          example: ptok_9f8e7d6c...
        symbol:
          type: string
          example: SKILL
        name:
          type: string
        contract:
          type: string
          example: 0x1234...abcd
        network:
          type: string
          enum:
            - eip155:8453
            - eip155:84532
        decimals:
          type: integer
        source:
          type: string
          enum:
            - byo
            - b20
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Card not found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key prefixed with 'Bearer sx_live_...'

````