Skip to main content

Subscription renewal

Overview

Use this section to handle the renewal of your subscriptions.

You can retrieve information regarding the renewal status of a subscription, including the manual renewal link that a customer needs to access in order to renew.

Enable or disable the recurring billing for a subscription using the API methods displayed below.

 

Brazil - the next great eCommerce opportunity

With a population of 202M and the 6th largest world economy, Brazil accounts for 59% of Latin American eCommerce revenues. World-class technology combined with a market size bigger than UK, Italy, Russia, or India makes Brazil the next great eCommerce opportunity. Ralf Germer, the CEO, of 4M Iberoamérica, shares his insights into Latin America's eCommerce presence - examining market trends, online revenue growth predictions, and key indicators of Brazil's growing market strength. 

Watch our webinar to find out how to accelerate your online sales by expanding into Brazil's eCommerce market. We'll highlight why Brazil may be the next market you'll want to enter, examine some of the challenges companies face when entering this unique market, and highlight how 2Checkout can help you ramp up fast.

Watch this webinar and discover:

  • Why Brazil is called the "King of Latin American eCommerce" and why that's perfect for your online business
  • 4 Steps to ramp up online sales in Brazil quickly
  • Challenges expanding into Brazil and how 2Checkout can help
Join Our Webinar

 

Place an order with installments

Overview 

Use the placeOrder method to create an order and collect the payment.

Supported payment methods 

Credit/Debit cards: Visa and MasterCard local Brazilian cards.

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.

Order

Required (Object)

 

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

Requirements

  1. Payment methods: Visa, MasterCard or AMEX
  2. Country: Brazil
  3. Currency BRL
  4. Specified number of installments under the PaymentMethod object. (Minimum installment threshold is 5 BRL.)
    • Phone number
    • Fiscal code (CPF/CNPJ)
  5. Mandatory billing information must include:

  6. Transaction: non-recurring
  7. Installments are available only for:
    • Brazilian customers
    • Local Visa, MasterCard and AMEX cards
    • Non-recurring transactions

<?php
function callRPC($Request, $hostUrl, $Debug = true) {
    $curl = curl_init($hostUrl);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($curl, CURLOPT_SSLVERSION, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
    $RequestString = json_encode($Request);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $RequestString);
 
 
    if ($Debug) {
        $RequestString;
    }
    $ResponseString = curl_exec($curl);
    if ($Debug) {
        $ResponseString;
    }
 
    if (!empty($ResponseString)) {
        $Response = json_decode($ResponseString);
        if (isset($Response->result)) {
            return $Response->result;
        }
        if (!is_null($Response->error)) {
            var_dump($Request->method, $Response->error);
        }
    } else {
        return null;
    }
}
 
 
$host = 'https://api.avangate.com/rpc/3.0/';
 
$merchantCode = "MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key = "SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$string = strlen($merchantCode) . $merchantCode . strlen(gmdate('Y-m-d H:i:s')) . gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
 
