# Publish a product

For designers.

Checks that nothing blocks publishing, then publishes. When something does, the first step ends the workflow and `blockers` says what to fix, in order: account blockers (business registration, store settings) are fixed in the dashboard, product blockers (category, compliance documents) through the API.

## What you need

-   `product_id` (string, required): The product to publish (`prd_...`).

## Step 1: Get a product

[GET `/v2/products/{id}`](https://public-api.dapi.digital/docs/reference/products.md#get_product)

Read the product. `publishing.can_publish` is true once its designs are approved and nothing else blocks it; otherwise `publishing.blockers` lists each blocker with a `code` and what to do.

**Parameters**

```json
{
  "path id": "$inputs.product_id"
}
```

Succeeds when:

-   `$statusCode == 200`
-   `$response.body#/publishing/can_publish == true`

Keeps for the next steps:

-   `review_status`: `$response.body#/review/status`
-   `blockers`: `$response.body#/publishing/blockers`

## Step 2: Publish a product

[POST `/v2/products/{id}/publish`](https://public-api.dapi.digital/docs/reference/products.md#publish_product)

Publish. Refused with `plan_limit_reached` when your plan limit of public products is reached, or `cannot_publish` (with `details.blockers`) if something changed since the check.

**Parameters**

```json
{
  "path id": "$inputs.product_id"
}
```

Succeeds when:

-   `$statusCode == 200`

Otherwise:

-   `plan_limit_reached`: stop the workflow when `$statusCode == 403`.
-   `cannot_publish`: stop the workflow when `$statusCode == 409`.

Keeps for the next steps:

-   `is_public`: `$response.body#/publishing/is_public`

## As a workflow file

The workflow returns:

-   `is_public`: `$steps.publish.outputs.is_public`
-   `blockers`: `$steps.check_product.outputs.blockers`

Values starting with `$` are filled in as you go: `$inputs.x` is something you provide, `$steps.s.outputs.o` is a value an earlier step returned, and `$response.body#/path` a field of this response.

This recipe is the workflow `publish_product` of [arazzo.json](https://public-api.dapi.digital/docs/arazzo.json), an [Arazzo 1.0](https://spec.openapis.org/arazzo/latest.html) document that tools and AI agents can follow step by step.

---

3DAPI API Docs. This page on the web: https://public-api.dapi.digital/docs/guides/publish-product. Index of every page: https://public-api.dapi.digital/docs/llms.txt.
