Skip to main content

Add translations

Overview

Use the addPromotionTranslations method to add localized texts to existing promotions.

Parameters

Parameter Type/Description

sessionID

Required (string)

 

Output of the Login method.

promotionCode

Required (string)

 

The code corresponding to the promotion that you want to add translations to.

promotions

Required (array of PromotionTranslations objects)

PromotionTranslations  Object

 

language

Required (string)

 

 

ISO country code corresponding to the country you want to set the translation for.

 

name

Required (string)

 

 

Localized promotion name applicable to the selected country.

Response

Parameters Type/Description

promotionTranslation

Object

Request

<?php

require ('PATH_TO_AUTH');

// Promotion code corresponding to the promotion you want to add translations to
$promotionCode = '';

// Defining a translation for German shoppers
$promotionTranslation1 = new stdClass;
$promotionTranslation1->Language = 'de'; 
$promotionTranslation1->Name = 'YOUR_GERMAN_PROMOTION_NAME';

// Defining a translation for Bulgarian shoppers
$promotionTranslation2 = new stdClass;
$promotionTranslation2->Language = 'bg'; 
$promotionTranslation2->Name = 'YOUR_BULGARIAN_PROMOTION_NAME';

$translations = [$promotionTranslation1, $promotionTranslation2];

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'addPromotionTranslations',
'params' => array($sessionID, $promotionCode, $translations)
);
var_dump (callRPC($jsonRpcRequest, $host));

 

Pricing

Overview

Update subscription plan/product pricing using the PriceOptionsGroup and the PricingConfiguration objects.

PriceOptionsGroup  

Use this object to add/create and edit/update price options for your account.

Parameters Type/Description

PriceOptionsGroup

Object

Name

String

 

Price option group name. Use this parameter when adding a new price options group. To edit the name of a price option group use the Name parameter under the Translations object.

Description

String

 

Pricing option group description.

Translations

Array of objects

 

Details below.

 

Name

String

 

 

Product pricing options group name, localized under Options.

 

Description

String

 

 

Product pricing options group description, localized under Options.

 

Language

String

 

 

ISO language code. (ISO 639-1 two-letter code).

Code

String

 

Unique code that The 2Checkout system generates or set for each pricing options group.

Type

String

 

The type of the pricing options group. Possible values:

· RADIO

· CHECKBOX

· INTERVAL

· COMBO

Options

Array of objects

 

Details below.

 

Name

String

 

 

Pricing option child name.

 

Description

String

 

 

Pricing option child description.

 

Translations

Array of objects

 

 

Details above.

 

 

Name

String

 

 

 

Localized product pricing options group name under PriceOptionGroup.

Localized pricing option child name under Options.

 

 

Description

String

 

 

 

Localized product pricing options group description under PriceOptionGroup.

Localized pricing option child description under Options.

 

 

Language

String

 

 

 

ISO language code. (ISO 639-1 two-letter code).

 

Code

String

 

 

The code you set or that the 2Checkout system generated for each pricing option child inside a pricing options group parent.

 

ScaleMin

Int

 

 

The minimum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

 

ScaleMax

Int

 

 

The maximum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

 

SubscriptionImpact

Object

 

 

Details below.

 

Months

String

 

 

The value in months the 2Checkout system adds or subtracts from the initial billing cycle of a subscription.

 

Impact

String

 

 

Possible values:

· ADD

· SUBTRACT

· LIFETIME

 

PriceImpact

Object

 

 

Details below.

 

 

ImpactOn

String

 

 

 

Possible values:

  • BASE corresponding to impact on base price
  • GLOBAL for impact on calculated sum.

 

 

Impact

String

 

 

 

Impact on price per unit:

  • ADD
  • SUBTRACT

 

 

Percent

String

 

 

 

The value of the percentage out of the price per product unit, when you use PERCENT for Method.

 

 

Method

String

 

 

 

Possible values:

· PERCENT

· FIXED

 

 

Amounts

