Skip to main content

Retrieve additional field

Overview

Use the getSubscriptionAdditionalInformationField method to retrieve information related to an additional information field belonging to a subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

Response

Parameters Type/Description
AdditionalSubscriptionInformation Object

 

Contains information related to the additional information field.

fieldName

String

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue

String

 

The value of the additional information field.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = 'F27CFE06ED';
$fieldName = 'subscription';

try {
    $subscriptionInfo = $client->getSubscriptionAdditionalInformationField($sessionID, $subscriptionReference, $fieldName);
}
catch (SoapFault $e) {
    echo "subscriptionInfo: " . $e->getMessage();
    exit;
}
var_dump("subscriptionInfo", $subscriptionInfo);

 

Delete an additional field

Overview

Use the deleteSubscriptionAdditionalInformationField method to delete the additional information field from a subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

Response

Parameters Type/Description
Boolean Object

 

true or false depending on whether the additional information field was successfully deleted or not.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = 'F27CFE06ED';
$fieldName = 'subscription';

try {
    $subscriptionInfo = $client->deleteSubscriptionAdditionalInformationField($sessionID, $subscriptionReference, $fieldName);
}
catch (SoapFault $e) {
    echo "subscriptionInfo: " . $e->getMessage();
    exit;
}
var_dump("subscriptionInfo", $subscriptionInfo);

 

Retrieve the additional information field for a subscription

Overview

Use the getSubscriptionAdditionalInformationField method to retrieve information related to an additional information field belonging to a subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

Response

Parameters Type/Description
AdditionalSubscriptionInformation Object

 

It contains information related to the additional information field.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = 'F27CFE06ED';
$fieldName = 'subscription';

try {
    $subscriptionInfo = $client->getSubscriptionAdditionalInformationField($sessionID, $subscriptionReference, $fieldName);
}
catch (SoapFault $e) {
    echo "subscriptionInfo: " . $e->getMessage();
    exit;
}
var_dump("subscriptionInfo", $subscriptionInfo);


 

Use free orders

Overview

Place an order with dynamic order information without requiring any payment information from the customers.

Requirements

The final order price has to be 0. Either use products with zero price, or add a promotion for 100% of the total order price. Recurring options should not be sent. Set the PaymentDetails type to FREE.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Order

Required (Object)

 

Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

Response

Parameters Type/Description

Order

Object

 

Object containing order information.

Request

<?php

require ('PATH_TO_AUTH');

$Order = new stdClass();
$Order->Currency = "USD";
$Order->Language = "EN";
$Order->Country = "US";
$Order->CustomerIP = '91.220.121.21';//"10.10.13.37";
$Order->Source = "sourceAPI.net";
$Order->LocalTime = date('Y-m-d H:i:s');
$Order->CustomerReference = 421820775;
$Order->Items = array();

/**
 * 1st Product
 */
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = null;
$Order->Items[0]->Quantity = 2;
$Order->Items[0]->PurchaseType = 'PRODUCT';
$Order->Items[0]->Tangible = false; // physical
$Order->Items[0]->IsDynamic = true;
$Order->Items[0]->Price = new stdClass();
$Order->Items[0]->Price->Amount = 0; // should be 0
$Order->Items[0]->Price->Type = 'CUSTOM';
$Order->Items[0]->Name = 'Dynamic Product 1 '. date("Y-m-d H:i:s");
$Order->Items[0]->Description = 'Description Produs OTF';

$Order->Items[0]->PriceOptions = [];
$priceOption = new stdClass();
$priceOption->Name = 'Name';
$priceOption->Value = 'Value';
$priceOption->Surcharge = 0;
$Order->Items[0]->PriceOptions[] = $priceOption;

$priceOption1 = new stdClass();
$priceOption1->Name = 'Name';
$priceOption1->Value = 'Value123';
$priceOption1->Surcharge = 0;
$Order->Items[0]->PriceOptions[] = $priceOption1;

$priceOption2 = new stdClass();
$priceOption2->Name = 'Name1';
$priceOption2->Value = 'Value1';
$priceOption2->Surcharge = 0;
$Order->Items[0]->PriceOptions[] = $priceOption2;



/*
 * 3rd Product - SHIPPING
 */