$i = 1; // counter for api calls
// call login
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, gmdate('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
 
$sessionID = callRPC($jsonRpcRequest, $host);
 
$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'brl';
$Order->Country = 'BR';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1; 
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false; 
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->Promotion = NULL;
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'FirstName';
$Order->BillingDetails->LastName = 'LastName';
$Order->BillingDetails->CountryCode = 'BR';
$Order->BillingDetails->State = 'DF';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '70403-900';
$Order->BillingDetails->Email = 'customer@email.com';
$Order->BillingDetails->Phone = "556133127400";
$Order->BillingDetails->FiscalCode = "056.027.963-98";
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;
$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'CC';
$Order->PaymentDetails->Currency = 'brl';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$Order->PaymentDetails->PaymentMethod->CardNumber = "4111111111111111";
$Order->PaymentDetails->PaymentMethod->CardType = 'visa';
$Order->PaymentDetails->PaymentMethod->ExpirationYear = '2019';
$Order->PaymentDetails->PaymentMethod->ExpirationMonth = '12';
$Order->PaymentDetails->PaymentMethod->HolderName = 'John';
$Order->PaymentDetails->PaymentMethod->CCID = '123';
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;

$jsonRpcRequest = array (
'method' => 'getInstallments',
'params' => array($sessionID, $Order),
'id' => $i++,
'jsonrpc' => '2.0'
);
echo '<BR>';
echo 'The content of the current session:';
echo '<BR>';
$installments = callRPC((Object)$jsonRpcRequest, $host, true);
var_dump ($installments);
$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'brl';
$Order->Country = 'BR';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1; 
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false; 
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->Promotion = NULL;
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'FirstName';
$Order->BillingDetails->LastName = 'LastName';
$Order->BillingDetails->CountryCode = 'BR';
$Order->BillingDetails->State = 'DF';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '70403-900';
$Order->BillingDetails->Email = 'customer@email.com';
$Order->BillingDetails->Phone = "556133127400";
$Order->BillingDetails->FiscalCode = "056.027.963-98";
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;
$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'CC';
$Order->PaymentDetails->Currency = 'brl';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$Order->PaymentDetails->PaymentMethod->CardNumber = "4111111111111111";
$Order->PaymentDetails->PaymentMethod->InstallmentsNumber = 2;
$Order->PaymentDetails->PaymentMethod->CardType = 'visa';
$Order->PaymentDetails->PaymentMethod->ExpirationYear = '2019';
$Order->PaymentDetails->PaymentMethod->ExpirationMonth = '12';
$Order->PaymentDetails->PaymentMethod->HolderName = 'John';
$Order->PaymentDetails->PaymentMethod->CCID = '123';
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;

$jsonRpcRequest = array (
'method' => 'placeOrder',
'params' => array($sessionID, $Order),
'id' => $i++,
'jsonrpc' => '2.0'
);
echo '<BR>';
echo 'The content of the current session:';
echo '<BR>';
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Use WeChat Pay

Overview

Place an order for catalog products defined in your Control Panel and collect the payment using WeChat Pay.

Requirements

Only Chinese shoppers are able to purchase using WeChat Pay. Make sure the billing country code is set to CN.

Supported currencies

  • USD
  • HKD
  • CNY

Workflow

  1. Shoppers select WeChat as payment option in the interface you provide to them.
  2. Create the order object. Use WE_CHAT_PAY as the type of the PaymentDetails object, and include ReturnURL and CancelURL.
  3. Use the placeOrder method to send the data to Avangate.
  4. Once you place the order, Avangate logs it into the system. At this point in time, the status of the order is PENDING.
  5. Avangate returns an Order object as the output of the placeOrder method. 
  6. Use the PaymentMethod object to create a redirect URL for the shoppers, concatenating the values of the Href and avng8apitoken parameters. Here's an example of the redirect URL:
    https://api.avangate.com/4.0/scripts/we_chat_pay/authorize/?avng8apitoken=1abc7fd72d008428
  7. After being redirected to WeChat Pay, shoppers need to scan the QR code provided, using the WeChat smartphone app.
  8. After customers enter their payment password, WeChat notifies Avangate if the payment is approved, and the status of the order becomes COMPLETE.
  9. Shoppers are redirected to the RedirectURL from the Order information object. In case the payment fails, shoppers are redirected to the CancelURL. 

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.

Order

Required (Object)

 

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

To place an order with WeChat, use WE_CHAT_PAY as the type of the PaymentDetails object and provide a ReturnURL and a CancelURL as part of the PaymentMethod object. See code sample. 

Response

Parameters Type/Description
Order Object
  Object containing order information.

Request

<?php

require ('PATH_TO_AUTH');

$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'usd';
$Order->Country = 'CN';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1;
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false;
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->SubscriptionStartDate = NULL; //If empty or null, subscriptions become active when purchase is made.
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'Test Cosmin API';
$Order->BillingDetails->LastName = 'Cosmin API';
$Order->BillingDetails->CountryCode = 'CN';
$Order->BillingDetails->State = 'California';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '90210';
$Order->BillingDetails->Email = 'cosmin.deftu@avangate.com';
$Order->BillingDetails->Phone = NULL;
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;

$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'WE_CHAT_PAY';
$Order->PaymentDetails->Currency = 'USD';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '91.220.121.21';
$Order->PaymentDetails->PaymentMethod->ReturnURL = 'http://yourreturnurl.com';
$Order->PaymentDetails->PaymentMethod->CancelURL= 'http://yourcancelurl.com';

$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;

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

$output = callRPC($jsonRpcRequest, $host);

$wechatredirect = $output->PaymentDetails->PaymentMethod->Authorize->Href."/?avng8apitoken=".$output->PaymentDetails->PaymentMethod->Authorize->Params->avng8apitoken;

header('Location:' . $wechatredirect);

Subscription history

Overview

Retrieve information about a subscription's history. Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.

Use the API methods displayed below to extend or renew a subscription.

 

Use SOFORT

Overview

SOFORT is a payment method used primarily in Germany, Austria, Belgium, Switzerland, and The Netherlands. SOFORT supports a direct credit transfer system designed to allow the immediate delivery of goods and services through instant notification and confirmation support.

Currencies

SOFORT supports transactions in EUR and CHF.

Workflow

  1. Shoppers select SOFORT as a payment option in the checkout interface you provide to them.
  2. Create the order object. Use “DIRECT_EBANKING” as the type of the PaymentDetails object.
  3. Use the placeOrder method to send the data to 2Checkout.
  4. Use the PaymentMethod object to create a redirect URL for the shoppers. Using the provided URL, make a request using the provided method (usually a GET request) and add the parameters (located in the Params object) as key-value pairs to the URL of the request.
  5. 2Checkout returns an Order object as the output of the placeOrder method. 
  6. Once you place the order, 2Checkout logs it into the system. At this point in time, the status of the order is PENDING.

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.

See code sample for more details. 

Request sample

<?php

/**
 * Sofort / Direct-Ebanking pay method order on RPC protocol
 */

function callRPC($Request, $hostUrl, $Debug = false)
{
    $curl = curl_init($hostUrl);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($curl, CURLOPT_SSLVERSION, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Accept: application/json',
        'Cookie: XDEBUG_SESSION=PHPSTORM'
    ));
    $RequestString = json_encode($Request);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $RequestString);

    if ($Debug) {
        var_dump($RequestString);
    }
    $ResponseString = curl_exec($curl);
    if ($Debug) {
        var_dump($ResponseString);
    }

    if (!empty($ResponseString)) {
        $Response = json_decode($ResponseString);
        if (isset($Response->result)) {
            return $Response->result;
        }
        var_dump($Response);

        if (!empty($Response->error)) {
            var_dump($Request->method, $Response->error);
        }
    } else {
        return null;
    }
}

