← All operations
POST/api/v1/admin/catalog/products

Commerce_PublishCommerceProduct

Authentication
required-admin
Cache policy
none
Success and errors
201, 400, 401, 403, 404, 409, 500, 503
Stability
v1 stable contract

OpenAPI operation

{
  "operationId": "Commerce_PublishCommerceProduct",
  "summary": "POST /api/v1/admin/catalog/products",
  "tags": [
    "Commerce"
  ],
  "parameters": [
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{1,99}$"
            },
            "kind": {
              "type": "string",
              "enum": [
                "SUBSCRIPTION",
                "BOOST",
                "ADVERTISEMENT",
                "VERIFICATION",
                "CUSTOM_LISTING",
                "SERVICE_BUNDLE",
                "CREDIT_BUNDLE"
              ]
            },
            "name": {
              "type": "string",
              "minLength": 2,
              "maxLength": 160
            },
            "description": {
              "type": "string",
              "minLength": 10,
              "maxLength": 10000
            },
            "termsMarkdown": {
              "type": "string",
              "minLength": 10,
              "maxLength": 100000
            },
            "fulfillmentPolicyCode": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{1,99}$"
            },
            "entitlementCodes": {
              "minItems": 1,
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[A-Z0-9][A-Z0-9._:-]{1,119}$"
              }
            },
            "entitlementDurationDays": {
              "anyOf": [
                {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 3650
                },
                {
                  "type": "null"
                }
              ]
            },
            "networkId": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "assetId": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "units": {
              "type": "string",
              "pattern": "^(?:0|[1-9][0-9]{0,77})$"
            },
            "cadence": {
              "type": "string",
              "enum": [
                "ONE_TIME",
                "DAILY",
                "MONTHLY",
                "YEARLY"
              ]
            },
            "effectiveFrom": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "reason": {
              "type": "string",
              "minLength": 10,
              "maxLength": 2000
            },
            "dryRun": {
              "default": true,
              "type": "boolean"
            },
            "confirmation": {
              "type": "string",
              "maxLength": 300
            }
          },
          "required": [
            "code",
            "kind",
            "name",
            "description",
            "termsMarkdown",
            "fulfillmentPolicyCode",
            "entitlementCodes",
            "entitlementDurationDays",
            "networkId",
            "assetId",
            "units",
            "cadence",
            "reason"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "security": [
    {
      "cookieAuth": []
    }
  ],
  "responses": {
    "201": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "data",
              "meta"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "applied": {
                    "type": "boolean"
                  },
                  "confirmation": {
                    "type": "string"
                  },
                  "product": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "code": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "SUBSCRIPTION",
                          "BOOST",
                          "ADVERTISEMENT",
                          "VERIFICATION",
                          "CUSTOM_LISTING",
                          "SERVICE_BUNDLE",
                          "CREDIT_BUNDLE"
                        ]
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "DRAFT",
                          "ACTIVE",
                          "RETIRED"
                        ]
                      },
                      "version": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "termsVersion": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "fulfillmentPolicyCode": {
                        "type": "string"
                      },
                      "entitlementDurationDays": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "entitlementCodes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "prices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "networkId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "network": {
                              "type": "string"
                            },
                            "assetId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "symbol": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "decimals": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 255
                            },
                            "units": {
                              "type": "string",
                              "pattern": "^(?:0|[1-9][0-9]{0,77})$"
                            },
                            "cadence": {
                              "type": "string",
                              "enum": [
                                "ONE_TIME",
                                "DAILY",
                                "MONTHLY",
                                "YEARLY"
                              ]
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "id",
                            "networkId",
                            "network",
                            "assetId",
                            "symbol",
                            "decimals",
                            "units",
                            "cadence",
                            "version"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "effectiveFrom": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "effectiveUntil": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "code",
                      "kind",
                      "state",
                      "version",
                      "name",
                      "description",
                      "termsVersion",
                      "fulfillmentPolicyCode",
                      "entitlementDurationDays",
                      "entitlementCodes",
                      "prices",
                      "effectiveFrom",
                      "effectiveUntil"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "applied",
                  "confirmation",
                  "product"
                ],
                "additionalProperties": false
              },
              "meta": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "requestId",
                  "schemaVersion",
                  "buildVersion",
                  "generatedAt",
                  "freshness"
                ],
                "properties": {
                  "requestId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "buildVersion": {
                    "type": "string"
                  },
                  "generatedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "freshness": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "projectedAt",
                      "sourceWatermark"
                    ],
                    "properties": {
                      "projectedAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      },
                      "sourceWatermark": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "invalid request",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "403": {
      "description": "forbidden",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "404": {
      "description": "not found",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "409": {
      "description": "conflict",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "500": {
      "description": "internal error",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "503": {
      "description": "dependency unavailable",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    }
  },
  "x-auth-mode": "required-admin",
  "x-cache-policy": "none",
  "x-required-scopes": [],
  "x-rate-cost": 1,
  "x-stability": "STABLE"
}