Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to Create and Update Offers Using JSON_LISTINGS_FEED #834

Open
impromani opened this issue Dec 20, 2024 · 4 comments
Open

How to Create and Update Offers Using JSON_LISTINGS_FEED #834

impromani opened this issue Dec 20, 2024 · 4 comments

Comments

@impromani
Copy link

impromani commented Dec 20, 2024

I am currently using the POST_FLAT_FILE_INVLOADER_DATA feed to submit data. This feed performs both actions—creating a new SKU if it doesn't exist and updating the SKU if it already exists.

I am planning to migrate from the POST_FLAT_FILE_INVLOADER_DATA feed to JSON_LISTINGS_FEED. However, after reviewing the documentation (linked below), I found that the provided examples only demonstrate how to update existing SKUs:
Listing Workflow Migration Tutorial.

{
 "operationType": "PATCH",
  "productType": "PRODUCT",
  "patches": [
    {
      "op": "replace",
      "path": "/attributes/purchasable_offer",
      "value": [
        {
          "currency": "USD",
          "our_price": [
            {
              "schedule": [
                {
                  "value_with_tax": 90.00
                }
              ]
            }
          ],
          "minimum_seller_allowed_price": [
            {
              "schedule": [
                {
                  "value_with_tax": 80.00
                }
              ]
            }
          ],
          "maximum_seller_allowed_price": [
            {
              "schedule": [
                {
                  "value_with_tax": 100.00
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "op": "replace",
      "path": "/attributes/fulfillment_availability",
      "value": [
        {
          "fulfillment_channel_code": "DEFAULT",
          "quantity": 5,
          "lead_time_to_ship_max_days": 1
        }
      ]
    }
    ... (more patches, if applicable)
  ]
}

I attempted to use the JSON_LISTINGS_FEED for this purpose, but it only updates existing SKUs and does not create new ones.

Could you please suggest a way to achieve both actions (create and update) in a single API call, similar to how it works with the previous feed?

Below are the feed attributes I am currently using with POST_FLAT_FILE_INVLOADER_DATA:

  • sku
  • price
  • minimum-seller-allowed-price
  • maximum-seller-allowed-price
  • quantity
  • product-id
  • product-id-type
  • item-condition
  • item-note

Any guidance would be greatly appreciated!

@jlevers
Copy link
Owner

jlevers commented Dec 27, 2024

I don't think it's possible to create new listings using the JSON_LISTINGS_FEED with only the data that's in the POST_FLAT_FILE_INVLOADER_DATA feed. Creating products using the Listings API tends to involve specifying a lot of product-type-specific information. In case I'm wrong, though, you could try adding a message with operation type UPDATE to the feed, specify the product ID information in addition to prices, quantity, condition, etc, and see if it works:

{
    "messageId": 1,
    "operationType": "UPDATE",
    "productType": "PRODUCT",
    "sku": "MY_SKU_0001",
    "attributes": {
        "externally_assigned_product_identifier": [
            {
                "type": "upc",
                "value": "your-upc-value"
            }
        ],
    }
}

@impromani
Copy link
Author

impromani commented Dec 30, 2024

Hi @jlevers

Thank you for your response. I tried using "operationType": "UPDATE", but I received the following error:

 "issues":[
      {
         "messageId":8,
         "code":"4000004",
         "severity":"ERROR",
         "message":"Creating products is not supported with the Amazon product type 'PRODUCT'. Either specify a specific Amazon product type, or specify a est requirement that only applies to listings."
      },

Could you also suggest the correct API call to create a product?

@jlevers
Copy link
Owner

jlevers commented Jan 5, 2025

Yeah, I didn't really expect that to work. You can create products through the JSON_LISTINGS_FEED or via the putListingsItems endpoint, which will both be formatted the same (you'll just package all the attributes you send in putListingsItems into a message formatted like the one in my last comment, but with the correct product type for the product you're trying to create).

@dartheditous
Copy link

Tagging onto this, does anyone have an example for when you're creating your own sku for an already-existing ASIN? Can you just use LISTING_OFFER_ONLY for that?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants