【问题标题】:How can I update inventory item quantity by calling NetSUITE REST API using postman如何通过使用邮递员调用 NetSUITE REST API 来更新库存项目数量
【发布时间】:2020-06-08 20:05:09
【问题描述】:

我正在使用 Postman 来使用 NETSUITE Rest API。

我已使用邮递员和使用不记名令牌身份验证获得令牌。

我可以使用 API 调用查看项目

{{REST_SERVICES}}/record/v1/inventoryItem/610

我得到的回应是:

{
"links": [
    {
        "rel": "self",
        "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610"
    }
],
"assetAccount": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/account/125"
        }
    ],
    "id": "125",
    "refName": "1001 Stock"
},
"atpmethod": "CUMULATIVE_ATP_WITH_LOOK_AHEAD",
"autoLeadTime": false,
"autoPreferredStockLevel": false,
"autoReorderPoint": false,
"averageCost": 3.27,
"cogsAccount": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/account/126"
        }
    ],
    "id": "126",
    "refName": "5001 Cost of Goods Sold"
},
"copyDescription": false,
"cost": 2.61,
"costEstimateType": "LASTPURCHPRICE",
"costingMethod": "FIFO",
"costingMethodDisplay": "FIFO",
"countryOfManufacture": "GB",
"createdDate": "2014-10-17T16:34:00Z",
"currency": {
    "links": [],
    "id": "GBP",
    "refName": "GBP"
},
"custitem1": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem1"
        }
    ]
},
"custitem2": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem2"
        }
    ]
},
"custitem8": "B0041SO0C6",
"custitem_aptuss_1months": 135,
"custitem_aptuss_1weeks": 25,
"custitem_aptuss_3months": 357,
"custitem_hsnf_amz_asin": "B0041SO0C6",
"custitem_hsnf_amz_category": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_category"
        }
    ]
},
"custitem_hsnf_amz_fba": false,
"custitem_hsnf_amz_flag": "Y",
"custitem_hsnf_amz_listinglink": "http://www.amazon.co.uk/gp/product/B0041SO0C6",
"custitem_hsnf_amz_msrp": 5.75,
"custitem_hsnf_amz_node1": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_node1"
        }
    ]
},
"custitem_hsnf_amz_node2": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_node2"
        }
    ]
},
"custitem_hsnf_amz_node2filt_1": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_node2filt_1"
        }
    ]
},
"custitem_hsnf_amz_node2filt_2": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_node2filt_2"
        }
    ]
},
"custitem_hsnf_amz_nodefilt_1": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_nodefilt_1"
        }
    ]
},
"custitem_hsnf_amz_nodefilt_2": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_amz_nodefilt_2"
        }
    ]
},
"custitem_hsnf_amz_price": 8.5,
"custitem_hsnf_amz_title": "Salon System Just Wax Vanilla Cream Wax with an Intoxicating Aroma of Vanilla 450g",
"custitem_hsnf_cosmos_naturalgoods": false,
"custitem_hsnf_cosmos_organicgoods": false,
"custitem_hsnf_ebay_account": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_ebay_account"
        }
    ]
},
"custitem_hsnf_ebay_bestoffer": false,
"custitem_hsnf_ebay_category": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_ebay_category_list/273"
        }
    ],
    "id": "273",
    "refName": "Shaving & Hair Removal ->Waxing Supplies  : 82565"
},
"custitem_hsnf_ebay_category2": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_ebay_category_list/274"
        }
    ],
    "id": "274",
    "refName": "Shaving & Hair Removal ->Other Hair Removal  : 11840"
},
"custitem_hsnf_ebay_condition": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_list_condition/1"
        }
    ],
    "id": "1",
    "refName": "New"
},
"custitem_hsnf_ebay_description": "Salon System Just Wax Vanilla Creme Wax is deliciously creamy with intoxicating aroma of vanilla.<p>  \r\n  \r\n<b>Key Features:</b><p>  \r\nTried and trusted by therapists, spas and salons.<p>  \r\nJust Wax is the leading range of professional depilatory products. <p>  \r\nAn excellent wax for removing unwanted hair from all areas of the body. <p>  \r\n  \r\nBrand leaders and experts in professional beauty, Salon System deliver an exclusive and comprehensive range of exceptional products for beauty therapists, nail technicians, salons and spas.<p>  \r\n  \r\nOur enduring philosophy is to develop products of exceptional quality that are easy to use with effective results. Lash enhancements, depilatory waxing, nail extensions, manicure, pedicure and skincare. <p>",
"custitem_hsnf_ebay_flag": "I",
"custitem_hsnf_ebay_gsp": false,
"custitem_hsnf_ebay_imm_paymt": true,
"custitem_hsnf_ebay_is_effect": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_ebay_is_effect"
        }
    ]
},
"custitem_hsnf_ebay_is_type": "Wax",
"custitem_hsnf_ebay_listinglink": "https://www.ebay.co.uk/itm/",
"custitem_hsnf_ebay_markdown_manager": false,
"custitem_hsnf_ebay_ratetable": false,
"custitem_hsnf_ebay_shipping": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_ebay_shipping_list/2"
        }
    ],
    "id": "2",
    "refName": "YODEL48/24/RM INT."
},
"custitem_hsnf_ebay_shop_category": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customrecord_hsnf_ebay_shop_cat/119"
        }
    ],
    "id": "119",
    "refName": "Waxing&gt; Wax : 4979908012"
},
"custitem_hsnf_ebay_template": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_list_ebaytemplates/5"
        }
    ],
    "id": "5",
    "refName": "Raddyx-mobile"
},
"custitem_hsnf_ebay_title": "Salon System Just Wax Vanilla Crème Cream Depilatory Hair Removal Waxing 450",
"custitem_hsnf_eligible_forsale_usa": false,
"custitem_hsnf_fba_de": false,
"custitem_hsnf_fba_es": false,
"custitem_hsnf_fba_fr": false,
"custitem_hsnf_fba_it": false,
"custitem_hsnf_image_url": "https://justbeauty-uk.s3.amazonaws.com/0202123_V2.jpg",
"custitem_hsnf_img_main_name": "0202123_V2",
"custitem_hsnf_inv_brand": "Salon System",
"custitem_hsnf_inv_cbm": 0.0,
"custitem_hsnf_is_crueltyfree": false,
"custitem_hsnf_is_vegan": false,
"custitem_hsnf_item_caseqty": "12",
"custitem_hsnf_item_discontinued": false,
"custitem_hsnf_item_hazardouscount": 0.0,
"custitem_hsnf_item_ishazardous": false,
"custitem_hsnf_item_isparent": false,
"custitem_hsnf_item_itemsize": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_list_itemsize/2"
        }
    ],
    "id": "2",
    "refName": "Packet"
},
"custitem_hsnf_item_organic": false,
"custitem_hsnf_magento_novariation": false,
"custitem_hsnf_mg_variation": false,
"custitem_hsnf_mtrx_prodcut_type": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtrx_prodcut_type"
        }
    ]
},
"custitem_hsnf_mtx_edition_variation": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_edition_variation"
        }
    ]
},
"custitem_hsnf_mtx_flavor_variation": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_flavor_variation"
        }
    ]
},
"custitem_hsnf_mtx_num_items": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_num_items"
        }
    ]
},
"custitem_hsnf_mtx_pillqty": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_pillqty"
        }
    ]
},
"custitem_hsnf_mtx_pilltype_variation": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_pilltype_variation"
        }
    ]
},
"custitem_hsnf_mtx_prod_variation": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_prod_variation"
        }
    ]
},
"custitem_hsnf_mtx_product_formulation": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_product_formulation"
        }
    ]
},
"custitem_hsnf_mtx_shade": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mtx_shade"
        }
    ]
},
"custitem_hsnf_mygel_factory_kits": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_mygel_factory_kits"
        }
    ]
},
"custitem_hsnf_organic_food_fed": false,
"custitem_hsnf_s4y_category": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_s4y_category"
        }
    ]
},
"custitem_hsnf_tesco_uploaded": false,
"custitem_hsnf_valogix_itemclass_list": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_valogix_itemclass_list/14"
        }
    ],
    "id": "14",
    "refName": "UK Wholesale Replenishment"
},
"custitem_hsnf_vs_active": "Y",
"custitem_hsnf_vs_department1": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_hsnf_vs_departments/16"
        }
    ],
    "id": "16",
    "refName": "Waxing : Wax"
},
"custitem_hsnf_vs_description": "<p>Salon System Just Wax Vanilla Creme Wax is deliciously creamy with intoxicating aroma of vanilla.</p>\r\n\r\n<p><b>Key Features:</b></p>\r\n\r\n<ul>\r\n <li>Tried and trusted by therapists, spas and salons.</li>\r\n <li>Just Wax is the leading range of professional depilatory products.</li>\r\n <li>An excellent wax for removing unwanted hair from all areas of the body.</li>\r\n</ul>\r\n\r\n<p>&nbsp;</p>",
"custitem_hsnf_vs_rrp": 7.65,
"custitem_hsnf_vs_sale_price": 7.65,
"custitem_hsnf_vs_tag_colour": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_hsnf_vs_tag_colour"
        }
    ]
},
"custitem_hsnf_vs_title": "Salon System Just Wax Vanilla Wax 450gr",
"custitem_hsnf_vs_variation": true,
"custitem_lm_lastpurchaseprice": 3.27,
"custitem_nbs_brandlist": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customlist_nbs_brand/142"
        }
    ],
    "id": "142",
    "refName": "Salon System"
},
"custitem_nbs_excludedstorefrontreason": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_nbs_excludedstorefrontreason"
        }
    ]
},
"custitem_nbs_excludedstorefronts": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_nbs_excludedstorefronts"
        }
    ]
},
"custitem_nbs_excludedsubstorefronts": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/custitem_nbs_excludedsubstorefronts"
        }
    ]
},
"custitem_nbs_leightondennyflag": "F",
"custitem_nbs_multilanguageartworkcreat": false,
"custitem_nbs_requiresexpirydate": false,
"custitem_nbs_requiresmsds": false,
"custitem_nsts_rm_item_classification": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customrecord_nsts_rm_generic_class/1"
        }
    ],
    "id": "1",
    "refName": "All"
},
"custitem_omp_autoprint_bincount": false,
"custitem_omp_autoprint_receipt": false,
"custitem_preload_stockcount": 52.0,
"custitem_sps_item_synch": false,
"custitemlastpostedtofarapp": "2020-04-07 20:48:45.0 Europe/London",
"customForm": "3",
"displayName": "Salon System Just Wax Vanilla Cream Wax",
"dontshowprice": false,
"enforceminqtyinternally": true,
"excludefromsitemap": false,
"externalId": "0202123",
"froogleproductfeed": false,
"id": "610",
"incomeAccount": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/account/54"
        }
    ],
    "id": "54",
    "refName": "4000 Sales"
},
"internalid": 610,
"isdonationitem": false,
"isDropShipItem": false,
"isgcocompliant": false,
"isInactive": false,
"isonline": false,
"isSpecialOrderItem": false,
"itemId": "0202123",
"itemType": "InvtPart",
"itemVendor": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/itemVendor"
        }
    ]
},
"lastModifiedDate": "2020-04-07T14:43:00Z",
"lastPurchasePrice": 3.27,
"location": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/location/1"
        }
    ],
    "id": "1",
    "refName": "Warehouse"
},
"locations": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/locations"
        }
    ]
},
"manufacturer": "Salon System",
"matchBillToReceipt": false,
"mpn": "0202123",
"nextagproductfeed": false,
"offerSupport": false,
"preferredLocation": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/location/1"
        }
    ],
    "id": "1",
    "refName": "Warehouse"
},
"price": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/price"
        }
    ]
},
"productfeed": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/productfeed"
        }
    ]
},
"seasonalDemand": false,
"shipIndividually": false,
"shoppingproductfeed": false,
"shopzillaproductfeed": false,
"showdefaultdonationamount": false,
"sitecategory": {
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/sitecategory"
        }
    ]
},
"supplyReplenishmentMethod": "REORDER_POINT",
"taxSchedule": {
    "links": [],
    "id": "2",
    "refName": "Standard Rate"
},
"totalValue": 156.96,
"trackLandedCost": true,
"upcCode": "5011522007489",
"useMarginalRates": false,
"weight": 500.0,
"weightUnit": "4",
"yahooproductfeed": false
}

