Perform action
Overview
Use the performAction method via SOAP 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";
try {
$results = $soapClient->performAction($sessionID, $proposalId , $actionPayload);
echo "Performing action: </br>",
var_dump($results);
}
catch (SoapFault $e) {
echo "Could not perform action: " . $e->getMessage();
exit;
}
Response
The performAction call via SOAP APIv6 returns the Proposal object.