$apiVersion = '6.0';
//$resource = 'orders';
//$host = "http://api.secure.avangate.local/rest/".$apiVersion."/".$resource."/";
$host = "http://api.avangate.local:8081/rpc/" . $apiVersion . "/";
//$host = "http://api.sandbox72.avangate.local/rest/".$apiVersion."/".$resource."/";

//
// IdAccount 21478
$merchantCode = "120000589445";
$key = "i9u2+w8%s4^5#8%t)A8?";
$productCode = "BDG8899343FE";
//$productCode = "TANGIBLEP"; // physical product
//*/

/*/ IdAccount 21743 (AlexB Migrated Co)
$merchantCode = "123456789000";
$key = "F34=P9?1&R0=8)O7O5E=";
//$productCode = "JBGL20192";
$productCode = "TINYPRICEPROD";
//*/

/*/ CC1268 merchant @ tests DB
$merchantCode = "CC1268";
$key = "SECRET_KEY";
$productCode = "TNGB1USD";
//*/

$date = gmdate('Y-m-d H:i:s');
$string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
//var_dump(gmdate('Y-m-d H:i:s'));
//var_dump(date('Y-m-d H:i:s')); die();
$hash = hash_hmac('md5', $string, $key);

$i = 1; // counter for api calls
// call login
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, $date, $hash);
$jsonRpcRequest->id = $i++;


$sessionID = callRPC($jsonRpcRequest, $host);
//$sessionID = "dad08e7e9a2e2812fbe89e2980b07170c867f8f6";
var_dump("session: ".$sessionID);

$currency = 'EUR';
//$currency = 'USD';

$country = 'DE'; $state = ''; $city = 'Munchen';
//$country = 'US'; $state = 'GA'; $city = 'Atlanta';

$phone = '0049-0130-5529901';

$CartObj = new stdClass();
$CartObj->Currency = $currency;
$CartObj->Language = "EN";
$CartObj->Country = $country;
$CartObj->CountryCode = $country;
$CartObj->CustomerIP = '91.220.121.21';
$CartObj->Source = "sourceAPI.net";

//$CartObj->ExternalReference = "API2.5_PLACE_ORDER_EXT_" . date("Y-m-d h:m:i");
//$CartObj->Affiliate = new stdClass();
//$CartObj->Affiliate->AffiliateCode = 'Partner123'
//$CartObj->Affiliate->AffiliateSource = 'MobilePlatform'
$CartObj->LocalTime = date('Y-m-d H:i:s');
$CartObj->CustomerReference = '421820' . strval(rand (100, 999));
$CartObj->Items = array();

$CartObj->Items[0] = new stdClass();
$CartObj->Items[0]->Code = $productCode;//"3333399999_COPY1";//"155887799"; - vld_licence_1month //"12345"; -vld_regular
$CartObj->Items[0]->Quantity = 1;
//$CartObj->Items[0]->Price = 3;

$CartObj->Items[0]->PriceOptions = [];

$priceOption = new stdClass();
$priceOption->Name = 'Users';
$priceOption->Code = 'USERS_1';
$priceOption->Options = [];

$priceOptionOption = new stdClass();
$priceOptionOption->Name = '10 users';
$priceOptionOption->Value = '10_users';
$priceOptionOption->Surcharge = 0;

$priceOption->Options[] = $priceOptionOption;
$CartObj->Items[0]->PriceOptions[] = $priceOption;

$priceOption2 = new stdClass();
$priceOption2->Name = 'Maintenance period';
$priceOption2->Code = 'MAINTE_PERIOD';
$priceOption2->Options = [];

$priceOptionOption2 = new stdClass();
$priceOptionOption2->Name = '12 months';
$priceOptionOption2->Value = 'jira_maintenance_12_mths';
$priceOptionOption2->Surcharge = 0;

$priceOption2->Options[] = $priceOptionOption2;
$CartObj->Items[0]->PriceOptions[] = $priceOption2;

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

$additionalField2 = new stdClass();
$additionalField2->Code = "additional_field_order_2";
$additionalField2->Text = "REST";
$additionalField2->Value = "a";

$additionalField3 = new stdClass();
$additionalField3->Code = "additional_field_order_3";
$additionalField3->Text = "REST";
$additionalField3->Value = "a";

$CartObj->AdditionalFields = array();
$CartObj->AdditionalFields[0] = $additionalField1;
$CartObj->AdditionalFields[1] = $additionalField2;
$CartObj->AdditionalFields[2] = $additionalField3;


$additionalField1 = new stdClass();
$additionalField1->Code = "additional_field_product_1";
$additionalField1->Text = "PRODUCT1 TEXT";
$additionalField1->Value = true;

$CartObj->Items[0]->AdditionalFields = array();
$CartObj->Items[0]->AdditionalFields[0] = $additionalField1;

//$CartObj->Promotions = ["48606DBB"];

$CartObj->MachineId = 'machineIdTestAlexB';
$CartObj->Discount = null;
$CartObj->ExternalReference = null;

