# Update proposal

Use the **updateProposal** method via JSON-RPC API 6.0 to update the details of a proposal or quote.

## Request parameters

<table><thead><tr><th width="126.5333251953125">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>proposalId</code></td><td><p><strong>Required (string)</strong></p><p>The unique merchant proposal ID generated by the 2Checkout system.</p></td></tr><tr><td><code>sessionId</code></td><td><p><strong>Required (string)</strong></p><p>Unique 2Checkout session ID code.</p></td></tr><tr><td><code>Name</code></td><td><p><strong>Optional (string)</strong></p><p>Proposal name.</p></td></tr><tr><td><code>UserId</code></td><td><p><strong>Optional (string)</strong></p><p>The unique user ID generated by the 2Checkout system.</p></td></tr><tr><td><a href="/pages/zGoQB6vtnyNTNd3gM09q#billto-object"><code>BillTo</code></a></td><td><p><strong>Optional (object)</strong></p><p>The billing details associated with the proposal.</p></td></tr><tr><td><a href="/pages/zGoQB6vtnyNTNd3gM09q#sellto-object"><code>SellTo</code></a></td><td><p><strong>Optional (object)</strong></p><p>Represents the entity using the service. Used for tax calculation.</p></td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$proposalID = "0573e71d-38bb-4d61-88ca-b3c557517c68";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getProposalById';
$jsonRpcRequest->params = array($sessionID, $proposalID);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}

$result->Name = "Updated proposal name";
$result->UserId = "myuser";
$result->BillTo->FirstName = "Billing Contact first name";
$result->BillTo->LastName = "Billing Contact last name";
$result->BillTo->Email = "contact@email.com";
$result->BillTo->Country = "US";
$result->BillTo->State = "California";
$result->BillTo->City = "San Francisco";
$result->BillTo->Address = "Street name No. 9 San Francisco, California";
$result->SellTo->FirstName = "Contact first name";
$result->SellTo->LastName = "Contact last name";
$result->SellTo->Email = "contact@email.com";
$result->SellTo->Country = "US";
$result->SellTo->State = "California";
$result->SellTo->vatCode = "85421564";
$result->SellTo->City = "San Francisco";
$result->SellTo->Address = "Street name No. 5 San Francisco, California";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'updateProposal';
$jsonRpcRequest->params = array($sessionID, $result);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
    echo "Proposal: </br>",
    var_dump($result);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}
```

### Request sample with prorationDate

```php
<?php

require ('PATH_TO_AUTH');

$proposalID = "0573e71d-38bb-4d61-88ca-b3c557517c68";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getProposalById';
$jsonRpcRequest->params = array($sessionID, $proposalID);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}
$result->Content->LineItems[0]->ProrationDate = "2020-11-14T15:28:56+00:00";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'updateProposal';
$jsonRpcRequest->params = array($sessionID, $result);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
    echo "Proposal: </br>",
    var_dump($result);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}
```

### Request sample with vatCode

```php
<?php

require ('PATH_TO_AUTH');

$proposalID = "0573e71d-38bb-4d61-88ca-b3c557517c68";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getProposalById';
$jsonRpcRequest->params = array($sessionID, $proposalID);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}

$result->Name = "Updated proposal name";
$result->UserId = "myuser";
$result->BillTo->FirstName = "Billing Contact first name";
$result->BillTo->LastName = "Billing Contact last name";
$result->BillTo->Email = "contact@email.com";
$result->BillTo->Country = "US";
$result->BillTo->State = "California";
$result->BillTo->City = "San Francisco";
$result->BillTo->Address = "Street name No. 9 San Francisco, California";
$result->SellTo->FirstName = "Contact first name";
$result->SellTo->LastName = "Contact last name";
$result->SellTo->Email = "contact@email.com";
$result->SellTo->Country = "US";
$result->SellTo->State = "California";
$result->SellTo->vatCode = "85421564";
$result->SellTo->City = "San Francisco";
$result->SellTo->Address = "Street name No. 5 San Francisco, California";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'updateProposal';
$jsonRpcRequest->params = array($sessionID, $result);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
    echo "Proposal: </br>",
    var_dump($result);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}
```

### Request sample with TaxExemptionId

```php
<?php

require ('PATH_TO_AUTH');

$proposalID = "0573e71d-38bb-4d61-88ca-b3c557517c68";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getProposalById';
$jsonRpcRequest->params = array($sessionID, $proposalID);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}

$result->Name = "Updated proposal name";
$result->UserId = "myuser";
$result->BillTo->FirstName = "Billing Contact first name";
$result->BillTo->LastName = "Billing Contact last name";
$result->BillTo->Email = "contact@email.com";
$result->BillTo->Country = "US";
$result->BillTo->State = "California";
$result->BillTo->City = "San Francisco";
$result->BillTo->Address = "Street name No. 9 San Francisco, California";
$result->SellTo->FirstName = "Contact first name";
$result->SellTo->LastName = "Contact last name";
$result->SellTo->Email = "contact@email.com";
$result->SellTo->Country = "US";
$result->SellTo->State = "California";
$result->SellTo->TaxExemptionId = "85421564";
$result->SellTo->City = "San Francisco";
$result->SellTo->Address = "Street name No. 5 San Francisco, California";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'updateProposal';
$jsonRpcRequest->params = array($sessionID, $result);
$jsonRpcRequest->id = $i++;

try {
    $result = callRPC($jsonRpcRequest, $host);
    echo "Proposal: </br>",
    var_dump($result);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}
```

## Response

The **updateProposal** call via JSON-RPC API 6.0 returns the [Proposal](/json-rpc-api-reference/json-rpc-api-6.0/api-requests/proposal-microservice.md) object.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/proposal-microservice/update-proposal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