问题是我无法在任何领域看到手头的数量。 我可以在浏览器上的 netsuite 应用上看到该商品的手头数量。

主要目标是更新此商品的现有数量。

我也尝试过类似的地点

{{REST_SERVICES}}/record/v1/inventoryItem/610/locations/1

结果是

{
    "links": [
        {
            "rel": "self",
            "href": "https://3961971-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryitem/610/locations/1"
        }
    ],
    "location": {
        "links": [],
        "id": "1.0",
        "refName": "1"
    },
    "locationId": 1,
    "preferredStockLevel": 0.0,
    "reorderPoint": 6.0
}

虽然这是我可以在 Web 上看到数量的位置,但它不显示数量。

这是我在网上看到的结果

【问题讨论】:

  • 您需要使用事务来更改数量。此类交易之一是库存调整,但还有其他交易可以更改库存以及收到的库存转移。
  • 谢谢。有没有办法从邮递员那里做到?
  • 是的,您可以使用套件谈话 REST 调用 (POST /inventoryAdjustment) 创建库存调整。
  • 非常感谢。我去看看。
  • 你为什么用oracle标记它?

标签: postman netsuite rest


【解决方案1】:

正如 Brian 建议的那样,我使用库存调整交易来更改库存项目数量。

{{REST_SERVICES}}/record/v1/inventoryAdjustment