$CartObj->BillingDetails = new stdClass();
$CartObj->BillingDetails->IsCompany = false;
//$CartObj->BillingDetails->Company = '';
$CartObj->BillingDetails->Address1 = '37 Mannheim Strasse, A8';
$CartObj->BillingDetails->Address2 = 'floor 3';
$CartObj->BillingDetails->City = $city;
$CartObj->BillingDetails->State = $state;
$CartObj->BillingDetails->CountryCode = $country;
$CartObj->BillingDetails->Phone = $phone;
$CartObj->BillingDetails->Email = 'reinhardt@trashmail.net';
$CartObj->BillingDetails->FirstName = 'Willy';
$CartObj->BillingDetails->LastName = 'Reinhardt';
$CartObj->BillingDetails->Zip = 99234;

/**/
$CartObj->DeliveryDetails = new stdClass();
$CartObj->DeliveryDetails->Address1 = '37 Mannheim Strasse, A8';
$CartObj->DeliveryDetails->Address2 = 'floor 3';
$CartObj->DeliveryDetails->City = $city;
$CartObj->DeliveryDetails->State = $state;
$CartObj->DeliveryDetails->CountryCode = $country;
$CartObj->DeliveryDetails->Phone = $phone;
$CartObj->DeliveryDetails->Email = 'reinhardt@trashmail.net';
$CartObj->DeliveryDetails->FirstName = 'Willy';
$CartObj->DeliveryDetails->LastName = 'Reinhardt';
$CartObj->DeliveryDetails->Zip = 99234;
/**/
$CartObj->PaymentDetails = new stdClass();
$CartObj->PaymentDetails->Type = 'DIRECT_EBANKING';
$CartObj->PaymentDetails->Currency = $currency;
$CartObj->PaymentDetails->CustomerIP = '91.220.121.21';

$CartObj->PaymentDetails->PaymentMethod = new stdClass();
//$CartObj->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$CartObj->PaymentDetails->PaymentMethod->RecurringEnabled = false;
$CartObj->PaymentDetails->PaymentMethod->ReturnURL = 'https://yourreturnurl.com';
$CartObj->PaymentDetails->PaymentMethod->CancelURL= 'https://yourcancelurl.com ';


if ($CartObj->PaymentDetails->Type == 'PREVIOUS_ORDER') {
    $CartObj->ExternalReference ='orderbyref_exteranalref' . $CartObj->PaymentDetails->PaymentMethod->RefNo;
} elseif ($CartObj->PaymentDetails->Type == 'PAYPAL') {
    $CartObj->ExternalReference ='orderbyref_exteranalref_PAYPAL';
}

var_dump('Request', json_encode($CartObj));

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


$response = json_encode(callRPC($jsonRpcRequest, $host));

var_dump('Response encoded', $response);

$response = json_decode($response);

var_dump('Response', $response);

Response Parameters

Parameter Type/Description

Order information

Object

  Object containing order information.

 Response Example

