Unicode C++ / Commercetools / ChangeTaxCategory
        
        Back to Collection Items
        
void ChilkatSample(void)
    {
    json.UpdateString(L"version",L"{{version}}");    json.UpdateString(L"actions[0].action",L"changeTaxCategory");    json.UpdateString(L"actions[0].taxCategory.id",L"{{tax-category-id}}");    json.UpdateString(L"actions[0].taxCategory.typeId",L"tax-category");    http.put_AuthToken(L"<access_token>");    json.EmitSb(sbRequestBody);    success = http.HttpSb(L"post",L"https://domain.com/{{project-key}}/shipping-methods/{{shipping-method-id}}",sbRequestBody,L"utf-8",L"application/json",resp);
    }
        Curl Command
        curl -X post
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-d '{
    "version": {{shipping-method-version}},
    "actions": [
        {
            "action" : "changeTaxCategory",
            "taxCategory" : {
              "id" : "{{tax-category-id}}",
              "typeId" : "tax-category"
            }
          }
    ]
}'
https://domain.com/{{project-key}}/shipping-methods/{{shipping-method-id}}
        Postman Collection Item JSON
        {
  "name": "ChangeTaxCategory",
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "tests[\"Status code \" + responseCode.code] = responseCode.code === 200 || responseCode.code === 201;",
          "var data = JSON.parse(responseBody);",
          "if(data.results && data.results[0] && data.results[0].id && data.results[0].version){",
          "    pm.environment.set(\"shipping-method-id\", data.results[0].id); ",
          "    pm.environment.set(\"shipping-method-version\", data.results[0].version);",
          "}",
          "if(data.results && data.results[0] && data.results[0].key){",
          "    pm.environment.set(\"shipping-method-key\", data.results[0].key); ",
          "}",
          "if(data.version){",
          "    pm.environment.set(\"shipping-method-version\", data.version);",
          "}",
          "if(data.id){",
          "    pm.environment.set(\"shipping-method-id\", data.id); ",
          "}",
          "if(data.key){",
          "    pm.environment.set(\"shipping-method-key\", data.key);",
          "}",
          ""
        ]
      }
    }
  ],
  "request": {
    "auth": {
      "type": "oauth2",
      "oauth2": {
        "accessToken": "{{ctp_access_token}}",
        "addTokenTo": "header",
        "tokenType": "Bearer"
      }
    },
    "method": "post",
    "body": {
      "mode": "raw",
      "raw": "{\n    \"version\": {{shipping-method-version}},\n    \"actions\": [\n        {\n            \"action\" : \"changeTaxCategory\",\n            \"taxCategory\" : {\n              \"id\" : \"{{tax-category-id}}\",\n              \"typeId\" : \"tax-category\"\n            }\n          }\n    ]\n}"
    },
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{host}}/{{project-key}}/shipping-methods/{{shipping-method-id}}",
      "host": [
        "{{host}}"
      ],
      "path": [
        "{{project-key}}",
        "shipping-methods",
        "{{shipping-method-id}}"
      ],
      "query": [
        {
          "key": "expand",
          "value": "",
          "equals": true,
          "disabled": true
        }
      ]
    },
    "description": "post ShippingMethods"
  },
  "response": [
  ]
}