Array of objects.

 

 

 

Details below.

 

 

 

Currency

String

 

 

 

 

Currency ISO code - ISO 4217.

 

 

 

Amount

String

 

 

 

 

The amount defined for each specific currency active for your account, when you use FIXED for Method.

 

Default

Boolean

 

 

TRUE for preselected options.

Missing for options that are not preselected.

PriceOptionGroup  

Use this object to search for, retrieve information on price option groups (including those assigned to specific products) for your account.

Parameters Type/Description

PriceOptionGroup

Array of objects

Name

String

 

Price option group name.

 

Use this parameter when adding a new price options group.

 

To edit the name of a price option group use the Name parameter under the Translations object.

Description

String

 

Pricing option group description.

Translations

Array of objects

 

Details below.

Code

String

 

Unique code that The 2Checkout system generates or set for each pricing options group.

Type

String

 

The type of the pricing options group. Possible values:

· RADIO

· CHECKBOX

· INTERVAL

· COMBO

Options

Array of PriceOption objects

 

Details below.

 

Parameters Type/Description

PriceOption

Object

Code

String

 

The code you set or that the 2Checkout system generated for each pricing option child inside a pricing options group parent.

ScaleMin

Int

 

The minimum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

ScaleMax

Int

 

The maximum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

SubscriptionImpact

SubscriptionLifetimeImpact object

 

Details below.

PriceImpact

Object

 

Details below.

Default

Boolean

 

TRUE for preselected options.

Missing for options that are not preselected.

Name

String

 

Pricing option child name.

Description

String

 

Pricing option child description.

Translations

Array of objects

 

Details below.

 

Parameters Type/Description

SubscriptionLifetimeImpact

Object

Months

String

 

The value in months the 2Checkout system adds or subtracts from the initial billing cycle of a subscription.

Impact

String

 

Possible values:

· ADD

· SUBTRACT

· LIFETIME

 

Parameters Type/Description

PriceImpact

Object

ImpactOn

String

 

Possible values:

  • BASE corresponding to impact on base price
  • GLOBAL for impact on calculated sum.

Impact

String

 

Impact on price per unit:

  • ADD
  • SUBTRACT

Percent

String

 

The value of the percentage out of the price per product unit, when you usePERCENT for Method.

Method

String

 

Possible values:

· PERCENT

· FIXED

Amounts

Array of objects.

 

Details below.

 

Parameters Type/Description

Amount

Object

Currency

String

 

Currency ISO code - ISO 4217.

Amount

String

 

The amount defined for each specific currency active for your account, when you use FIXED for Method.

 

Parameters Type/Description

Translations

Object

Name

String

 

Localized product pricing options group name under PriceOptionGroup.

Localized pricing option child name under Options.

Description

String

 

Localized product pricing options group description underPriceOptionGroup.

Localized pricing option child description under Options.

Language

String

 

ISO language code. (ISO 639-1 two-letter code).

PricingConfiguration  

Use this object to add/create and update/edit pricing configurations for your account. You can assign one or multiple price option groups to pricing configurations.

You identify a pricing configuration using its unique identifier: Code.

 

Parameters Type/Description

PricingConfiguration

Object

Name

String

 

Pricing configuration name.

Code

String

 

System-generated identifier. Read-only.

Default

Boolean

 

True for the default pricing configuration

BillingCountries

Array of strings

 

ISO codes of the countries assigned to the pricing configuration.

Empty unless a pricing configuration has specific countries assigned.

PricingSchema

String

 

DYNAMIC – With a base price

FLAT – Without a base price

PriceType

String

 

Possible values:

• NET

• GROSS

DefaultCurrency

String

 

The ISO code of the default currency for the pricing configuration

Prices

Object

 

Details below.

 

Regular

Array of objects

 

 

Details below.

 

 

Amount

Int

 

 

 

The price of the product. Use -1 to delete it.

 

 

Currency

String

 

 

 

ISO code of the currency for the product price.

 

 

