Perform action
          Last updated: 08-Jul-2020
        
        
    Rate this article:
    
    
  
        Overview
Use the performAction method via JSON-RPC APIv6 to execute an action on the proposal.
Request parameters
| Action | Parameters | Type | Required/Optional | Description | 
|---|---|---|---|---|
| sessionId | String | Required | Unique 2Checkout session ID code. | |
| 
 
 
 
 
 
 
 
 SEND | proposalId | String | Required | The unique merchant proposal ID generated by the 2Checkout system. | 
| exirationDate | Date | Required | The date at which the proposal expires; date-time ISO 8601 format | |
| userId | String | Optional | The unique user ID generated by the 2Checkout system. | |
| action | String | Required | The action to be executed on the proposal. | |
| statusComment | String | Optional | Free text comments that can accompany a status. | |
| sentBy | String | Required | Represents the account manager of the merchant. | |
| FirstName | String | Required | The first name of the email sender. | |
| LastName | String | Required | The last name of the email sender. | |
|  | String | Required | The email address of the email sender. | |
| 
 ACCEPT | action | String | Required | The action to be executed on the proposal. | 
| statusComment | String | Optional | Free text comments that can accompany a status. | |
| 
 
 CLOSE | action | String | Required | The action to be executed on the proposal. | 
| statusComment | String | Optional | Free text comments that can accompany a status. | |
| userId | String | Optional | The unique user ID generated by the 2Checkout system. | |
| 
 
 DISCARD | action | String | Required | The action to be executed on the proposal. | 
| statusComment | String | Optional | Free text comments that can accompany a status. | |
| userId | String | Optional | The unique user ID generated by the 2Checkout system. | |
| 
 
 REOPEN | action | String | Required | The action to be executed on the proposal. | 
| statusComment | String | Optional | Free text comments that can accompany a status. | |
| userId | String | Optional | The unique user ID generated by the 2Checkout system. | |
| 
 DECLINE | action | String | Required | The action to be executed on the proposal. | 
| statusComment | String | Optional | Free text comments that can accompany a status. | 
Request sample
<?php
require ('PATH_TO_AUTH');
$proposalId = "0573e71d-38bb-4d61-88ca-b3c557517c68";
$actionPayload = new stdClass();
$actionPayload->ExpirationDate = "2021-01-05T17:21:42+00:00";
$actionPayload->UserId = "john.doe@email.com";
$actionPayload->action = "decline";
$actionPayload->StatusComment = "The price is too high for the first product";
$actionPayload->SentBy = new stdClass();
$actionPayload->SentBy->FirstName = "John";
$actionPayload->SentBy->LastName = "Doe";
$actionPayload->SentBy->Email = "john.doe@email.com";
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'performAction';
$jsonRpcRequest->params = array($sessionID, $actionPayload);
$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 performAction call via JSON-RPC APIv6 returns the Proposal object.
Related articles
    Rate this article: