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

# Publish a product

> Put an archived product back on sale.

Authenticate with an API key that belongs to the product's organization and has Full access or the `products:products:write` permission. Only the Owner and Admin roles can grant it.

* Send no body.
* Only an archived product can be published.
* Publishing turns the payment link for the product's newest price back on, at the same URL, so that link works again wherever you shared it. If that price never had a link, a new one is created. The product's other payment links stay off.
* The response has the same shape as [Get a product](https://docs.anyway.sh/api-reference/endpoint/get-product.md), with `status` set to `PUBLISHED` and the active link in `paymentLinks`.
* There is no `Idempotency-Key` for this endpoint.

| Status | Code | Meaning |
| - | - | - |
| `400` | | The organization's payment account isn't ready, or the product has no price. |
| `401` | | The API key is missing or invalid. |
| `403` | `INSUFFICIENT_SCOPE` | The key lacks `products:products:write`. |
| `403` | `CARD_USD_VERIFICATION_REQUIRED` | Complete business verification first. |
| `403` | `ORG_FROZEN` | The organization's payments are frozen. |
| `404` | | The product doesn't exist or belongs to another organization. |
| `409` | `PRODUCT_CONFLICT` | The product isn't archived. |
| `503` | `CARD_USD_CAPABILITY_UNAVAILABLE` | Verification status is temporarily unavailable. Try again later. |


## OpenAPI

````yaml api-reference/openapi.json POST /v1/product/{id}/publish
openapi: 3.0.3
info:
  description: >-
    Organization-scoped commerce API for merchant backends: create and manage
    checkout sessions, and query commerce records.
  title: Anyway Merchant API
  contact: {}
  version: '1.0'
  x-source: anyway-backend-go
servers:
  - url: https://merchant-api-prod.anyway.sh
security: []
paths:
  /v1/product/{id}/publish:
    post:
      tags:
        - products
      summary: Publish a product
      description: >-
        Publishes an archived product and turns the payment link for its newest
        price back on, at the same URL (a new link if that price never had one);
        the product's other links stay off. Requires Full access or the
        `products:products:write` permission. No request body. The response is
        the same as `GET /v1/product/{id}`, with the active link in
        `paymentLinks`. Returns 409 PRODUCT_CONFLICT if the product is not
        archived. There is no Idempotency-Key.
      parameters:
        - description: Product ID
          name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/response.ApiResponse-product_ProductResponse
        '400':
          description: >-
            Bad Request. The organization's payment account isn't ready, or the
            product has no price.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '403':
          description: >-
            Forbidden. The API key lacks the required permission
            (INSUFFICIENT_SCOPE), the organization is frozen (ORG_FROZEN), or
            business verification is required (CARD_USD_VERIFICATION_REQUIRED).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '404':
          description: >-
            Not Found. The product does not exist or belongs to another
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '409':
          description: Conflict. The product is not archived (PRODUCT_CONFLICT).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '503':
          description: >-
            Service Unavailable. Verification status is temporarily unavailable
            (CARD_USD_CAPABILITY_UNAVAILABLE); retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
      security:
        - APIKeyAuth: []
components:
  schemas:
    response.ApiResponse-product_ProductResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/product.ProductResponse'
        error:
          $ref: '#/components/schemas/response.ErrorDetail'
        message:
          type: string
        success:
          type: boolean
    response.ApiResponse-any:
      type: object
      properties:
        data: {}
        error:
          $ref: '#/components/schemas/response.ErrorDetail'
        message:
          type: string
        success:
          type: boolean
    product.ProductResponse:
      type: object
      properties:
        createdAt:
          type: string
        description:
          type: string
        id:
          description: 'Deprecated: use productId.'
          type: string
          deprecated: true
        name:
          type: string
        orgId:
          type: string
        paymentLinks:
          type: array
          items:
            $ref: '#/components/schemas/product.PaymentLinkResponse'
        productId:
          type: string
        status:
          type: string
        updatedAt:
          type: string
    response.ErrorDetail:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    product.PaymentLinkResponse:
      type: object
      properties:
        amount:
          type: number
          nullable: true
        createdAt:
          type: string
        currency:
          type: string
        flexibleAmount:
          type: boolean
        isActive:
          type: boolean
        name:
          type: string
        paymentLinkUrl:
          type: string
        pricingId:
          type: string
        pricingType:
          type: string
        provider:
          type: string
        title:
          type: string
        description:
          type: string
        minAmount:
          type: number
          nullable: true
        maxAmount:
          type: number
          nullable: true
        successUrl:
          type: string
          description: >-
            Where the customer is sent after paying. Empty when the Anyway
            receipt is used.
  securitySchemes:
    APIKeyAuth:
      description: 'Merchant API key (format: ak_BASE64)'
      type: apiKey
      name: X-API-Key
      in: header

````

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