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

# Sell back cards

> **Scope:** `sell:cards` (needs a linked account). **Moves money.**

CatchBack up to 10 cards for CatchCoins, at the same rate a customer gets. A pulled card: the pull's fresh rate (90%) within 5 minutes of the pull, then 80% of the value at pull for 7 days, then 80% of market value. A bought card: 80% of the lower of the price you paid and its market value at purchase for 7 days, then 80% of market value.

An energy card from a base pack pays 100% of its value. A card from a pack with a hold pays 90% until the hold ends. To see every amount and when it changes before you sell, use Quote a sell-back.

Items run in order, and one failing doesn't stop the rest. A pull or purchase pays out only once: selling it again returns `already_sold` with the earlier sale, so a retry is always safe. A sealed pack can't be sold back through the API.



## OpenAPI

````yaml /partner-api/openapi.yaml post /api/partner/v1/cards/sell-back
openapi: 3.1.0
info:
  title: CatchBack Partner API
  version: 1.0.0
  summary: Open packs, trade cards, read card data and ship vaulted cards.
  description: >-
    The Partner API acts on one CatchBack account with its real CatchCoins
    balance. Several

    operations here move money or data, so read
    [Idempotency](/partner-api/idempotency) before

    you call them.


    Error bodies are JSON with a human-readable `error` and, where you might
    branch on it, a

    machine-readable `code`. Branch on the status and the `code`, because the
    `error` text can

    change. New fields can be added to any response.
  contact:
    name: CatchBack support
    email: catchbackcards@gmail.com
servers:
  - url: https://catchbackcards.com
    description: Production. Every call acts on real money and real inventory.
security:
  - bearerAuth: []
tags:
  - name: Gacha
    description: Open packs, see what they can pull, check a pull, and sell cards back.
  - name: Marketplace
    description: Search and buy cards, and manage your own listings.
  - name: Metadata
    description: Look cards up by id or cert, with price history and recent activity.
  - name: Shipping
    description: Estimate, create and track shipments of cards you hold.
  - name: Account
    description: Your key, balance, limits, vault and order history, across every rail.
  - name: Funding
    description: Deposit and withdraw your balance in USDC.
  - name: Testing
    description: Test logins for trying CatchBack without real money.
  - name: Webhooks
    description: Signed POSTs we send to your URL when something happens on your account.
