Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter buddhika23

    (@buddhika23)

    Thank you very much @rainfallnixfig and @rainfallnixfig.

    I am curious why it is not updating the sales order with refund.

    I think it is logical to update the sales order with refund.

    Thank you,
    Buddhika

    Thread Starter buddhika23

    (@buddhika23)

    Thank you very much @3sonsdevelopment for the reply.

    As I observed, it doesn’t goes to the refunded status if you did a partial refund.

    I am retrieving data by sorting to the last modified date of the order, as it doesn’t update the order with refund, I cannot pick this refunded order.
    I was looking for an option to get refund objects only without going through the order.

    Thank you,
    Buddhika

    Thread Starter buddhika23

    (@buddhika23)

    Hi @maykato,

    I am really sorry for my delayed reply.

    I managed to resolve the issue. I was an issue with the content type of the request.

    I used Postman to test the api which I generated through Swagger, it had added multipart/form-data with application/json which I added manually.
    Once I removed multipart/form-data it started to working as I expected.

    Thank you very much for the fast responses I received.

    Thread Starter buddhika23

    (@buddhika23)

    Thank you @corsonr again.

    I tried the same payload by just changing the ids of the attributes to match with my data, still it doesn’t reflect in the product attributes.
    Please check the requested payload and response payload as below.

    {
       "name":"Ship Your Idea",
       "type":"variable",
       "description":"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
       "short_description":"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
       "categories":[
          {
             "id":9
          },
          {
             "id":14
          }
       ],
       "images":[
          {
             "src":"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg’"
          },
          {
             "src":"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg’"
          },
          {
             "src":"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg’"
          },
          {
             "src":"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg’"
          }
       ],
       "attributes":[
          {
             "id":2,
             "position":0,
             "visible":false,
             "variation":true,
             "options":[
                "Black",
                "Green"
             ]
          },
          {
             "name":"Size",
             "position":0,
             "visible":true,
             "variation":true,
             "options":[
                "S",
                "M"
             ]
          }
       ],
       "default_attributes":[
          {
             "id":2,
             "option":"Black"
          },
          {
             "id":1,
             "option":"S"
          }
       ]
    }

    Response Payload

    {
        "id": 56,
        "name": "Product",
        "slug": "product-5",
        "permalink": "http://localhost:8080/woo/product/product-5/",
        "date_created": "2021-03-18T19:09:47",
        "date_created_gmt": "2021-03-18T13:39:47",
        "date_modified": "2021-03-18T19:09:47",
        "date_modified_gmt": "2021-03-18T13:39:47",
        "type": "simple",
        "status": "publish",
        "featured": false,
        "catalog_visibility": "visible",
        "description": "",
        "short_description": "",
        "sku": "",
        "price": "",
        "regular_price": "",
        "sale_price": "",
        "date_on_sale_from": null,
        "date_on_sale_from_gmt": null,
        "date_on_sale_to": null,
        "date_on_sale_to_gmt": null,
        "on_sale": false,
        "purchasable": false,
        "total_sales": 0,
        "virtual": false,
        "downloadable": false,
        "downloads": [],
        "download_limit": -1,
        "download_expiry": -1,
        "external_url": "",
        "button_text": "",
        "tax_status": "taxable",
        "tax_class": "",
        "manage_stock": false,
        "stock_quantity": null,
        "in_stock": true,
        "backorders": "no",
        "backorders_allowed": false,
        "backordered": false,
        "sold_individually": false,
        "weight": "",
        "dimensions": {
            "length": "",
            "width": "",
            "height": ""
        },
        "shipping_required": true,
        "shipping_taxable": true,
        "shipping_class": "",
        "shipping_class_id": 0,
        "reviews_allowed": true,
        "average_rating": "0",
        "rating_count": 0,
        "upsell_ids": [],
        "cross_sell_ids": [],
        "parent_id": 0,
        "purchase_note": "",
        "categories": [
            {
                "id": 15,
                "name": "Uncategorized",
                "slug": "uncategorized"
            }
        ],
        "tags": [],
        "images": [
            {
                "id": 0,
                "date_created": "2021-03-19T00:39:47",
                "date_created_gmt": "2021-03-18T13:39:47",
                "date_modified": "2021-03-19T00:39:47",
                "date_modified_gmt": "2021-03-18T13:39:47",
                "src": "http://localhost:8080/woo/wp-content/uploads/woocommerce-placeholder-450x450.png",
                "name": "Placeholder",
                "alt": "Placeholder",
                "position": 0
            }
        ],
        "attributes": [],
        "default_attributes": [],
        "variations": [],
        "grouped_products": [],
        "menu_order": 0,
        "price_html": "",
        "related_ids": [
            34,
            37,
            32,
            36,
            31
        ],
        "meta_data": [],
        "_links": {
            "self": [
                {
                    "href": "http://localhost:8080/woo/wp-json/wc/v2/products/56"
                }
            ],
            "collection": [
                {
                    "href": "http://localhost:8080/woo/wp-json/wc/v2/products"
                }
            ]
        }
    }

    Have I missed anything important? Please help to find it out.

    • This reply was modified 5 years, 1 month ago by buddhika23.
    Thread Starter buddhika23

    (@buddhika23)

    Thank you very much @corsonr for your very quick response.

    Yes, your understanding is exactly what I meant in my question.

    Actually this is the post, I referred in my attached sample code too. Unfortunately this method didn’t work for me. In this sample, it has consumed the version 2, I tried with v2 as well as v3.

    Thank you again for your quick suggestion.

Viewing 5 replies - 1 through 5 (of 5 total)