我使用上面的 POST 请求来添加带有以下正文的库存调整。

{
"account": {
    "id": 1325
},
"inventory": {
    "items": [
        {
            "item": {
                "id": {{lastItem}}
            },
            "location": {
                "id": 1
            },
            "adjustQtyBy": 1.0
        }
    ]
}

}

注意:

  • Account 是我创建的费用科目命名的科目表 库存调整。
  • ItemId 包含我们需要更改的库存商品 ID。
  • 位置是我们指定的需要数量的位置 改变
  • Adjust by quantity 是我们需要更改的值 数量。

【讨论】:

    【解决方案2】:

    Adeel 的回答帮助我走得很远,但我仍然遇到问题。我通过在 NS 中手动输入调整然后使用内部 id 调用 GET 请求来解决这个问题。

    {{REST_SERVICES}}/record/v1/inventoryAdjustment/{ID}
    

    在那之后我提出了这个请求,它完成了我需要的一切。

    {{REST_SERVICES}}/record/v1/inventoryAdjustment
    
    {
        "account": {
            "id": "293"
        },
        "subsidiary": {
            "id": "1"
        },
        "inventory": {
            "items": [
                {   
                    "unitCost": 3,
                    "item": {
                        "id": {{lastItem}}
                    },
                    "location": {
                        "id": 1
                    },
                    "adjustQtyBy": 2.0
                }
            ]
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-03
      • 2018-05-10
      • 1970-01-01
      • 2017-04-06
      • 2015-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多