メインコンテンツへスキップ
PUT
/
crm-objects
/
v1
/
objects
/
line_items
/
{id}
Update a line item
curl --request PUT \
  --url https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}
import requests

url = "https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}"

response = requests.put(url)

print(response.text)
const options = {method: 'PUT'};

fetch('https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}"

	req, _ := http.NewRequest("PUT", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.hubapi.com/crm-objects/v1/objects/line_items/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
[
  {
    "name": "description",
    "value": "An updated description for this line item. Updating the quantity."
  },
  {
    "name": "quantity",
    "value": "5"
  },
  {
    "versions": [
      {
        "name": "amount",
        "value": "137.50",
        "timestamp": 0,
        "sourceId": "LineItemAmountCalculator",
        "source": "CALCULATED",
        "sourceVid": []
      }
    ],
    "value": "137.50",
    "timestamp": 0,
    "source": "CALCULATED",
    "sourceId": "LineItemAmountCalculator"
  },
  {
    "versions": [
      {
        "name": "quantity",
        "value": "5",
        "timestamp": 1525371765869,
        "source": "API",
        "sourceVid": []
      }
    ],
    "value": "5",
    "timestamp": 1525371765869,
    "source": "API",
    "sourceId": null
  },
  {
    "versions": [
      {
        "name": "hs_lastmodifieddate",
        "value": "0",
        "timestamp": 0,
        "source": "CALCULATED",
        "sourceVid": []
      }
    ],
    "value": "0",
    "timestamp": 0,
    "source": "CALCULATED",
    "sourceId": null
  },
  {
    "versions": [
      {
        "name": "price",
        "value": "27.50",
        "timestamp": 1525359863627,
        "source": "API",
        "sourceVid": []
      }
    ],
    "value": "27.50",
    "timestamp": 1525359863627,
    "source": "API",
    "sourceId": null
  },
  {
    "versions": [
      {
        "name": "description",
        "value": "An updated description for this line item. Updating the quantity.",
        "timestamp": 1525371765869,
        "source": "API",
        "sourceVid": []
      },
      {
        "name": "description",
        "value": "A description of this product.",
        "timestamp": 1525359863627,
        "source": "API",
        "sourceVid": []
      }
    ],
    "value": "An updated description for this line item. Updating the quantity.",
    "timestamp": 1525371765869,
    "source": "API",
    "sourceId": null
  },
  {
    "versions": [
      {
        "name": "hs_product_id",
        "value": "1688960",
        "timestamp": 1525371444427,
        "source": "API",
        "sourceVid": []
      }
    ],
    "value": "1688960",
    "timestamp": 1525371444427,
    "source": "API",
    "sourceId": null
  }
]

レスポンス

200 - application/json

Successful response - Get a list of changes to line item objects

The response is of type object.

最終更新日 2026年4月10日