{
    "RefNo": "189897220",
    "OrderNo": 0,
    "ExternalReference": null,
    "ShopperRefNo": null,
    "Status": "PENDING",
    "ApproveStatus": "WAITING",
    "VendorApproveStatus": "OK",
    "MerchantCode": "251772850506",
    "Language": "en",
    "OrderDate": "2022-08-23 14:50:21",
    "FinishDate": null,
    "Source": "testAPI.com",
    "WSOrder": null,
    "Affiliate": {
        "AffiliateCode": null,
        "AffiliateSource": null,
        "AffiliateName": null,
        "AffiliateUrl": null
    },
    "HasShipping": true,
    "BillingDetails": {
        "FiscalCode": null,
        "TaxOffice": null,
        "Phone": "010-6552-9988",
        "FirstName": "John",
        "LastName": "Doe",
        "Company": null,
        "Email": "test@verifone.com",
        "Address1": "Test Address",
        "Address2": null,
        "City": "Test City",
        "Zip": "35005",
        "CountryCode": "de",
        "State": null
    },
    "DeliveryDetails": {
        "Phone": "010-6552-9988",
        "FirstName": "John",
        "LastName": "Doe",
        "Company": null,
        "Email": "test@verifone.com",
        "Address1": "Test Address",
        "Address2": null,
        "City": "Test City",
        "Zip": "35005",
        "CountryCode": "de",
        "State": null
    },
    "PaymentDetails": {
        "Type": "DIRECT_EBANKING",
        "Currency": "eur",
        "PaymentMethod": {
            "Amount": "35.5",
            "Currency": "eur",
            "Redirect": {
                "Url": "https://www.sofortueberweisung.de/payment/start",
                "Method": "POST",
                "Params": {
                    "user_id": "21352",
                    "project_id": "72016",
                    "sender_holder": "",
                    "sender_account_number": "",
                    "sender_bank_code": "",
                    "sender_country_id": "DE",
                    "amount": "35.5",
                    "currency_id": "EUR",
                    "reason_1": "BANKTRANSFER FOR: #189897220",
                    "reason_2": "",
                    "user_variable_0": "189897220",
                    "user_variable_1": 1423,
                    "user_variable_2": "secure.2checkout.com",
                    "user_variable_3": "",
                    "user_variable_4": "",
                    "user_variable_5": "",
                    "hash": "d88e50f1d90e0fc5a7858766db74e3be78e3b7b736d0598161a1a8e6115f4ed8"
                },
                "FullHtml": "<!DOCTYPE html><html><body><form action=\"https://www.sofortueberweisung.de/payment/start\" method=\"POST\" id=\"postform\"><input type=\"hidden\" name=\"user_id\" value=\"21352\" /><input type=\"hidden\" name=\"project_id\" value=\"72016\" /><input type=\"hidden\" name=\"sender_holder\" value=\"\" /><input type=\"hidden\" name=\"sender_account_number\" value=\"\" /><input type=\"hidden\" name=\"sender_bank_code\" value=\"\" /><input type=\"hidden\" name=\"sender_country_id\" value=\"DE\" /><input type=\"hidden\" name=\"amount\" value=\"35.5\" /><input type=\"hidden\" name=\"currency_id\" value=\"EUR\" /><input type=\"hidden\" name=\"reason_1\" value=\"BANKTRANSFER FOR: #189897220\" /><input type=\"hidden\" name=\"reason_2\" value=\"\" /><input type=\"hidden\" name=\"user_variable_0\" value=\"189897220\" /><input type=\"hidden\" name=\"user_variable_1\" value=\"1423\" /><input type=\"hidden\" name=\"user_variable_2\" value=\"secure.2checkout.com\" /><input type=\"hidden\" name=\"user_variable_3\" value=\"\" /><input type=\"hidden\" name=\"user_variable_4\" value=\"\" /><input type=\"hidden\" name=\"user_variable_5\" value=\"\" /><input type=\"hidden\" name=\"hash\" value=\"d88e50f1d90e0fc5a7858766db74e3be78e3b7b736d0598161a1a8e6115f4ed8\" /></form><script type=\"text/javascript\">document.getElementById(\"postform\").submit();</script></body></html>"
            },
            "ReturnURL": https://yourreturnurl.com,
            "CancelURL": https://yourcancelurl.com
            "Vendor3DSReturnURL": null,
            "Vendor3DSCancelURL": null,
            "InstallmentsNumber": null
        },
        "CustomerIP": "91.220.121.21"
    },
    "DeliveryInformation": {
        "ShippingMethod": {
            "Code": null,
            "TrackingUrl": null,
            "TrackingNumber": null,
            "Comment": null
        }
    },
    "CustomerDetails": null,
    "Origin": "API",
    "AvangateCommission": 2.63,
    "OrderFlow": "REGULAR",
    "GiftDetails": null,
    "PODetails": null,
    "ExtraInformation": null,
    "PartnerCode": null,
    "PartnerMargin": null,
    "PartnerMarginPercent": null,
    "ExtraMargin": null,
    "ExtraMarginPercent": null,
    "ExtraDiscount": null,
    "ExtraDiscountPercent": null,
    "LocalTime": null,
    "TestOrder": false,
    "FxRate": 0.960096,
    "FxMarkup": 4,
    "PayoutCurrency": "USD",
    "DeliveryFinalized": false,
    "Errors": null,
    "Items": [
        {
            "ProductDetails": {
                "Name": "Test Product",
                "ShortDescription": "<p>Join all your clouds in a big one</p>",
                "Tangible": false,
                "IsDynamic": false,
                "ExtraInfo": null,
                "RenewalStatus": false,
                "Subscriptions": null,
                "DeliveryInformation": {
                    "Delivery": "BY_AVANGATE",
                    "DownloadFile": null,
                    "DeliveryDescription": "",
                    "CodesDescription": "",
                    "Codes": []
                }
            },
            "PriceOptions": [],
            "Price": {
                "UnitNetPrice": 29.83,
                "UnitGrossPrice": 35.5,
                "UnitVAT": 5.67,
                "UnitDiscount": 0,
                "UnitNetDiscountedPrice": 29.83,
                "UnitGrossDiscountedPrice": 35.5,
                "UnitAffiliateCommission": 0,
                "ItemUnitNetPrice": null,
                "ItemUnitGrossPrice": null,
                "ItemNetPrice": null,
                "ItemGrossPrice": null,
                "VATPercent": 19,
                "HandlingFeeNetPrice": 0,
                "HandlingFeeGrossPrice": 0,
                "Currency": "eur",
                "NetPrice": 29.83,
                "GrossPrice": 35.5,
                "NetDiscountedPrice": 29.83,
                "GrossDiscountedPrice": 35.5,
                "Discount": 0,
                "VAT": 5.67,
                "AffiliateCommission": 0
            },
            "LineItemReference": "a37ea622e0d0aab958ac08f190842d9b66b42b6c",
            "PurchaseType": "PRODUCT",
            "Code": "LPUJL13OZ6",
            "ExternalReference": "",
            "Quantity": 1,
            "SKU": null,
            "CrossSell": null,
            "Trial": null,
            "AdditionalFields": null,
            "Promotion": null,
            "RecurringOptions": null,
            "SubscriptionStartDate": null,
            "SubscriptionCustomSettings": null,
            "UpSell": null
        }
    ],
    "Promotions": [],
    "AdditionalFields": null,
    "Currency": "eur",
    "NetPrice": 29.83,
    "GrossPrice": 35.5,
    "NetDiscountedPrice": 29.83,
    "GrossDiscountedPrice": 35.5,
    "Discount": 0,
    "VAT": 5.67,
    "AffiliateCommission": 0,
    "CustomParameters": null,
    "Refunds": null
}

