ProductIndex Offers API

The Offers API from ProductIndex — 4 operation(s) for offers.

GitHub OpenAPI

Operations 4

POST /api/offers/create/ Create a producer offer #
PATCH /api/offers/edit/ Edit an existing producer offer #
GET /api/offers/list/ List the caller's offers and offer-eligible products #
PATCH /api/offers/update/ Update an offer's status #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/productindex-ai:productindex-ai-offers-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

productindex-ai-offers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Productindex Ai Offers API
  version: 1.0.0
  contact:
    name: ProductIndex
    url: https://productindex.ai/contact
  description: 'Operations tagged Offers across 2 of this provider''s published API definitions: productindex-ai-mcp.json, productindex-ai-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://productindex.ai
  description: Production
security: []
tags:
- name: Offers
paths:
  /api/offers/create/:
    parameters:
    - $ref: '#/components/parameters/ApiVersion'
    post:
      operationId: createOffer
      summary: Create a producer offer
      description: Creates a new offer in `draft` status for a product the caller's organization has a verified `sells` or `manufactured_by` relationship to.
      security:
      - producerSession: []
      - producerBearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OfferCreateRequest'
      responses:
        '201':
          description: Offer created.
          content:
            application/json:
              schema:
                type: object
                required:
                - offer_id
                properties:
                  offer_id:
                    type: string
        '400':
          description: Validation error — missing/invalid `product_slug`, `headline` (required, ≤ 60 chars), `detail` (≤ 200 chars), `destination_url` (must be http/https), `price_usd`/`list_price_usd` (must be ≥ 0), `offer_types` (must be a subset of the valid enum), or `starts_at`/`expires_at` (expires_at must be after starts_at).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: No valid session or bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Caller's org has no verified `sells`/`manufactured_by` relationship to `product_slug` (`no_verified_relationship`), the org is deactivated, or a session caller isn't a producer account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offers
    servers:
    - url: https://productindex.ai
      description: Production
  /api/offers/edit/:
    parameters:
    - $ref: '#/components/parameters/ApiVersion'
    patch:
      operationId: editOffer
      summary: Edit an existing producer offer
      description: Partial update — only fields present in the body are changed. Ownership is enforced by scoping the UPDATE to the caller's `organization_id`; an `offer_id` belonging to a different org returns 404, not 403.
      security:
      - producerSession: []
      - producerBearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OfferEditRequest'
      responses:
        '200':
          description: Updated (or no-op if no editable fields were present in the body).
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '400':
          description: Validation error, applied only to fields present in the body — headline (non-empty, ≤ 60 chars), detail (≤ 200 chars), destination_url (must be http/https), price_usd/list_price_usd (must be ≥ 0), offer_types (must be a subset of the valid enum). Unlike create, this route does not validate starts_at/expires_at ordering.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: No valid session or bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No offer with this `offer_id` belongs to the caller's organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offers
    servers:
    - url: https://productindex.ai
      description: Production
  /api/offers/list/:
    parameters:
    - $ref: '#/components/parameters/ApiVersion'
    get:
      operationId: listOffers
      summary: List the caller's offers and offer-eligible products
      description: Returns the caller's organization's offers (newest 100) plus the products it's eligible to create offers for (products with a verified `sells`/`manufactured_by` relationship).
      security:
      - producerSession: []
      - producerBearerToken: []
      responses:
        '200':
          description: Offers and eligible products.
          content:
            application/json:
              schema:
                type: object
                required:
                - offers
                - products
                properties:
                  offers:
                    type: array
                    items:
                      $ref: '#/components/schemas/OfferRow'
                  products:
                    type: array
                    items:
                      type: object
                      properties:
                        product_slug:
                          type: string
                        relationship_type:
                          type: string
                          enum:
                          - sells
                          - manufactured_by
        '401':
          description: No valid session or bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offers
    servers:
    - url: https://productindex.ai
      description: Production
  /api/offers/update/:
    parameters:
    - $ref: '#/components/parameters/ApiVersion'
    patch:
      operationId: updateOfferStatus
      summary: Update an offer's status
      description: Status-only transition (`active` / `paused` / `expired`). For any other field, use `PATCH /api/offers/edit/`. Ownership is enforced the same way as edit — a mismatched `offer_id`/org pair returns 404.
      security:
      - producerSession: []
      - producerBearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - offer_id
              - status
              properties:
                offer_id:
                  type: string
                status:
                  type: string
                  enum:
                  - active
                  - paused
                  - expired
      responses:
        '200':
          description: Status updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '400':
          description: Missing `offer_id`, or `status` not one of `active`/`paused`/`expired`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: No valid session or bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No offer with this `offer_id` belongs to the caller's organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Offers
    servers:
    - url: https://productindex.ai
      description: Production