$Order->Items[2] = new stdClass();
$Order->Items[2]->Name = 'Shipping Item '. date("Y-m-d H:i:s");
$Order->Items[2]->PurchaseType = 'SHIPPING';
$Order->Items[2]->Quantity = 1;
$Order->Items[2]->Price = new stdClass();
$Order->Items[2]->Price->Amount = 0; // should be 0
$Order->Items[2]->IsDynamic = true;

/**
 * 4th Product - TAX
 */
$Order->Items[3] = new stdClass();
$Order->Items[3]->Name = 'Tax Item '. date("Y-m-d H:i:s");
$Order->Items[3]->PurchaseType = 'TAX';
$Order->Items[3]->Quantity = 1;
$Order->Items[3]->Price = new stdClass();
$Order->Items[3]->Price->Amount = 0; // should be 0
$Order->Items[3]->IsDynamic = true;


/**
 * 5th Product - COUPON
 */
$Order->Items[4] = new stdClass();
$Order->Items[4]->Name = 'Coupon Item '. date("Y-m-d H:i:s");
$Order->Items[4]->PurchaseType = 'COUPON';
$Order->Items[4]->Quantity = 0;
$Order->Items[4]->Price = new stdClass();
$Order->Items[4]->Price->Amount = 0; // should be 0, or the amount should be the opposite to the one send in the order
$Order->Items[4]->IsDynamic = true;

/**/

$additionalField1 = new stdClass();
$additionalField1->Code = "additional_field_order_1";
$additionalField1->Text = "REST";
$additionalField1->Value = "1";

$Order->AdditionalFields = array();

$additionalField1 = new stdClass();
$additionalField1->Code = "REST";
$additionalField1->Text = "REST";
$additionalField1->Value = "REST";

$Order->MachineId = 'machineIdTestDan';
$Order->Discount = null;
$Order->ExternalReference = null;

$Order->BillingDetails = new stdClass();
$Order->BillingDetails->Address1 = 'John';
$Order->BillingDetails->Address2 = 'Doe';
$Order->BillingDetails->City = 'New York City';
$Order->BillingDetails->State = 'New York';
$Order->BillingDetails->CountryCode = 'US';
$Order->BillingDetails->Phone = 12345;
$Order->BillingDetails->Email = 'shopper@2checkout.com';
$Order->BillingDetails->FirstName = 'John';
$Order->BillingDetails->LastName = 'Doe';
$Order->BillingDetails->Company = 'ABC Company';
$Order->BillingDetails->Zip = '12345';
$Order->BillingDetails->FiscalCode = 13205628845;

/**/
$Order->DeliveryDetails = new stdClass();
$Order->DeliveryDetails->Address1 = 'Delivery details 1';
$Order->DeliveryDetails->Address2 = 'Delivery detais 2';
$Order->DeliveryDetails->City = 'New York City';
$Order->DeliveryDetails->State = 'New York';
$Order->DeliveryDetails->CountryCode = 'US';
$Order->DeliveryDetails->Phone = '12345';
$Order->DeliveryDetails->Email = 'customer@email.com';
$Order->DeliveryDetails->FirstName = 'John';
$Order->DeliveryDetails->LastName = 'Doe';
$Order->DeliveryDetails->Zip = 12345;
/**/

$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'FREE';
$Order->PaymentDetails->Currency = 'usd';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = false;


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

$order = callRPC($jsonRpcRequest, $host);
var_dump($order);
 

Assign additional field

Overview

Use the addSubscriptionAdditionalInformationField method to assign an additional information field to a subscription.

Requirements

The maximum number of additional information fields that can be added on a subscription is 5, while the maximum field length is 100 characters.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue

Required (string)

 

The value of the additional information field.

Response

Parameters Type/Description
AdditionalSubscriptionInformation Object

 

Contains information related to the additional information field.

fieldName

String

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue

String

 

The value of the additional information field.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = '351D4F557E';
$fieldName = 'subscription';
$fieldValue = 'test';