MinQuantity

Int

 

 

 

The minimum quantity of volume discounts. Default is 1.

 

 

MaxQuantity

Int

 

 

 

The maximum quantity of volume discounts. Default is 99999.

 

 

OptionCodes

Array of objects

 

 

 

Details below.

 

 

 

Code

String

 

 

 

 

System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

 

 

Options

StringArray

 

 

 

 

The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

Renewal

Array of objects

 

 

Details below.

 

 

Amount

Int

 

 

 

The price of the product. Use -1 to delete it.

 

 

Currency

String

 

 

 

ISO code of the currency for the product price.

 

 

MinQuantity

Int

 

 

 

The minimum quantity of volume discounts. Default is 1.

 

 

MaxQuantity

Int

 

 

 

The maximum quantity of volume discounts. Default is 99999.

 

 

OptionCodes

Array of objects

 

 

 

Details below.

PriceOptions

Array of objects

 

Details below.

 

Code

String

 

 

System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

Required

Boolean

 

 

true – you set the price options group as required during the purchase process.

false - you did not set the price options group as required during the purchase process.

 

Recurring payment failed (Direct Debit)

Overview

Use the variables in the list below to customize the Recurring payment failed (Direct Debit).

Check the Mandatory column to see the variables that are required in your customized version of the e-mail.

Variable name Description Test value Mandatory
2CHECKOUT_LOGO 2Checkout logo URL https://secure.2checkout.com/images/e...endor_logo.png Yes

BANKACCOUNT

2Checkout bank account

[NLXXABNAXXXXXXXXXX (IBAN)]

No

BANKIBAN

2Checkout bank IBAN

ABNANL2XXX

No

BANKNAME

2Checkout bank name

 ABN AMRO Bank Amsterdam

No

BANKROUTINGNUMBER

2Checkout bank routing number

0

No

BANKSWIFT

2Checkout bank swift code

ABNANL2XXX

No

BUSINESS_COMPANY

2Checkout company name

2Checkout

No

BUSINESS_HOTLINE

2Checkout support phone

0

No

BUSINESS_HOTLINEUS

2Checkout US hotline number

0

No

BUSINESS_OPEMAIL

2Checkout operational email address

0

No

BUSINESS_SUPEMAIL

2Checkout support email address

support@2checkout.com

No

BUSINESS_WEBSITE

2Checkout website

http://www.2checkout.com

Yes

BUY_NOW_NEW_LINK

* Prefilled buy link

0

No

COMMERCIALNAME

Merchant's commercial name

0

Yes

CURRENCY

Order billing currency

EUR]

Yes

CURRENCY_ORIGINAL

Original order currency (applicable to refunds)

0

No

ENCRYPTED_MERCHANT_CODE

Encrypted merchant code

FGTH45HG

No

FIRSTNAME

Shopper's first name used on the delivery information

First

No
GATEWAY_ERROR_CODE Gateway error code GW_PROCESSING_ERROR

See the full
list of Possible Values
No
GATEWAY_ERROR_MESSAGE Reason why the transaction failed. (e.g. Invalid card, insufficient funds) Error processing the card transaction. The card account has not been debited. Card data is invalid or incomplete. No

GENERALTOTAL

Total order price