components:
  parameters:
    ApiVersion:
      name: ProductIndex-API-Version
      in: header
      required: false
      description: 'API version to use. Optional: the only version is 1, requests without this header get version 1, and any other value is rejected with a 400 (code unsupported_api_version). See the versioning policy in info.description.'
      schema:
        type: string
        enum:
        - '1'
        default: '1'
  schemas:
    OfferRow:
      type: object
      description: As stored/returned by GET /api/offers/list/. price_usd/list_price_usd are stored in cents but this reflects the raw DB row shape returned by that route today.
      properties:
        id:
          type: string
        product_slug:
          type: string
        headline:
          type: string
        detail:
          type:
          - string
          - 'null'
        destination_url:
          type: string
        price_usd:
          type:
          - number
          - 'null'
        list_price_usd:
          type:
          - number
          - 'null'
        status:
          type: string
          enum:
          - draft
          - active
          - paused
          - expired
        starts_at:
          type:
          - string
          - 'null'
          format: date-time
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        promo_code:
          type:
          - string
          - 'null'
        offer_types:
          type: array
          items:
            type: string
    OfferCreateRequest:
      type: object
      required:
      - product_slug
      - headline
      - destination_url
      properties:
        product_slug:
          type: string
        headline:
          type: string
          maxLength: 60
        detail:
          type: string
          maxLength: 200
        destination_url:
          type: string
          format: uri
          description: Must be http or https.
        price_usd:
          type: number
          minimum: 0
        list_price_usd:
          type: number
          minimum: 0
        starts_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: Must be after starts_at when both are present.
        promo_code:
          type: string
        offer_types:
          type: array
          items:
            type: string
            enum:
            - percentage_off
            - fixed_amount_off
            - free_shipping
            - bogo
            - bundle
            - free_gift
    OfferEditRequest:
      type: object
      required:
      - offer_id
      description: All fields besides offer_id are optional; only fields present in the body are updated.
      properties:
        offer_id:
          type: string
        headline:
          type: string
          maxLength: 60
        detail:
          type:
          - string
          - 'null'
          maxLength: 200
        destination_url:
          type: string
          format: uri
        price_usd:
          type:
          - number
          - 'null'
          minimum: 0
        list_price_usd:
          type:
          - number
          - 'null'
          minimum: 0
        starts_at:
          type:
          - string
          - 'null'
          format: date-time
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
        promo_code:
          type:
          - string
          - 'null'
        offer_types:
          type: array
          items:
            type: string
            enum:
            - percentage_off
            - fixed_amount_off
            - free_shipping
            - bogo
            - bundle
            - free_gift
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
      additionalProperties: true
      description: Common error envelope across every route in this spec. Some validation branches add extra fields alongside `error` (e.g. `field`, `max`, `valid`, `code`) — see each operation's per-status description for the exact fields a given failure mode adds.
  securitySchemes:
    integrationSignature:
      type: http
      scheme: signature
      description: 'RFC 9421 HTTP Message Signature with Ed25519, ProductIndex profile (full recipe and a tested Node implementation: https://productindex.ai/docs/developers#dev-sales-reporting). Headers: `Content-Digest: sha-256=:<base64 SHA-256 of the body>:`, `Signature-Input: pi=("@method" "@authority" "@path" "@query" "content-digest");created=<unix>;expires=<unix>;nonce="<22 base64url chars>";keyid="<kid>";alg="ed25519";tag="productindex-integration"`, `Signature: pi=:<base64 signature>:`. `@authority` is productindex.ai, `@path` has no trailing slash, `expires` is at most 60 s after `created`, and each nonce is accepted once. A producer''s own key (kid `custom_…`, created in Producer Dashboard → Sales reporting; ProductIndex stores only the public key) may call only the two /api/attribution/ postbacks, and only for its own organization''s `store`.'
    producerSession:
      type: apiKey
      in: cookie
      name: authjs.session-token
      description: Browser session cookie from signing in at /auth/signin, for a producer account (accountType='producer'). Served as "__Secure-authjs.session-token" over HTTPS. Not directly obtainable by a pure API/agent client — this auth mode is for the dashboard's own fetch() calls and the human-driven signup/verification flow, not for third-party integrations. Third-party/agent integrations should use producerBearerToken where the route supports it.
    producerBearerToken:
      type: http
      scheme: bearer
      description: Shopify-plugin producer link token (issued via the Shopify OAuth/link flow, validated with validateShopifyLinkToken). Only accepted on routes built on resolveProducerAuth — not every producer route supports this; register.ts and ucp-check.ts are session-only.
x-refined-from:
- productindex-ai-mcp.json
- productindex-ai-openapi.json