For more on how to redirect shoppers to the payment method page to finalize the payment, please read here.

Set external order reference

Overview

Use this method to set an external reference for a partner order. This is helpful if you use unique identifiers in your own order management system and you want to mirror the IDs in the Avangate system.

Requirements

Use this method before placeOrder.

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier, which is the output of the Login method. An exception is thrown if the values are incorrect.
externalRef Required (String)
  The unique identifier of an order placed in the Avangate system mirroring the reference you're using to manage order data in your system.

Response

Parameter Type/Description
Response Boolean
  True or false

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
require('PATH_TO_addProduct'); // addProduct example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/08Place_an_order/00Add_product_to_cart

$externalRef = 'NEW_ORDER_REFERENCE';

try {
    $ExternalIdentifier= $client->setExternalRef ($sessionID, $externalRef);
} catch (SoapFault $e) {
    echo " ExternalIdentifierSet: " . $e->getMessage();
    exit;
}
var_dump ("ExternalIdentifierSet", $ExternalIdentifier);

Errors

Error Description

INVALID_SOURCE

The provided external reference is empty.

 

Subscription

Overview

Use this section to handle the management of your subscriptions.

You can enable or disable your existing subscription, or choose to assign them to different customer entities.

Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.

 

Place orders with dynamic product information

Overview

Use this object to create new orders and collect payments from shoppers using products with dynamic information. 

Purchase types available are PRODUCT, TAX, SHIPPING, and COUPON. The surcharge defined in the pricing option is used for calculating the order renewal price, when applicable.

You can find a list of common errors that may arise when using the placeOrder call via APIv6 here.

   This functionality is available only for merchants on the 2Sell and 2Subscribe accounts (PSP business model), for orders that are placed both through ConvertPlus/InLine ordering engines and API calls.

Supported payment methods

  1. Credit/Debit cards: Visa, Visa Electron, MasterCard, Maestro, Amex, Discover, Dankort, Carte Bleue, JCB. 2Checkout supports local Brazilian cards.
  2. PayPal
  3. Free orders (no payment information required).
  4. 2Pay.js

How to test?

Place test orders with dynamic product information by following the instructions from this article.

Requirements

The product code must be sent as null. The order currency must match the payment currency otherwise, an error is thrown. The isDynamic parameter of the Items object must be true.

For credit card orders placed using API 5.0 or newer versions, you need to pass through additional parameters that support the 3D Secure flow. 3D Secure works by redirecting customers to pages provided by their banks, where they need to enter additional security tokens or passwords to trigger the completion of the charge. By using 3D Secure, you get additional protection from liability for fraudulent card payments, with customers having to go through an extra layer of authentication.

Send the following parameters as part of the PaymentMethod object:

Parameters Description
Vendor3DSReturnURL Required (string)
  URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.
Vendor3DSCancelURL Required (string)
  URL address to which customers are redirected if the 3DS details were not validated or the order could not be authorized.
WSOrder Optional (String)
  The WSOrder parameter is used to control the website URL displayed in the email messages shoppers receive after they place an order. By default, 2Checkout reports the URL set as Homepage in the Account information area. Adding WSOrder to the buy-links for your products will cause the optional website address set by using the parameter to override and replace the Homepage URL in the email notifications sent to customers. The behavior is similar to the WS_ORDER parameter supported on checkout/cart pages and described here.

Limitations

Placing an order with both catalog and dynamic product information is not possible. Recurring options can be set only for purchase type PRODUCT and TAX.

Parameters

Parameters Type/Description

Currency

Optional (String)

 

The currency ISO code for the payment - ISO 4217. Example: “usd.”

Country

Optional (String)

 

Shopper country. ISO 3166 two-letter code. Example: “us.”

Language

Optional (String)

 

ISO 639-1 two-letter code. Language used for the purchase process. Example: “en.”

ExternalReference

Optional (String)

 

Set external reference identifiers for orders. Enables you to replicate the functionality of the REF parameter included into Buy Links. Maximum 100 characters. If there is a need for longer references, you can apply an md5 hash for any string value, resulting in a 32 characters string. You can verify the hash after the order notification, on the client-side.

Source

Optional (String)

 

The link source for the sales. Enables you to replicate the functionality of the SRC (separate link identifier) parameter when included in the buy-links. Use the SRC parameter to track sale sources.

Maximum length 255 characters.

CustomerReference

Optional (Integer)

 

External customer ID you can attach to the customer.

MachineId

Optional (String)

 

Unique, system-generated code for each unique customer, identifying returning customers.

Items

Required (Array of Objects)

 

 

 

Details below. 

 

 

Code

Optional (String)

 

 

 

Should be sent as NULL. Any other value is ignored.

 

 

Quantity

Required (Integer)

 

 

 

Number of units purchased.

  ProductExternalReference Optional (String)
  isDynamic Required (Boolean)
    Send TRUE for orders with dynamic product information.
  Tangible Required (Boolean)
   