[23

Yes

HAS_RENEWAL_PRODUCTS

Flag that indicates whether at least one product has renewal settings

0

No

IS_RENEWAL

Flag that indicates whether at least one product has renewal settings

0

No

LASTNAME

Shopper's last name used on the delivery information

Last

No

MYACCOUNT_URL_UPDATE_CC

URL for updating credit card information in myAccount

0

No

MY_ACCOUNT_URL_UPDATE_CC

URL for updating credit card information in myAccount

http://www.example.com/myaccount/

No

NAMES_OF_PRODUCTS

Names of all products in the order, comma-separated

0

No

ORDERDATE

Order placement date

41641

Yes

ORDER_AMOUNT_ORIGINAL

Original order value (applicable to refunds)

0

No

ORDER_DATE_STANDARD_FORMAT

Standard format used for the order placement date

0

No

ORDER_FLOW

Purchase flow used to place the order

0

No

ORDER_STATUS

Order status

0

No

PAYMENT_TYPE_INFO

English payment method name. Includes last four card digits (if applicable).

0

No

PRODUCTS

0

0

No

PRODUCTS[index1].BILLING_CYCLE

Indicates how many renewals have been successfully performed so far (on the subscription)

11

No

PRODUCTS[index1].DISCOUNT

Product discount value per product line

[2.00

No

PRODUCTS[index1].INFO

Additional product information defined by the merchant when generating buy links

[Product name info]

No

PRODUCTS[index1].LICENSE_TYPE

Type of purchased subscription

TRIAL

No

PRODUCTS[index1].PCODE

Product code.

2016

No

PRODUCTS[index1].PID

Product ID number

4572431

No

PRODUCTS[index1].PNAME

Product name

Product name

No

PRODUCTS[index1].PRICE

Product unit price

[20.00

No

PRODUCTS[index1].PRODUCT_OPTIONS[index2]

0

0

No

PRODUCTS[index1].PRODUCT_OPTIONS[index2].OptionText

Ignore internal var.

0

No

PRODUCTS[index1].PROMONAME

Name of the promotion applied to the product

[Some promotion]

No

PRODUCTS[index1].QUANTITY

Purchased product quantity

[1]

No

PRODUCTS[index1].SHORT_DESCRIPTION

Short product description

0

No

PRODUCTS[index1].TOTAL

Total gross price per product line (before applying discounts)

[23.00

No

PRODUCTS[index1].VAT

VAT/Sales tax value per product line

[5

No

PRODUCTS_DATA[index1].IdProduct

Product ID number

0

No

PRODUCTS_DATA[index1].PRODUCT_SHORT_DESCRIPTION

Short product description

0

No

PRODUCTS_LIST

Products data.

Product name

Yes

PRODUCTS_NO

Number of products in cart

1

No

REFNO

Order reference number

[9xxxxx]

Yes

RETRYLINK

Payment retry link

https://shop.example.com/order/finis...?id=xxxxxxxxxx

No

RETRY_LINK

Payment retry link

0

No

SELLERCOMPANY

Merchant's company name

[Software Company Name]

No

TOTALEQUIV

The order amount converted to all the merchant's currencies

0

No

UNSUBSCRIBE_LINK

Shopper unsubscribe link

0

No

UPLOADLINK

File upload link

0

No

UPLOAD_LINK

File upload link

0

No

WEBSITE

Website where the shopper placed the order

http://www.software-company-website.com

No

How to add affiliate marketing resources

Availability

The text and image affiliate marketing resources are available for all 2Checkout accounts with the Affiliate Network enabled.

Activate affiliate landing pages

If you want to activate landing pages for your affiliates, please contact 2Checkout for details.

Tip: Before you start adding Affiliate Marketing Resources, make sure you have them uploaded on a server. You can use your own hosting domain, or upload them in your 2Checkout Account by going to Setup -> Media Center.

Allowed file types: .gif .jpg .png .css .js .ico .zip .ttf. Upload file size limit: 750 MB. For larger files please contact us. Disk space 2048 MB. 

For maximum browser compatibility, JPEG files must have the RGB color space. JPEG files uploads of CMYK type are not allowed.

How to add affiliate marketing resources

Assist your affiliates' efforts in selling your products with additional marketing materials:

  • Custom text (descriptions, features, etc.) - Use custom texts to offer your affiliates extra details about your products that they can use to better promote them. Offers details such as the target audience of the product, its specifications, benefits and advantages.
  • Links to product image files - Use product images to offer your affiliates extra details about your products that they can use to better promote them.
  • Custom landing pages - Use custom made landing pages to give your affiliates the option to redirect shoppers to landing pages designed to optimize your conversion rate and increase sales.

To control affiliate access to a resource, assign it to products that belong to one of your affiliate commissions lists. Unassigned resources are available to all your affiliates. Promotions are not mandatory for a resource to be available in the Affiliate Network.

What are affiliate landing pages?

Custom landing pages allow you to redirect your affiliates' traffic to separate pages designed to increase the conversion rate. By using custom landing pages for each product, you gain more control over your shoppers' purchase experience.

Additionally, landing pages give your affiliates an easy way to send targeted traffic to your products, increasing the conversion rate per product by narrowing down the traffic to visitors who are truly interested in buying what you offer.

2Checkout recommends creating multiple landing pages for your products, thus increasing the chance of receiving relevant traffic from your affiliates.

How to add new affiliate marketing resources

You can define these resources in the Affiliate Marketing Resources area of the Control Panel. To access it, navigate to Marketing tools -> Channel resources.

  1. Click Add affiliate resource.
  2. Choose the type of the marketing resource to add. You can choose between:
    • Text
    • Image
    • Landing page
  3. Define the details of the new resource:
    • For text resources: name and description
    • For image resources: name and URL
    • For landing pages: name and URL
  4. Assign products to the marketing resource by clicking Assign product and choosing the products you want to assign to this resource from the list. You can search for specific products in the Product name search box.
  5. (Optional) Assign promotions to the marketing resource by clicking Assign promotion and choosing the promotions you want to assign to this resource from the list. You can search for specific promotions in the Search promotion search box.
  6. Click Save resource

That's it! You can now see the resource in the Affiliate Marketing Resources page. You can edit or delete it as you please.

What do your affiliates see?

Affiliates can see the marketing resources in the Affiliate Control Panel when they generate new links for your products. They can use the Link type drop-down menu to select the type of resource to use: text, image or landing page.

In the example below, the affiliate chose to use a landing page called My New Landing Page. Once they generate the link, the shoppers accessing it will be redirected to your new landing page.

Your affiliates can see a preview of each resource by clicking the preview links in the Marketing materials section.

By using the landing page's URL, your affiliates can redirect segments of their traffic to each product's landing page.

Manage leads

Overview

Use the markLeads method to mark a lead as used and/or stop follow-ups.

Request Parameters

Parameters Required Type/Description
LeadCode Required String. Unique system-generated identifier.
Used Required

Boolean. With possible values:

TRUE - 

FALSE - 

StopFollowups Required

Boolean. With possible values:

TRUE - 

FALSE - 

Request Example

<?php

require ('PATH_TO_AUTH');

$markLead = [
    'LeadCode' => '60E6C4B574',
    'StopFollowups' => false,
    'Used' => true
];

try {
    $leadData = $client->markLeads($sessionID, [$markLead]);
} catch (SoapFault $e) {
    echo "markLeads: " . $e->getMessage();
    exit;
}

var_dump("markLeads", $leadData);

Response Example

class stdClass#18 (2) {
  public $Response =>
  string(37) "1 leads have been marked successfully"
  public $Errors =>
  array(0) {
  }
}

Update a customer

Overview

Use the updateCustomerInformation method to update the details of a customer entity from the Avangate system.

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.

Customer

Object (required)

Use this object to update customer information.

UpdateEndUserSubscriptions

Optional (boolean)

You can push the changes made on the customer info to the end-user details for all subscriptions belonging to this customer. Set true to have the changes reflected on the end-user details for all subscriptions. If null or false, the changes are made only at the customer level. Default value is false.

Response

Parameters Type/Description

Boolean

true or false depending on whether or not the operation succeeded.

Request


<?php
$host   = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/4.0/?wsdl", array(
    'location' => $host . "/soap/4.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "YOUR_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 = "YOUR_SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$customerReference = 298084139;
$externalCustomerReference = 'Apitest123456'; //Optional, but if you include it it needs to belong to the same customer as the internal Avangate customer reference
try {
    $customerInfo = $client->getCustomerInformation($sessionID, $customerReference, $externalCustomerReference);
}
catch (SoapFault $e) {
    echo "customerInfo: " . $e->getMessage();
    exit;
}
$customerInfo->Email = 'newemailaddressupdated@email.com';
$UpdateEndUserSubscriptions = false; // // Optional, but if true the changes made on customer info are pushed to all subscriptions from this customer.
try {
    $updatedCustomerInfo = $client->updateCustomerInformation($sessionID, $customerInfo, $UpdateEndUserSubscriptions);
}
catch (SoapFault $e) {
    echo "updatedCustomerInfo: " . $e->getMessage();
    exit;
}
var_dump("updatedCustomerInfo", $updatedCustomerInfo);

Retrieve account's time zone

Overview

Use the getTimezone method to retrieve information on the time zone used by your account for the Avangate API.

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.

Response

Timezone

String

 

The time zone you selected or the default GMT+02:00 time zone of the Avangate system.

Request


<?php
$host   = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/4.0/?wsdl", array(
    'location' => $host . "/soap/4.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "YOUR_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 = "YOUR_SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
try {
    $Timezone = $client->getTimezone($sessionID);
}
catch (SoapFault $e) {
    echo "Timezone: " . $e->getMessage();
    exit;
}
var_dump("Timezone", $Timezone);

Search leads

Overview

Use the searchLeads method to retrieve leads created in the 2Checkout system.

Request Parameters

Parameters Required Type/Description
Page Required String. The page in the result set.
Limit Required Number. The number of items to be retrieved on each page.

Request Example

<?php

require ('PATH_TO_AUTH');

$LeadSearchInput = new stdClass();

$LeadSearchInput->Type = "New";
$LeadSearchInput->Language = "BG";
$LeadSearchInput->Country = "RO";
$LeadSearchInput->Page = 1;
$LeadSearchInput->Limit = 200;

try {
    $leadData = $client->searchLeads($sessionID, $LeadSearchInput);
} catch (SoapFault $e) {
    echo "searchLeads: " . $e->getMessage();
    exit;
}

var_dump("searchLeads", $leadData);

Response Example

class stdClass#4 (2) {
  public $Items =>
  class stdClass#5 (1) {
    public $0 =>
    class stdClass#6 (14) {
      public $LeadCode =>
      string(10) "60E6C4B574"
      public $GeneratedFrom =>
      string(3) "API"
      public $CartId =>
      string(11) "CartIdValue"
      public $Currency =>
      string(3) "EUR"
      public $Language =>
      string(2) "BG"
      public $ExternalReference =>
      string(18) "REST_API_3CHECKOUT"
      public $MachineId =>
      string(6) "123asd"
      public $LocalTime =>
      string(19) "2019-11-05 16:48:28"
      public $Items =>
      class stdClass#7 (1) {
        public $0 =>
        class stdClass#8 (15) {
          public $Code =>
          string(10) "04C26C50F8"
          public $Quantity =>
          string(1) "2"
          public $SKU =>
          NULL
          public $Name =>
          string(5) "softy"
          public $Description =>
          NULL
          public $IsDynamic =>
          bool(false)
          public $Tangible =>
          bool(false)
          public $PurchaseType =>
          string(7) "PRODUCT"
          public $PriceOptions =>
          NULL
          public $RecurringOptions =>
          class stdClass#9 (5) {
            public $CycleLength =>
            NULL
            public $CycleUnit =>
            NULL
            public $CycleAmount =>
            NULL
            public $ContractLength =>
            NULL
            public $ContractUnit =>
            NULL
          }
          public $RenewalInformation =>
          class stdClass#10 (1) {
            public $SubscriptionReference =>
            NULL
          }
          public $MarketingCampaigns =>
          class stdClass#11 (3) {
            public $Type =>
            string(2) "23"
            public $ParentCode =>
            string(1) "m"
            public $CampaignCode =>
            string(2) "23"
          }
          public $Price =>
          class stdClass#12 (2) {
            public $Amount =>
            string(2) "20"
            public $Type =>
            string(6) "CUSTOM"
          }
          public $AdditionalFields =>
          NULL
          public $SubscriptionStartDate =>
          string(19) "2019-11-05 16:48:28"
        }
      }
      public $BillingDetails =>
      class stdClass#13 (12) {
        public $FirstName =>
        string(8) "Customer"
        public $LastName =>
        string(9) "2Checkout"
        public $Phone =>
        NULL
        public $Company =>
        NULL
        public $FiscalCode =>
        string(8) "32423423"
        public $Email =>
        string(22) "customer@2checkout.com"
        public $Address1 =>
        string(12) "Test Address"
        public $Address2 =>
        NULL
        public $City =>
        string(2) "LA"
        public $Zip =>
        string(5) "12345"
        public $CountryCode =>
        string(2) "RO"
        public $State =>
        string(2) "CA"
      }
      public $DeliveryDetails =>
      class stdClass#14 (12) {
        public $FirstName =>
        string(8) "Customer"
        public $LastName =>
        string(9) "2Checkout"
        public $Phone =>
        NULL
        public $Company =>
        NULL
        public $FiscalCode =>
        string(8) "32423423"
        public $Email =>
        string(22) "customer@2checkout.com"
        public $Address1 =>
        string(12) "Test Address"
        public $Address2 =>
        NULL
        public $City =>
        string(2) "LA"
        public $Zip =>
        string(5) "12345"
        public $CountryCode =>
        string(2) "RO"
        public $State =>
        string(2) "CA"
      }
      public $DeliveryInformation =>
      class stdClass#15 (1) {
        public $ShippingMethod =>
        class stdClass#16 (1) {
          public $Code =>
          string(5) "sdfsd"
        }
      }
      public $PaymentDetails =>
      class stdClass#17 (4) {
        public $Type =>
        string(2) "CC"
        public $Currency =>
        string(3) "EUR"
        public $PaymentMethod =>
        class stdClass#18 (2) {
          public $RecurringEnabled =>
          bool(false)
          public $CardPayment =>
          class stdClass#19 (1) {
            public $InstallmentsNumber =>
            string(2) "23"
          }
        }
        public $CustomerIP =>
        string(7) "1.2.3.4"
      }
      public $Promotions =>
      array(1) {
        [0] =>
        string(0) ""
      }
    }
  }
  public $Pagination =>
  class stdClass#20 (3) {
    public $Page =>
    int(1)
    public $Limit =>
    int(200)
    public $Count =>
    int(1)
  }
}