$jsonRpcRequest = array (
'method' => 'addSubscriptionAdditionalInformationField',
'params' => array($sessionID, $subscriptionReference, $fieldName, $fieldValue),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Delete the additional information field from a subscription

Overview

Use the deleteSubscriptionAdditionalInformationField method to delete the additional information field from a subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

Response

Parameters Type/Description
Boolean Object

 

true or false depending on whether the additional information field was successfully deleted or not.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = 'F27CFE06ED';
$fieldName = 'subscription';

try {
    $subscriptionInfo = $client->deleteSubscriptionAdditionalInformationField($sessionID, $subscriptionReference, $fieldName);
}
catch (SoapFault $e) {
    echo "subscriptionInfo: " . $e->getMessage();
    exit;
}
var_dump("subscriptionInfo", $subscriptionInfo);

 

Use free orders

Overview

Place an order with catalog products without requiring any payment information from your customers (free orders).

Requirements

The final order price has to be 0. Either use products with 0 price or add a promotion for 100% of the total order price. It's mandatory to set RecurringEnabled to false.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Order

Required (Object)

 

Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

 

Response 

Parameters Type/Description

Order information

Object

Request

<?php

require ('PATH_TO_AUTH');

$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'usd';
$Order->Country = 'US';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->AffiliateId = NULL;
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1'; // product needs to have 0 price
$Order->Items[0]->Quantity = 1;

$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'John';
$Order->BillingDetails->LastName = 'Doe';
$Order->BillingDetails->CountryCode = 'us';
$Order->BillingDetails->State = 'California';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '90210';
$Order->BillingDetails->Email = 'john.doe@2checkout.com';
$Order->BillingDetails->Phone = NULL;
$Order->BillingDetails->Company = NULL;

$Order->DeliveryDetails = NULL;

$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'FREE';
$Order->PaymentDetails->Currency = 'usd';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = false;

try {
    $newOrder = $client->placeOrder($sessionID, $Order);
}
catch (SoapFault $e) {
    echo "newOrder: " . $e->getMessage();
    exit;
}

var_dump("newOrder", $newOrder);

 

Update a subscription's additional information field

Overview

Use the updateSubscriptionAdditionalInformationField method to update the additional information field from to a subscription.

Requirements 

The maximum field length is 100 characters.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue Optional (string)
  The value you assign to the additional information field/

Response

Parameters Type/Description
AdditionalSubscriptionInformation Object

 

Contains information related to the additional information field.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = '351D8F557E';
$fieldName = 'subscription';
$fieldValue = 'test2';

$jsonRpcRequest = array (
'method' => 'updateSubscriptionAdditionalInformationField',
'params' => array($sessionID, $subscriptionReference, $fieldName, $fieldValue),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Assign an additional information field to a subscription

Overview

Use the addSubscriptionAdditionalInformationField method to assign an additional information field to a subscription.

Requirements

The maximum number of additional information fields that can be added on a subscription is 5, while the maximum field length is 100 characters.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue

Required (string)

 

The value of the additional information field.

Response

Parameters Type/Description
AdditionalSubscriptionInformation Object

 

Contains information related to the additional information field.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = 'F27CFE06ED';
$fieldName = 'subscription';
$fieldValue = 'test';
try {
    $subscriptionInfo = $client->addSubscriptionAdditionalInformationField($sessionID, $subscriptionReference, $fieldName, $fieldValue);
}
catch (SoapFault $e) {
    echo "subscriptionInfo: " . $e->getMessage();
    exit;
}
var_dump("subscriptionInfo", $subscriptionInfo);


 

Update an additional field

Overview

Use the updateSubscriptionAdditionalInformationField method to update the additional information field from a subscription.

Requirements 

The maximum field length is 100 characters.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference Required (string)
  Unique, system-generated subscription identifier.

fieldName

Required (string)

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue Optional (string)
  The value you assign to the additional information field/

Response

Parameters Type/Description
AdditionalSubscriptionInformation Object

 

Contains information related to the additional information field.

fieldName

String

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue

String

 

The value of the additional information field.

Request

<?php

require('PATH_TO_AUTH');

$subscriptionReference = 'F27CFE06ED';
$fieldName = 'subscription';
$fieldValue = 'test';

try {
    $subscriptionInfo = $client->updateSubscriptionAdditionalInformationField($sessionID, $subscriptionReference, $fieldName, $fieldValue);
}
catch (SoapFault $e) {
    echo "subscriptionInfo: " . $e->getMessage();
    exit;
}
var_dump("subscriptionInfo", $subscriptionInfo);

 

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo