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

# Submit an ask

> Publish a listing with the order data and signature from the seller. The playground uses the testnet request format. See the endpoint page for the current mainnet fields.

Use the response from [prepare an ask](https://docs.renaiss.xyz/api-reference/marketplace/prepare-ask.md). Send its top-level `tokenId`, its `payload.askData` as `askData`, and the seller’s `askSignature`.

On testnet, submit the top-level `tokenId` shown here. Until the mainnet release, send the prepared `payload.collectibleId` as top-level `collectibleId` on mainnet. Keep the signed order data exactly as prepared.

## Request

Builder key and wallet signature

## Response

## Error codes

Match the HTTP status and response text to a row below. For guidance on codes shared across endpoints, see [Error meanings and recovery](https://docs.renaiss.xyz/api-reference/errors.md).

| HTTP | Error code | Text field | Response text and recovery |
| :- | :- | :- | :- |
| `400` | `ASK_AMOUNT_NOT_POSITIVE` | `error` | `Ask amount must be greater than zero` The price is zero. Send a price above zero. |
| `400` | `ASK_HAS_ALREADY_EXPIRED` | `error` | `Ask has already expired` The listing expired while it was being processed. Prepare again with a later expiry and sign the new data. |
| `400` | `ASK_TOKEN_ID_MISMATCH` | `error` | `Signed order token ID differs from the submitted token ID` `Ask token ID does not match the collectible` Check that `tokenId` and `askData.tokenId` identify the same card. Use one prepare response for both fields. |
| `400` | `COLLECTIBLE_ONCHAIN_OWNER_MISMATCH` | `error` | `{onchainOwner} is the on chain owner.` The wallet does not own the collectible. Use the wallet that owns it. |
| `400` | `INVALID_ASK_SIGNATURE` | `error` | `Ask signature is invalid` The signature on the listing was not accepted. Prepare again and have the wallet sign the new data. |
| `400` | `OFFER_EXPIRY_TOO_LONG` | `error` | `Offers can expire at most 180 days from now` The listing expires too far from now. Prepare again with a shorter expiry. |
| `400` | `WRONG_REQUEST_PARAMS` | `error` | `Invalid marketplace request: tokenId: Required` `Invalid marketplace request: Expected object, received array` Send the required fields in a JSON object. Copy the top-level `tokenId` from preparation and omit `collectibleId`. |
| `400` | No code | `text/plain` | `Malformed JSON in request body` |
| `401` | `API_AUTH_INVALID_CREDENTIAL` | `error` | `Invalid authentication credential` The builder key is malformed, unknown, expired or revoked. Check the key. Do not retry with the same key. |
| `401` | `API_AUTH_MISSING_CREDENTIAL` | `error` | `Required authentication credential is missing` No builder key was sent. Send your builder key in the `x-builder-api-key` header. |
| `403` | `API_AUTH_CREDENTIAL_NOT_ALLOWED` | `error` | `Credential is not allowed by this policy` This route takes a builder key only. Remove the `Authorization` header and any other credential, then send the request again. |
| `403` | `API_AUTH_INVALID_ACTION` | `error` | `Invalid wallet action proof` The signature was not accepted for the wallet and the prepared data, or the deadline has passed. Prepare again and sign the new data. For a contract wallet, its `isValidSignature` must return `0x1626ba7e` for the EIP-712 digest of the prepared data. |
| `403` | `GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API` | `error` | `This builder checks out on its own surface, not on the public API` This builder key cannot be used on this API. Do not retry; contact Renaiss. |
| `404` | `COLLECTIBLE_NOT_FOUND` | `error` | `Collectible not found` The token id is unknown or the collectible is not available on this API. Check the token id. Do not retry with the same id. |
| `413` | No code | `text/plain` | `Payload Too Large` |
| `429` | `API_AUTH_RATE_LIMITED` | `error` | `Authentication rate limit exceeded` The builder key hit its rate limit. Wait a little, then retry at a lower rate. |
| `500` | `API_AUTH_ERROR` | `error` | `Internal server error` The signature could not be checked because the chain could not be read. Retry the request. |
| `500` | `FUNCTION_ERROR` | `error` | `Internal server error` |
| `500` | No code | `text/plain` | `Internal Server Error` |
| `500` | `COLLECTIBLE_GET_FAILED` `ASK_ORDER_INSERT_FAILED` `ASK_ORDER_UPDATE_FAILED` `CREATE_SELL_OFFER_FAILED` | `error` | `Internal server error` Check the order and wallet activity before resubmitting. |


## OpenAPI

````yaml api-reference/openapi.json POST /v2/marketplace/asks
openapi: 3.1.1
info:
  version: 1.0.0
  title: Renaiss Builder API v2
  description: >-
    Builder API v2 for gacha, marketplace and redemption with external wallets
    on BNB Smart Chain (chain 56). Any active, approved builder key can prepare
    purchases.


    A collectible is an item a wallet can pull, trade, sell back or redeem, such
    as a card. This API calls every such item a collectible (e.g. cards), in
    paths, fields and descriptions.


    Browse publicly, then prepare and sign actions with the buyer wallet. Gacha
    history and buyback offers require your builder key; purchases and buybacks
    also require a wallet action signature. Private shipping data and redemption
    require a wallet access token, which the API issues from a registered
    partner origin after the wallet signs a sign-in message. Gacha and
    marketplace never use a wallet access token. Keep the builder key on your
    backend.


    The acting wallet is an EOA or a deployed ERC-1271 contract account.
    EIP-7702 delegated accounts, ERC-6492 and ERC-8010 wrapped signatures and
    Renaiss-managed Safes are refused (a Safe only after its signature
    verified). A pull to a contract account that cannot receive ERC-721 tokens
    returns `CONTRACT_WALLET_CANNOT_RECEIVE_NFT`. A failed chain read returns
    `API_AUTH_ERROR` (500). Wallet access tokens and redemption are EOA only.
servers:
  - url: https://api.renaiss.xyz
    description: BNB Smart Chain
  - url: https://dev-api.renaiss.xyz
    description: BNB testnet
security: []
tags:
  - name: Gacha v2
    description: >-
      Direct-EOA pack browsing, purchases, collectible (e.g. card) reveals,
      purchase history and buybacks. Start here; no wallet access token is
      needed.
  - name: Marketplace
    description: >-
      Public collectible (e.g. card) browsing and external-wallet asks, bids,
      purchases and cancellations. Trading requires builder authorization and
      wallet action signatures.
  - name: Users
    description: >-
      What one wallet address has and did: its collectibles (e.g. cards), their
      total market value and its activities. The whole wallet, whichever builder
      it used. Requires your builder key only.
  - name: Redemption
    description: >-
      Shipping eligibility, quotes, redemption preparation, submission and
      tracking. Requires your builder key and a wallet access token for the same
      wallet.
  - name: Wallet access tokens
    description: >-
      Get, refresh and revoke the wallet access tokens that Redeem needs. The
      wallet signs a sign-in message (valid 5 minutes, one use); the API returns
      a wallet access token (15 minutes) and a refresh token (7 days, single
      use). Register exact partner frontend origins with Renaiss before use.
      Gacha and marketplace never use a wallet access token.
paths:
  /v2/marketplace/asks:
    post:
      tags:
        - Marketplace
      summary: Submit a signed listing
      description: >-
        Publish a listing with the order data and signature from the seller. The
        playground uses the testnet request format. See the endpoint page for
        the current mainnet fields.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tokenId:
                  type: string
                  pattern: ^\d+$
                  description: >-
                    Copy the top-level `tokenId` from preparation. It must have
                    the same uint256 value as `askData.tokenId`. Keep it as a
                    decimal string.
                  example: '9007199254740993'
                askData:
                  type: object
                  properties:
                    salt:
                      type: string
                    deadline:
                      type: string
                      pattern: ^\d+$
                    usdcAmount:
                      type: string
                      pattern: ^\d+$
                    owner:
                      type: string
                    tokenId:
                      type: string
                      pattern: ^\d+$
                      example: '9007199254740993'
                  required:
                    - salt
                    - deadline
                    - usdcAmount
                    - owner
                    - tokenId
                  description: >-
                    Copy `payload.askData` from the same preparation. Preserve
                    the signed fields, including the deadline in whole Unix
                    seconds.
                askSignature:
                  type: string
              required:
                - tokenId
                - askData
                - askSignature
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  operation:
                    type: string
                    enum:
                      - ask
                      - bid
                      - buy
                      - sell
                  orderId:
                    type: string
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - EXECUTED
                  executed:
                    type: boolean
                  executionTxHash:
                    type: string
                  matchedOrderId:
                    type: string
                required:
                  - operation
                  - orderId
                  - status
                  - executed
        '400':
          description: >-
            The request was refused before anything happened. A body that is not
            valid JSON is refused with a plain-text 400.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            text/plain:
              schema:
                type: string
              example: Malformed JSON in request body
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: A short sentence about what went wrong.
                  code:
                    type: string
                    enum:
                      - WRONG_REQUEST_PARAMS
                      - ASK_AMOUNT_NOT_POSITIVE
                      - OFFER_EXPIRY_TOO_LONG
                      - ASK_HAS_ALREADY_EXPIRED
                      - INVALID_ASK_SIGNATURE
                      - ASK_TOKEN_ID_MISMATCH
                      - COLLECTIBLE_ONCHAIN_OWNER_MISMATCH
                required:
                  - error
                  - code
              example:
                error: Signed order token ID differs from the submitted token ID
                code: ASK_TOKEN_ID_MISMATCH
        '401':
          description: >-
            The builder key is missing or not accepted.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: A short sentence about what went wrong.
                  code:
                    type: string
                    enum:
                      - API_AUTH_MISSING_CREDENTIAL
                      - API_AUTH_INVALID_CREDENTIAL
                required:
                  - error
                  - code
              example:
                error: Required authentication credential is missing
                code: API_AUTH_MISSING_CREDENTIAL
        '403':
          description: >-
            The signature is refused.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: A short sentence about what went wrong.
                  code:
                    type: string
                    enum:
                      - API_AUTH_INVALID_ACTION
                      - API_AUTH_CREDENTIAL_NOT_ALLOWED
                      - GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API
                required:
                  - error
                  - code
              example:
                error: Invalid wallet action proof
                code: API_AUTH_INVALID_ACTION
        '404':
          description: >-
            The collectible was not found.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: A short sentence about what went wrong.
                  code:
                    type: string
                    enum:
                      - COLLECTIBLE_NOT_FOUND
                required:
                  - error
                  - code
              example:
                error: Collectible not found
                code: COLLECTIBLE_NOT_FOUND
        '413':
          description: >-
            The request body exceeds 16 KiB.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            text/plain:
              schema:
                type: string
              example: Payload Too Large
        '429':
          description: >-
            Too many requests with this builder key.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: A short sentence about what went wrong.
                  code:
                    type: string
                    enum:
                      - API_AUTH_RATE_LIMITED
                required:
                  - error
                  - code
              example:
                error: Authentication rate limit exceeded
                code: API_AUTH_RATE_LIMITED
        '500':
          description: >-
            A failure on our side. Retry later.


            See [error codes and
            recovery](/api-reference/marketplace/submit-ask#http-errors).
          content:
            text/plain:
              schema:
                type: string
              example: Internal Server Error
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: A short sentence about what went wrong.
                  code:
                    type: string
                required:
                  - error
                  - code
              example:
                error: Internal server error
                code: FUNCTION_ERROR
      security:
        - builderAuth: []
      servers:
        - url: https://dev-api.renaiss.xyz
          description: BNB testnet
components:
  securitySchemes:
    builderAuth:
      type: apiKey
      in: header
      name: x-builder-api-key
      description: >-
        Your approved builder API key. Keep it on your backend. Gacha and
        marketplace writes also require wallet action signatures. Redeem also
        needs a wallet access token, a Bearer token the API issues after the
        wallet signs a sign-in message.

````

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