Possible values:

  • FALSE for products delivered electronically.
  • TRUE for tangible products, that require physical delivery.
  PurchaseType Required (String)
   

Purchase types available are:

  • PRODUCT - Item purchased by the customer. Is mandatory to send the name and price of the product item. Can also have pricing options and recurring options attached.
  • TAX - additional handling fee added to the purchase.
  • SHIPPING - shipping fee applied to purchase.
  • COUPON - amount deducted from total order price. Send positive values.
  PriceOptions Optional (Array of Objects)
    Array of price option groups.
    Name   Optional (String) 
        Name of the pricing option group.
    Options   Optional (Array of Objects)
        Array of pricing options.
    Name Optional (String)
      Pricing option name. 
    Value Optional (String)
      Pricing option code. 
    Surcharge Optional (Double)
      Surcharge of the pricing option. For renewal orders, the renewal price includes the pricing option surcharge from the initial order. 
  RecurringOptions Optional (Object)
      Contains recurring options.
    CycleLength Optional (Integer)
      The length of the recurring billing cycle.
    CycleUnit Optional (String)
      Unit of measuring billing cycles (years, months).
    CycleAmount Optional (Integer)
      The amount to be billed on each renewal.
    ContractLength Optional (Integer)
      The contact length for which the recurring option will apply.
    ContractUnit Optional
      Unit of measuring contact length (years, months).
  Name   Required (String)

 

 

Price

Required (Object)

    Details below.
    Amount Required (Double)
      Amount of the product.
    Type Optional (String)
      Send "CUSTOM" for dynamic pricing.

 

 

Trial

Optional (Object) – Can be NULL

 

 

 

 

Details below. 

 

 

 

Period

Optional (Integer)

 

 

 

 

The length of the trial subscription lifetime in days.

 

 

 

Price

Optional (Double)

 

 

 

 

Total trial price in the payment currency before 2Checkout deducts any taxes, discounts, etc.

 

 

AdditionalFields

Optional (Array of Objects) – Can be NULL

 

 

 

AdditionalFieldSet

Optional (Object) – Can be NULL

        Details below
        Code Optional (String)
          Identifier code for the additional field.
        Text Optional (String)
          Text displayed in the additional field.
        Value Optional (String)
          Additional field value.
    SubscriptionStartDate Optional (String)
     

Specify the date time stamp when the subscription becomes active. Format 2016-07-02 22:22:22 (YYYY-MM-DD HH:mm:ss). Available for JSON-RPC and REST.

Send empty or NULL to activate subscriptions on the same date when customers purchase them.

You can exclude HH:mm:ss when sending the date and include only YYYY-MM-DD. In this case, 2Checkout uses 00:00:01. Default time zone GMT+02:00.

BillingDetails

Required (Object)

 

 

Details below. 

 

FirstName

Required (String)

 

 

Shopper name.

 

LastName

Required (String)

 

 

Shopper surname.

 

CountryCode

Required (String)

 

 

Shopper country. ISO 3166 two-letter code.

 

State

String/Optional – Required for US, Canada, Brazil, Turkey, India and Romania

 

 

The state in the shopper's country. Mandatory when you set the Billing Country to US, Canada, Brazil, Turkey, India and Romania. Use case insensitive utf8 strings for the full name, or just the two-letter code.

 

City

Required (String)

 

 

Shopper city.

 

Address1

Required (String)

 

 

Shopper address.

 

Address2

Optional (String)

 

 

Shopper address.

 

Zip

Required (String)

 

 

ZIP/ Postal code.

 

Email

Required (String)

 

 

Shopper email address.

 

Phone

Optional (String)

 

 

Shopper phone number. Mandatory when you set Brazil as the Billing Country. Can be NULL.

 

Company

Optional (String)

 

 

Company name. Can be null for end users. When present, you also need to provide the FiscalCode.

 

FiscalCode

Optional (String) – Required for Brazil

 

 

• For companies, it needs to be the VAT ID. 2Checkout will validate the value provided and throw an error if the VAT ID is invalid/incorrect when calling setPaymentDetails. When present, you also need to provide the Company name.

• Mandatory when you set Brazil as the Billing Country. For Brazilian customers, it represents the Fiscal Code (CPF/CNPJ).

Mandatory when you set India as the Billing Country and purchase is made by a Company.

• Can be NULL for end users.

  TaxExemptionId  Optional (string)
    Tax Exempt Certification id used to deduct taxes for US orders
Example: 1b80eecc349v

DeliveryDetails

Required (Object)

 

 

               

Details below. 

 

 

FirstName

Required (String)

 

 

 

             

Shopper name from the delivery details.

 

 

LastName

Required (String)

 

 

 

             

Shopper surname from the delivery details.

 

 

CountryCode

Optional (String)

 

 

 

             

Shopper country. ISO 3166 two-letter code from the delivery details.

 

 

State

String/Optional – Required for US, Canada, Brazil, Turkey, India and Romania

 

 

 

             

The state in the shopper's country. Mandatory when you set the Billing Country to US, Canada, Brazil, Turkey, India and Romania. Use case insensitive utf8 strings for the full name, or just the two-letter code.

 

 

City

Optional (String)

 

 

 

             

Shopper city from the delivery details.

 

 

Address1

Optional (String)

 

 

 

             

Shopper address from the delivery details.

 

 

Address2

Optional (string)

 

 

 

             

Shopper address from the delivery details.

 

 

Zip

             

Optional (String)

 

 

 

             

ZIP/ Postal code from the delivery details.

 

 

Email

Optional (String)

 

 

 

             

Shopper email address from the delivery details.

 

 

Phone

Optional (String)

 

 

 

             

Shopper phone number from the delivery details. Mandatory when you set Brazil as the Billing Country. Can be NULL.

 

 

Company

Optional (String)

 

 

 

             

Company name from the delivery details. Can be null for end users. When present, you also need to provide the FiscalCode.

DeliveryInformation

Object / Optional

For products that require physical delivery, use this object to send the shipping method.

    ShippingMethod          

Object

Details below

        Code         String
  System-generated identified for your shipping method configuration.

PaymentDetails

Required (Object)

 

Adapt this object to the desired payment method.

 

Type

Required (String)

 

 

The payment method:

  • CC (credit/debit card - including local Brazilian cards).
  • ENCRYPTED_PAYMENT_DATA (client-side encryption)
  • PAYPAL
  • PAYPAL_EXPRESS
  • TEST (for test orders).
  • PREVIOUS_ORDER(place new orders using the reference of a previous order).
  • EXISTING_PAYMENT_DATA  (use a card one of your customers already used to purchase from your account).
  • WIRE – the placeOrder response includes Wire payment details.
  • CHECK – the placeOrder response includes Check payment details.
  • WE_CHAT_PAY (for WeChat payments).
  • IDEAL (for iDEAL payments).
  • PURCHASEORDER - use for orders with POs.
  • FREE – for 0 value orders for which you’re not requiring customers to provide payment details.
  • EES_TOKEN_PAYMENT (2Pay.js)
  • GOOGLE PAY

 

Currency

Required (String)

 

 

The currency ISO code for the payment - ISO 4217. Example: “usd.”

 

PaymentMethod

Optional (Object)

                                                          RecurringEnabled Optional (Boolean)
   

true – shopper checks the auto-renewal checkbox and 2Checkout charges subscription renewals using a recurring billing process.

false – shopper doesn’t check the auto-renewal checkbox.

 

 

Object structure and parameters differ according to the payment method selected and API method (placing orders (POST) vs. retrieving order data (GET)).

 

NULL for 0 value orders for which you’re not requiring customers to enter payment details.

 

 

 

CardPayment

Optional (Object)

 

 

 

 

 

Details below. 

 

 

 

 

CardNumber

Required (String)

 

 

 

 

 

The credit/debit card number.

 

 

 

 

CardType

Required (String)

 

 

 

 

 

visa, visaelectron, mastercard, maestro, amex, discover, dankort, cartebleue, jcb, hipercard, elo

 

 

 

 

ExpirationYear

Required (String)

 

 

 

 

 

The year in which the card expires.

 

 

 

 

ExpirationMonth

Required (String)

 

 

 

 

 

The month in which the card expires.

 

 

 

 

HolderName

Required (String)

 

 

 

 

 

Card holder name.

        Vendor3DSReturnURL Required (String)
          URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.
        Vendor3DSCancelURL Required (String)
          URL address to which customers are redirected if the 3DS details were not validated or the order could not be authorized.

 

 

 

 

CCID

Optional (String)

 

 

 

 

 

Credit Card Identification - an extra ID printed on the card, usually a 3-4 digit number, the CVC2/CVV2.

        HolderNameTime Optional (Float)
         

The interval of time in seconds in which shoppers enter their name in the HolderName field. An abnormally short interval is usually a red flag for fraud attempts.

Can be NULL, but not a negative number.

        CardNumberTime Optional (Float)
         

The interval of time in seconds in which shopper enter their card number in the CardNumber field. An abnormally short interval is usually a red flag for fraud attempts.

Can be NULL, but not a negative number.

 

 

 

 

                                                     InstallmentsNumber 

Optional (Integer)

 

 

 

 

 

Number of installments. Available only when customers un Brazil pay with Visa or MasterCard using Brazilian Real as the order currency. Use 1 or exclude the parameter for full payments. 

 

CustomerIP

Optional (String)

 

 

Shopper IP.

Promotions Optional (Array of Strings)
  Array of promotion codes.

LocalTime

Optional (String)

 

Local shopper time in the following format: Y-m-d H:i:s.

This parameter can impact the fraud score of an order when it's missing, NULL or incorrectly formatted.

 

Retrieve partner invoice

Overview

Access information about partner invoices in the Avangate system based on their unique references.

Requirements

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.
proformaNumber Required (String)
  The unique identifier of a partner invoice from the Avangate system.

Response

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

$proformaNumber = 'YOUR_PROFORMA_NUMBER';

try {
    $Proforma= $client->getProforma ($sessionID, $proformaNumber,True);
} catch (SoapFault $e) {
    echo "ProformaOutput: " . $e->getMessage();
    exit;
}
var_dump ("ProformaOutput", $Proforma);

Errors

Error Description

INVALID_PARTNER

No partner is set.

INVALID_PROFORMA_NUMBER

Invalid partner invoice number.

 

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