paths:
  /api/partner/v1/cards/sell-back:
    post:
      tags:
        - Gacha
      summary: Sell back cards
      description: >-
        **Scope:** `sell:cards` (needs a linked account). **Moves money.**


        CatchBack up to 10 cards for CatchCoins, at the same rate a customer
        gets. A pulled card: the pull's fresh rate (90%) within 5 minutes of the
        pull, then 80% of the value at pull for 7 days, then 80% of market
        value. A bought card: 80% of the lower of the price you paid and its
        market value at purchase for 7 days, then 80% of market value.


        An energy card from a base pack pays 100% of its value. A card from a
        pack with a hold pays 90% until the hold ends. To see every amount and
        when it changes before you sell, use Quote a sell-back.


        Items run in order, and one failing doesn't stop the rest. A pull or
        purchase pays out only once: selling it again returns `already_sold`
        with the earlier sale, so a retry is always safe. A sealed pack can't be
        sold back through the API.
      operationId: sellBackCards
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  type: array
                  minItems: 1
                  maxItems: 10
                  description: >-
                    Each item needs a `card_id` and exactly one of `pull_id` and
                    `purchase_id`, all UUIDs. Get vault has them, and so do Buy
                    packs and Buy a card. The same pull or purchase of a card
                    can't be listed twice.
                  items:
                    type: object
                    required:
                      - card_id
                    oneOf:
                      - title: A pulled card
                        required:
                          - pull_id
                      - title: A bought card
                        required:
                          - purchase_id
                    properties:
                      card_id:
                        type: string
                        format: uuid
                      pull_id:
                        type: string
                        format: uuid
                        description: The pull the card came from.
                      purchase_id:
                        type: string
                        format: uuid
                        description: >-
                          For a card you bought, the `purchase_id` from Get
                          vault (Buy a card's `transaction_id`).
                      min_payout:
                        type: number
                        minimum: 0
                        description: >-
                          The least you'll accept, in USD, usually a quote's
                          `amount`. If the sell-back would pay less, nothing is
                          sold and the item fails with `PRICE_CHANGED` and what
                          it would pay now.
            example:
              items:
                - card_id: 0e94dc61-5a2f-4b1e-9c3d-7f8a1b2c3d4e
                  pull_id: 873deb80-0000-4000-8000-000000000001
                  min_payout: 18
      responses:
        '200':
          description: >-
            One result per item, in the order you sent them. A `200` can carry
            failed items: check each `status`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - total_paid
                  - remaining_balance
                  - results
                properties:
                  total_paid:
                    type: number
                    description: USD credited by this request, from `sold` items only.
                  remaining_balance:
                    type:
                      - number
                      - 'null'
                    description: >-
                      Your balance after the request, or `null` if we couldn't
                      read it.
                  results:
                    type: array
                    items:
                      type: object
                      required:
                        - card_id
                        - status
                      properties:
                        card_id:
                          type: string
                        pull_id:
                          type: string
                          description: Echoed when you sent one.
                        purchase_id:
                          type: string
                          description: Echoed when you sent one.
                        status:
                          type: string
                          enum:
                            - sold
                            - already_sold
                            - failed
                        transaction_id:
                          type: string
                          description: >-
                            The sell-back; for `already_sold`, the earlier one.
                            Not on `failed`. Get an order takes it.
                        payout_amount:
                          type: number
                          description: >-
                            What the sell-back paid. On `PRICE_CHANGED`, what it
                            would pay now. Not on other `failed` items.
                        payout_rate:
                          type: number
                          description: >-
                            The rate it paid at. Only on `sold`, and on
                            `PRICE_CHANGED`.
                        error:
                          type: string
                          description: Why it failed. Only on `failed`.
                        code:
                          type: string
                          description: >-
                            A machine-readable reason, on some `failed` items.


                            - `CARD_LISTED_ON_MARKETPLACE`: the card is listed.
                            Delist it first.

                            - `GOODS_SELLBACK_WINDOW_CLOSED`: a luxury goods
                            item, more than 5 minutes after its pull.

                            - `CARD_IN_BATTLE`: the card is held by a pack
                            battle that hasn't finished.

                            - `SHOP_PURCHASE_NOT_SELLABLE`: an item bought from
                            a partner shop, which ships but doesn't sell back.

                            - `PRICE_CHANGED`: it would pay less than your
                            `min_payout`. Nothing was sold; `payout_amount` is
                            what it pays now.
                          enum:
                            - CARD_LISTED_ON_MARKETPLACE
                            - GOODS_SELLBACK_WINDOW_CLOSED
                            - CARD_IN_BATTLE
                            - SHOP_PURCHASE_NOT_SELLABLE
                            - PRICE_CHANGED
              example:
                total_paid: 16.2
                remaining_balance: 189937
                results:
                  - card_id: bee48cce-…
                    pull_id: 873deb80-…
                    status: sold
                    transaction_id: 93727497-…
                    payout_amount: 16.2
                    payout_rate: 0.9
                  - card_id: e3d7148d-…
                    pull_id: e9d27918-…
                    status: already_sold
                    transaction_id: 2fa30a7d-…
                    payout_amount: 18
                  - card_id: 4a51bc92-…
                    purchase_id: e22855d2-…
                    status: failed
                    error: >-
                      No purchase of this card by this account with that
                      purchase_id
        '400':
          description: >-
            The body isn't JSON, `items` is missing, empty or longer than 10, an
            item lacks a UUID `card_id` or doesn't have exactly one of `pull_id`
            and `purchase_id`, a `min_payout` isn't a non-negative number, or
            the same pull or purchase of a card is listed twice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: The same card is listed twice
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The key lacks `sell:cards` or isn't linked to an account, or
            `Partner account unavailable`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            An error on our side, and the body may not be JSON. Some items may
            already have sold. Send the same items again to find out, because a
            pull or purchase pays out only once and the retry answers
            `already_sold` for those.
      security:
        - bearerAuth:
            - sell:cards
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            For people. The text can change, so branch on the status and the
            `code`.
        code:
          type: string
          description: Machine-readable, where you might branch on it.
  responses:
    Unauthorized:
      description: A missing, malformed, disabled or unknown API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Missing or malformed API key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cb_live_<48 hex>
      description: >-
        Your API key, sent as a bearer token. Keep it on your server. See
        [Authentication](/partner-api/authentication). A request from a location
        we refuse gets a `403` with `Access denied`, whether or not it has a
        valid key: [where you can call
        from](/partner-api/errors-and-limits#where-you-can-call-from).

````

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