Open Popecho
    • En Docs
      GET
    • Cn Docs
      GET

      En Docs

      GET

      Popecho Third Merchant Product API Documentation#

      1. API Overview#

      This API allows partner merchants to submit or update products on Popecho. The product data structure is consistent with the platform's internal product structure and supports:
      Product name, subtitle, summary, and details
      Product main images, category, and base price
      SKUs, inventory, and SKU images
      Sales attributes
      SPU tiered pricing
      Optional editor template JSON
      Products submitted by merchants are not published immediately. After each creation or update, the product enters the Pending Review state and remains unavailable for sale. It is published only after platform approval.
      Merchant products are finished products. After selecting a SKU and quantity, the customer proceeds directly through the regular cart and payment flow. The customer does not enter the customization editor and does not need to upload a design or reference image.

      2. Environment Information#

      EnvironmentBase URL
      TestProvided by Popecho, for example https://opentest.popecho.art/
      ProductionProvided by Popecho, for example https://open.popecho.art/
      The internal service uses port 7010 by default. Third parties must only use the HTTPS gateway address provided by the platform and must not access the internal service port directly.

      3. Authentication#

      Popecho assigns an ApiKey and an ApiSecret to each merchant. Include them in the request headers:
      Important:
      Do not put the ApiSecret in frontend code or a public repository.
      Do not print complete request headers in logs.
      The server identifies the merchant from the ApiKey. Do not include merchantId in the request body.
      Requests are rejected when the merchant is disabled or the credentials are invalid.
      Merchant account creation, activation or deactivation, and API credential generation or reset are managed by the Popecho platform and are not part of the third-party open API.
      If a self-service merchant profile API is provided later, a merchant will only be able to update the profile associated with its current credentials and will not be able to change its status or API credentials.

      4. Upload Product Images#

      A third party does not need to already have image URLs under a Popecho domain. Upload local images through this API first, and then use the returned url in the product main images, SKU images, or editor template.

      Request#

      The files form field may be repeated to upload multiple images. A request may contain up to 20 images. Only image files are accepted, and each file may be up to 10 MB.

      Success Response#

      {
        "code": 0,
        "msg": "success",
        "data": [
          {
            "bucketName": "popecho",
            "fileName": "c18f4f8f.jpg",
            "url": "https://popecho.art/api/file/openFile/popecho/309f17d92e86450998bed1a49e382ba1.jpg",
            "coverUrl": "https://popecho.art/api/file/openFile/popecho-cover/309f17d92e86450998bed1a49e382ba1.webp"
          }
        ]
      }
      Use url when the original image is required in product data. coverUrl may be used for list thumbnails and similar scenarios. Public image URLs hosted by the third party are not transferred to Popecho automatically. Upload images through this API before submitting the final product.
      A merchant logo or avatar is also uploaded through this API. The platform saves the returned original-image url as the merchant profile's logoUrl, which is displayed on the merchant aggregation page in the storefront.

      5. Submit or Update a Product#

      Request#

      The first submission of an externalProductId by a merchant creates a product. Submitting the same externalProductId again updates the existing product. Use a stable and unique product ID from the merchant's own system.

      Request Body Structure#

      FieldTypeRequiredDescription
      externalProductIdstringYesUnique product ID in the merchant system, up to 128 characters
      productobjectYesProduct body, using the same structure as the Madbuz product save model
      product.spuobjectYesBasic SPU information
      product.skusarrayYesSKU list containing at least one item
      product.skuAttributeValuesarrayNoAssociations between SKUs and sales attribute values
      product.spuLadderPricesarrayNoSPU tiered prices
      product.attributeJsonarrayNoProduct sales attribute definitions
      editorTemplateJsonstringNoRaw JSON string exported by the editor
      Platform fields supplied by a third party, including spu.id, spu.spuCode, spu.saleable, spu.verifyStatus, spu.custom, sku.id, and sku.spuId, cannot be used to bypass platform rules. The platform generates internal IDs for new products. The platform always sets spu.custom to 2, which identifies a finished merchant product.

      Complete Example#

      {
        "externalProductId": "IP-PRODUCT-10001",
        "product": {
          "spu": {
            "spuName": "IP Collaboration Custom Canvas Bag",
            "slug": "ip-custom-canvas-bag",
            "subTitle": "Upload an image to create your own canvas bag",
            "categoryId": 1001,
            "brandId": 2001,
            "mainImage": [
              "https://popecho.art/api/file/openFile/popecho/309f17d92e86450998bed1a49e382ba1.jpg",
              "https://popecho.art/api/file/openFile/popecho-cover/309f17d92e86450998bed1a49e382ba1.webp"
            ],
            "price": 19.90,
            "discount": 1.00,
            "description": "Product summary",
            "detailHtml": "<p>Product details</p>",
            "weight": 0.25,
            "volume": 0.001,
            "minOrderQty": 1,
            "ladderPriceSupport": 1
          },
          "skus": [
            {
              "skuName": "White / Standard",
              "price": 19.90,
              "costPrice": 10.00,
              "marketPrice": 29.90,
              "stock": 9999,
              "lowStock": 10,
              "mainImage": "https://cdn.example.com/products/10001/white.jpg",
              "enabled": 1,
              "weight": "0.25"
            }
          ],
          "attributeJson": [
            {
              "attributeId": 10,
              "attributeName": "Color",
              "attributeValueId": "101",
              "attributeValueName": "White",
              "valueText": "White"
            }
          ],
          "skuAttributeValues": [
            {
              "attributeId": 10,
              "attributeValueId": 101,
              "valueText": "White"
            }
          ],
          "spuLadderPrices": [
            {
              "minQuantity": 1,
              "maxQuantity": 9,
              "price": 19.90,
              "discount": 1.00
            },
            {
              "minQuantity": 10,
              "maxQuantity": 49,
              "price": 17.90,
              "discount": 0.90
            },
            {
              "minQuantity": 50,
              "maxQuantity": null,
              "price": 15.90,
              "discount": 0.80
            }
          ]
        },
        "editorTemplateJson": "{\"schemaVersion\":\"1.0\",\"surfaces\":[],\"slots\":[]}"
      }
      editorTemplateJson is currently stored exactly as the submitted string. If the merchant does not have an editor template, omit the field or send null. Image replacement and rendering rules for the template will be defined by a future editor protocol.

      Success Response#

      {
        "code": 0,
        "msg": "success",
        "data": {
          "relationId": 123,
          "spuId": 456,
          "externalProductId": "IP-PRODUCT-10001",
          "auditStatus": 0
        }
      }
      Field descriptions:
      FieldDescription
      relationIdMerchant-product association record ID, which may be provided to the platform when troubleshooting
      spuIdPopecho platform product ID
      externalProductIdMerchant product ID
      auditStatus0 Pending Review, 1 Approved, 2 Rejected

      6. Review and Publication Workflow#

      1.
      The merchant calls the image upload API and obtains platform image URLs.
      2.
      The merchant places the platform image URLs in the product data and calls the product submission API.
      3.
      popecho validates the ApiKey, ApiSecret, and merchant status.
      4.
      popecho obtains a trusted merchantId from the credentials and calls the internal popecho-product API.
      5.
      popecho converts the request into the platform's complete product model and saves the SPU, SKUs, sales attributes, tiered prices, and merchant-product association in one complete save operation.
      6.
      The product is forced into the Pending Review and unavailable-for-sale states.
      7.
      Platform operations personnel review the product.
      8.
      After approval, the platform marks the product as approved and publishes it. If rejected, the product remains unavailable for sale and the rejection reason is recorded.
      9.
      If an approved product is submitted again with changes, it returns to Pending Review and is taken off sale.
      Product updates use complete-replacement semantics. The SKU list, sales attributes, and tiered prices in the request replace the corresponding existing data. Therefore, an update must also contain the complete product data rather than only the changed fields.

      Customer Ordering Mode#

      The spu.custom field in product details distinguishes the customer ordering flow:
      spu.customOrdering mode
      0Editor-customized product; the customer must complete a design
      1Manual quotation product; the customer may submit reference images and requirements
      2Finished merchant product; the customer only selects a SKU and quantity and proceeds through the regular cart and payment flow
      Products created or updated through the merchant open API are always type 2. The productInfo, originalPictureInfo, and resourceInfo fields in the regular cart API are optional for this mode.
      For finished merchant products, the platform uses the first valid image in spu.mainImage as the cart and order display image. Provide at least one main image and place the preferred customer-facing image first in the array.

      7. Common Failure Reasons#

      ScenarioDescription
      Missing request headersX-Api-Key or X-Api-Secret was not provided
      Invalid credentialsThe ApiKey does not exist, the merchant is disabled, or the ApiSecret is incorrect
      Missing product IDexternalProductId is empty
      Missing SPUproduct.spu is empty
      Missing SKUproduct.skus is empty; a product requires at least one SKU
      Invalid fieldsCategory, brand, attribute, image, or other data does not comply with platform rules
      Internal service failureThe product service is unavailable or product data could not be saved
      The third party should record the request time, externalProductId, and response content, but must redact the X-Api-Secret.

      7. cURL Example#

      8. Versioning#

      This is the first version of the API. Adding optional fields is not considered a breaking change. If a field is removed, its meaning changes, or its required status changes, a new API version must be released and merchants must be notified in advance.

      请求参数

      无

      请求示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location ''

      返回响应

      🟢200成功
      application/json
      Bodyapplication/json

      示例
      {}
      修改于 2026-07-15 02:38:24
      下一页
      Cn Docs
      Built with