Launch new online revenue streams, fast

Do you have a blueprint for selling online? Most companies recognize the need to transition from selling products to services but struggle with how to strategize, execute and successfully roll out the change within their organizations.

HP Software and IDC Research discussed about

  • What is Digital Commerce, and Why is it growing so fast?
  • What challenges can you expect when you transition to SaaS?
  • How to identify all the elements needed for a global approach to online sales

Watch our interactive session that combines an analyst perspective with the real-world experience of an enterprise software leader, and walk away with insights that you can apply immediately.

Join Our Webinar

 

Update upsell settings

Overview

Use the updateDisplayType method to change the upselling display type for your campaigns between the values "overlay" or "interstitial".  

Request parameters

Parameter name Type Required/Optional Description
sessionID String Required 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.
UpsellingDisplayType String Required Change upselling display type for your campaigns between the values "overlay" or "interstitial".

Response

The updateDisplayType method will return the  UpsellingDisplayType value after update.

Request sample

<?php

        require ('PATH_TO_AUTH');

        $request    = new stdClass();
        $request->Name  = "Updated proposal name";

        $jsonRpcRequest = new stdClass();
        $jsonRpcRequest->jsonrpc = '2.0';
        $jsonRpcRequest->method = 'updateDisplayType';
        $jsonRpcRequest->params = array($sessionID, $request);
        $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;
        }

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