メインコンテンツへスキップ
テスト環境から本番環境に商品を公開します。 This is a one-way, first-publish-only operation that copies the current test version to production.
POST /v1/actions/onetime-product/publish-product
認証: API Key
このエンドポイントでは X-Environment ヘッダーを含めないでください。公開は常にテストから本番への一方向です。

リクエストボディ

フィールド必須説明
idstringはい商品 ID(Short ID 形式 PROD_xxx

リクエスト例

const { product } = await client.onetimeProducts.publish({
  id: "PROD_3kF9mNpQrStUvWxYz1A2bC",
});

成功レスポンス (200)

{
  "data": {
    "id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
    "storeId": "STO_2aUyqjCzEIiEcYMKj7TZtw",
    "prodVersionId": "PROD_7dG4hJkLmNpQrStUvWxYz1",
    "testVersionId": "PROD_7dG4hJkLmNpQrStUvWxYz1",
    "prodStatus": "active",
    "testStatus": "active",
    "createdAt": "2026-01-15T10:30:00.000Z",
    "updatedAt": "2026-01-15T12:00:00.000Z",
    "version": {
      "id": "PROD_7dG4hJkLmNpQrStUvWxYz1",
      "productId": "PROD_3kF9mNpQrStUvWxYz1A2bC",
      "versionNumber": 1,
      "name": "Premium Template Pack",
      "description": "50 premium design templates for your next project.",
      "prices": {
        "USD": { "amount": "49.00", "taxIncluded": false, "taxCategory": "digital_goods" },
        "EUR": { "amount": "45.00", "taxIncluded": true, "taxCategory": "digital_goods" }
      },
      "media": [
        { "type": "image", "url": "https://example.com/templates-preview.png", "alt": "Template preview" }
      ],
      "successUrl": "https://example.com/thank-you",
      "metadata": { "category": "design", "fileCount": "50" },
      "createdAt": "2026-01-15T10:30:00.000Z"
    }
  }
}

レスポンスフィールド

商品作成のレスポンスと同じです。
初回公開のみがサポートされています。商品に本番バージョンが存在すると、このエンドポイントは同じ商品に対して再使用できません。初回公開後に本番バージョンを更新するには、X-Environment: prod ヘッダー付きの 商品の更新 エンドポイントを使用してください。

エラーレスポンス

ステータスエラー説明
400Missing required field: idid not provided
400No test version foundProduct has no version in the test environment
400Test version is not activeThe test version status is inactive
400Production already has a versionProduct has already been published to production
404Product not foundProduct does not exist or is not accessible