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

# Start a Device Code

> Mint a device code so the account owner can approve your agent from any device and hand it its own live API key.

How an agent with no credential gets a live key: mint a code, show the human one sentence, then poll. **No authentication required.**

```bash theme={null}
curl -X POST https://api.zinc.com/device/code \
  -H "Content-Type: application/json" \
  -d '{"name": "acme-restock-agent"}'
```

`name` is what the human sees on the approval screen and becomes the key's label. An empty body is valid.

## What to do with the response

| Field                       | Use                                                                                                   |
| --------------------------- | ----------------------------------------------------------------------------------------------------- |
| `device_code`               | Your half of the handshake. Send it when polling. Never show it to the human.                         |
| `user_code`                 | The short code the human types on the approval page.                                                  |
| `verification_uri_complete` | The approval page with the code already filled in. Show this one.                                     |
| `human_message`             | One sentence to paste to your operator, ready as-is.                                                  |
| `interval`                  | Minimum seconds between polls of [`POST /device/token`](/docs/v2/api-reference/device/redeem-device-code). |
| `expires_in`                | Seconds until the code stops working.                                                                 |

<Info>
  Send an existing `zn_test_` [sandbox key](/docs/v2/api-reference/sandbox/mint-sandbox-key) as the bearer and the sandbox comes along: on approval its orders move onto the owner's account, the sandbox key keeps working, and the account may earn a starter credit.
</Info>

<Warning>
  Show `human_message` and wait. Do not open a browser yourself, and do not start a second code while one is pending.
</Warning>


## OpenAPI

````yaml versions/latest.json POST /device/code
openapi: 3.1.0
info:
  title: Zinc
  summary: >-
    Zinc lets you search, buy, and return items from top online retailers with a
    single API.
  description: >-
    Search, buy, and return items from top online retailers with a single API.
    Supports AI agent ordering via MPP (HTTP 402) — no account required.
    Supported retailers include 1-800-Flowers, Ace Hardware, Amazon, Amazon DE,
    Barnes & Noble, Best Buy, Chewy, Gap, IBS, Lowe's, Macys, Partstown, and 12
    more. Ships to the US and 2 other countries (DE, IT).
  version: '2026-08-21'
  x-logo:
    url: https://mintlify.s3.us-west-1.amazonaws.com/zinc/logo/light.png
  contact:
    name: Zinc API Support
    email: support@zinc.com
    url: https://zinc.com/docs
  x-guidance: >-
    Zinc lets AI agents buy products from online retailers via a single API. Use
    POST /agent/orders to place an order — no Zinc account needed, payment is
    handled via MPP (HTTP 402 flow). Provide a product URL from a supported
    retailer, a shipping address, and max_price in cents. The API charges
    max_price + $1 API fee upfront and refunds the difference on completion. To
    find products first, the /agent/* data endpoints (search, products/search,
    products/offers, products/details) are MPP-paid at $0.01 per call;
    /agent/search returns orderable URLs to feed straight into /agent/orders.
    GET /retailers lists supported retailers for free (no payment or account).
    Authenticated equivalents (orders, products, managed-accounts) require a
    Bearer token (API key prefixed zn_); those orders are paid from a prefunded
    wallet — GET /wallet/me returns the spendable balance and per-order fee, so
    check it before POST /orders to avoid a 402. Docs: https://zinc.com/docs
    Supported retailers include 1-800-Flowers, Ace Hardware, Amazon, Amazon DE,
    Barnes & Noble, Best Buy, Chewy, Gap, IBS, Lowe's, Macys, Partstown, and 12
    more, shipping to the US and 2 other countries (DE, IT).
  x-supported-retailers:
    - 1-800-Flowers
    - Ace Hardware
    - Amazon
    - Amazon DE
    - Barnes & Noble
    - Best Buy
    - Chewy
    - Gap
    - IBS
    - Lowe's
    - Macys
    - Partstown
    - Pokémon Center
    - Sephora
    - Target
    - The Home Depot
    - TikTok
    - Uniqlo
    - Walmart
    - Wayfair
    - Zinc
    - eBay
    - libraccio
    - zazzle
  x-supported-countries:
    - US
    - DE
    - IT
servers:
  - url: https://api.zinc.com
    description: Production
security:
  - BearerAuth: []
paths:
  /device/code:
    post:
      tags:
        - device
      summary: Start a sign-in the account owner can approve from any device
      description: >-
        Mint a device code. No account needed.


        Send your `zn_test_` sandbox key as the bearer and the sandbox comes
        along:

        when the owner approves, its orders and key move onto their account and

        your sandbox key keeps working, alongside the live key you receive.
      operationId: create_device_code_device_code_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/DeviceCodeCreate'
                - type: 'null'
              title: Body
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCodeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DeviceCodeCreate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Name
          description: >-
            What to call yourself on the approval screen and as the key's label,
            e.g. 'Claude Code' or 'acme-restock-agent'.
      type: object
      title: DeviceCodeCreate
    DeviceCodeResponse:
      properties:
        device_code:
          type: string
          title: Device Code
          description: >-
            Your half of the handshake. Keep it; send it when polling. Never
            show it to the human.
        user_code:
          type: string
          title: User Code
          description: The short code the human sees on the approval page.
        verification_uri:
          type: string
          title: Verification Uri
          description: Where the human approves; they will be asked for `user_code`.
        verification_uri_complete:
          type: string
          title: Verification Uri Complete
          description: Same page with the code filled in. Show this one.
        expires_in:
          type: integer
          title: Expires In
          description: Seconds until this code stops working.
        interval:
          type: integer
          title: Interval
          description: Minimum seconds between polls of POST /device/token.
        human_message:
          type: string
          title: Human Message
          description: One sentence to show your operator, ready to paste.
        next:
          type: string
          title: Next
          description: What to do now.
      type: object
      required:
        - device_code
        - user_code
        - verification_uri
        - verification_uri_complete
        - expires_in
        - interval
        - human_message
        - next
      title: DeviceCodeResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Zinc API key (Bearer zn_...)

````