Skip to main content

Cross-sell

Overview

Use this section to retrieve information about the cross-sell campaigns configured on your account.

 

Order field

Overview

Use this object to retrieve information about additional order/product fields. 

Parameters

Parameters Type/Description

AdditionalField

Object

Label

String

 

Field text.

Code

String

 

Field identifier. Alpha-numeric chars, underscores and dashes.

Type

String

 

Field type:

  • LISTBOX
  • CHECKBOX
  • TEXTBOX
  • HIDDEN

ApplyTo

Sting

 

  • ORDER
  • PRODUCT

Values

Array of values

 

Custom values you control.

ValidationRule

String

 

The validation rule restricting the type of information shoppers can enter in the additional field during the purchase process.

Translations

Array of objects

 

Details below.

Translation

Object

Label

String

 

Field text translated in the language of the Translations object.

Values

Object

 

Custom values you control translated in the language of the Translations object.

Language

String

 

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

 

 

Search partners

Overview

Search partners using their company name or contact email. If a generic string is provided, the system searches for matches in company names and contact emails for all your partners.

Parameters

Parameters Type/Description
sessionID Required (string)
  Session identifier, output by the Login method. An exception will be thrown if the values are incorrect.
searchString Required (string)
  Can be either the company name or contact email of the partner. The system searches generic strings in both the names of the companies as well as the contact email addresses.

Response

Parameters Type/Description
Partner Array of objects

Request

<?php
require ('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication 

$searchString = "YOUR_SEARCH_STRING";

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

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

Errors

Error Description

INVALID_SEARCH

Invalid value. Please use a string to search.

 

Set the cart currency for InLine Cart

Overview

Use the Cart object to set the currency of the InLine Cart by calling theTwoCoInlineCart.cart.setCurrency(currency-code)method.

Use case

  1. Add an HTML link or button in your page like the one below.
  2. Create a JavaScript click handler to execute the Inline Client desired methods.
  3. Use theTwoCoInlineCart.products.add({code, quantity, options})method to prepare your catalog product.
  4. In order to set the currency use theTwoCoInlineCart.cart.setCurrency('RON')method.
  5. Use theTwoCoInlineCart.cart.checkout()method to show the cart on your page.

Sample request

HTML

<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>

JavaScript

window.document.getElementById('buy-button').addEventListener('click', function() {
  TwoCoInlineCart.products.add({
    code: "74B8E17CC0"
  });
  TwoCoInlineCart.cart.setCurrency('GBP');
  TwoCoInlineCart.cart.checkout();
});

Demo

After setting the cart currency using the above method, your cart should look like this:

See more details on the 2Checkout order interface currencies and their symbols here.

Promotions

Overview

Use the Promotion object via SOAP API 3.0 to retrieve information on discounts/promotions you set up for your account.

Parameters

Parameters Type/Description

Promotion

Object

CouponCodes

Array of strings

 

Array of coupon/Voucher codes when Coupon / Voucher type is Multiple. Otherwise, empty array.

ChannelType

String

 

Possible values:

  • ECOMMERCE
  • CHANNEL_MANAGER
  • ALL

CouponType

String

 

Possible values:

  • SINGLE
  • MULTIPLE

DiscountType

String

 

Possible values:

  • FIXED
  • PERCENT

Type

String

 

REGULAR

Discount

Int

 

The value of the discount. Example, for a $30 USD discount Avangate returns the value 30 and for a 25% price cut, Avangate returns 25.

Products

Array

 

Array of product codes for the products impacted by the promotion.

Name

String

 

Promotion name

Description

String

 

Promotion description

StartDate

String

 

Starting date. The date when you set the promotion to start. Is NULL for promotions that start immediately after they're created.

EndDate

String

 

Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely.

MaximumOrdersNumber

Int

 

When the maximum number of orders is reached the promotion stops. Can be NULL if you want the promotion to apply to an unlimited number of orders.

MaximumQuantity

Int

 

Discount only applies to a specific number of product, smaller than the maximum quantity you defined. Can be NULL if you want the promotion to apply to an unlimited number units. Any extra quantity added to the cart will be sold at full price.

InstantDiscount

Boolean

 

Selecting the instant discount option will auto-apply the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon.

Coupon

String

 

The promotion coupon/voucher you’re extracting information for.

DiscountLabel

String

 

Discounts can be set as a percentage from the product price or as a fixed amount in the chosen currenc

Enabled

Boolean

 

TRUE

FALSE

Currency

String

 

Currency code available for the default currency of FIXED promotions. Missing for PERCENT promotions.

Code

String

 

Unique, system-generated identifier Avangate associates with promotion campaigns.

PriceThreshold

Object

 

Limits discount use only when total order value (taxes included) exceeds the threshold you configure.

 

Amount

 Decimal

 

 

The minimum threshold you defined for the default currency.

 

Currency

String

 

 

Currency code available for the default currency of custom threshold settings.

 

 

Promotions

Overview

Use the Promotion object to create/update and update information on discounts/promotions you set up for your account.

Parameters

Parameters Type/Description

Promotion

Object

 

Name

String  / Required

 

 

Promotion name

 

Description

String  / Optional

 

 

Promotion description

 

StartDate

String  / Optional

 

 

Starting date. The date when you set the promotion to start. Is NULL for promotions that start immediately after they're created.

Format: Y-m-d

 

EndDate

String  / Optional

 

 

Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely.

Format: Y-m-d

 

MaximumOrdersNumber

Integer / Optional

 

 

2Checkout stops offering the discount when the promotion reaches the maximum number of orders. Can be NULL if you want the promotion to apply to an unlimited number of orders.

 

MaximumQuantity

Integer / Optional

 

 

Discount only applies to a specific number of products, smaller than the maximum quantity you defined. Can be NULL if you want the promotion to apply to an unlimited number of units. Any extra quantity added to the cart will be sold at full price.

 

InstantDiscount

Boolean / Optional

 

 

Selecting the instant discount option will auto-apply the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon.

Coupon

Object / Required

 

Type

String  

 

 

  • SINGLE = one coupon code-shared by all shoppers
  • MULTIPLE = array of unique coupon codes, each designed for individual use

 

Code/Codes

Array of strings 

 

 

Varies according to type. Send:

  • Code = 'single_code'; when Type = 'SINGLE';
  • Codes = ['code1', 'code2']; when Type = 'MULTIPLE';

Enabled

Bolean / Optional

 

Possible values:

  • TRUE - promotion is active.
  • FALSE - promotion is inactive

ChannelType

String / Required

 

Possible values:

  • ECOMMERCE
  • CHANNEL_MANAGER
  • ALL

Type

String / Required

 

REGULAR

Discount

Object / Required

 

Type

String 

 

 

Discount type:

  • PERCENT, use in combination with Value
  • FIXED, use in combination with Values and DefaultCurrency

 

Value / Values

Array of objects

 

 

  • Value = Int, determines the discount percentage from 0 to 100
  • Values = Array of Value objects

 

 

Value

Object 

 

 

         Currency

String 

 

 

 

 

ISO currency code

 

 

          Amount

Integer 

 

 

 

 

Discount amount in the corresponding currency.

 

DefaultCurrency

String 

 

 

ISO code

Products

Object/ Optional

 

Code

Integer/ Optional

 

 

Unique product code that you control.

 

PricingConfigurationCode

String / Optional

 

 

Unique system generated pricing configuration code.

 

PricingOptionCodes

Array of strings / Optional

 

 

Array of pricing option codes controlled by you.

PriceThreshold

Object / Optional

 

Limits discount use only when total order value (taxes included) exceeds the threshold you configure.

 

Amount

Decimal / Optional

 

 

The minimum threshold you defined for the default currency.

 

Currency

String / Optional

 

 

Currency code available for the default currency of custom threshold settings.

Translations

Array of objects / Optional

 

PromotionTranslation

Object / Optional

 

 

Name

String / Optional

 

 

 

Localized name corresponding to translated language.

Name: Le product

Language: FR

 

 

Language

String / Optional

 

 

 

Language for localization.

Sources

StringArray / Optional

 

Array of strings defining the sale source through the SRC parameter.

PublishToAffiliatesNetwork

Integer / Optional

 

1 - make promotion available in the Affiliates Network

0 - keep promotion unavailable for the Affiliates Network

ApplyRecurring

String / Required

 

Choose whether to apply the discount to renewal orders. Possible values:

  • NONE
  • ALL
  • CUSTOM

RecurringChargesNumber

Integer / Optional

 

If ApplyRecurring is set to CUSTOM, you can offer discounts for a number of recurring billing charges beyond the initial purchase.

 

 

Search SKU codes

Overview

Use the searchSku method to perform product SKU search calls with the below parameters.

Request Parameters

Parameters Required Type Description
ProductCode Required String The product code that you can define for each of your offerings. Needs to be unique.
PricingConfigurations Required Array of objects  

Code

Required String  

Currencies

Required Array of Objects ISO currency code.

Code

Required String  

PurchaseTypes

Required Array of objects Purchase type identifier. Possible values:
  • NEW_PRODUCT
  • RENEWAL
  • UPGRADE

Code

Required String  

QuantityIntervals

Required Object Numeric identifier of product quantity.

MinQuantity

Required Int  

MaxQuantity

Required Int  

PriceOptionGroups

Required Array of objects  

Code

Required String  

Options

Required Array of objects  

OptionValue

Required String  
Pagination Required Object  

Page

Required Int  

Limit

Required Int  

Request Example

<?php

require ('PATH_TO_AUTH');

$inputSchema = new \stdClass();
$inputSchema->ProductCode= '6B3CB17DDA_COPY1';

$pricingConfiguration = new \stdClass();
$pricingConfiguration->Code = 'E684EC99B0';

$currency = new \stdClass();
$currency->Code = 'EUR';
$pricingConfiguration->Currencies = [$currency];

$purchaseType = new \stdClass();
$purchaseType->Code = 'RENEWAL';
$pricingConfiguration->PurchaseTypes = [$purchaseType];

$quantityIntervals = new \stdClass();
$quantityIntervals->MinQuantity= 1;
$quantityIntervals->MaxQuantity= 10;
$pricingConfiguration->QuantityIntervals = [$quantityIntervals];

$pagination = new \stdClass();
$pagination->Page = 1;
$pagination->Limit = 10;

$inputSchema->PricingConfigurations = [$pricingConfiguration];
$inputSchema->Pagination = $pagination;


try {
    $skuData = $client->searchSku($sessionID, $inputSchema);
} catch (SoapFault $e) {
    echo "searchSku: " . $e->getMessage();
    exit;
}

var_dump("searchSku", $skuData);

Response Parameters

Parameters Type/Description
Items Object

{ProductCode}

Object. This element will be replaced by the code of the product.

SkuPricingOptions

Array of strings

Code

String

Details

Array

ProductSKU

String

Currency

String

FromQty

Int

ToQty

Int

PurchaseTypes

String

Groups

Array

GroupCode

String

Options

Array

               Name

String
                                                                                Value String

Errors

Array
Pagination Object

Limit

Int

Page

Int

Count

Int

Response Example

object(stdClass)#22 (2) {
    public $Items" =>
    object(stdClass)#21 (1) {
      public $6B3CB17DDA_COPY1 =>
      object(stdClass)#4 (2) {
        public $ProductCode =>
        string(18) "6B3CB17DDA_COPY1"
        public $SkuPricingOptions =>
        array(1) {
          [0]=>
          object(stdClass)#5 (3) {
            public $Code =>
            string(10) "E684EC99B0"
            public $Details =>
            array(5) {
              [0]=>
              object(stdClass)#6 (7) {
                public $ProductSKU =>
                string(4) "Product_Test_SKU_008899"
                public $Currency =>
                string(4) "EUR"
                public $FromQty =>
                int(1)
                public $ToQty =>
                int(10)
                public $PurchaseType =>
                string(11) "RENEWAL"
                public $Groups =>
                array(1) {
                  [0]=>
                  object(stdClass)#7 (2) {
                    public $GroupCode =>
                    string(7) "GRUP_2"
                    public $Options =>
                    array(1) {
                      [0]=>
                      object(stdClass)#8 (2) {
                        public $Name =>
                        string(7) "grup 2"
                        public $Value =>
                        string(4) "option_code_4"
                      }
                    }
                  }
                }
                public $Options =>
                string(32) "a:1:{i:16885;a:1:{i:0;i:78164;}}"
              }
              [1]=>
              object(stdClass)#9 (7) {
                public $ProductSKU =>
                string(4) "Product_Test_SKU_008902"
                public $Currency =>
                string(4) "EUR"
                public $FromQty =>
                int(1)
                public $ToQty =>
                int(10)
                public $PurchaseType =>
                string(11) "RENEWAL"
                public $Groups =>
                array(1) {
                  [0]=>
                  object(stdClass)#10 (2) {
                    public $GroupCode =>
                    string(7) "GRUP_2"
                    public $Options =>
                    array(1) {
                      [0]=>
                      object(stdClass)#11 (2) {
                        public $Name =>
                        string(6) "grup 2"
                        public $Value =>
                        string(13) "option_code_4"
                      }
                    }
                  }
                }
                public $Options =>
                string(6) "a:0:{}"
              }
            public $Errors =>
            array(0) {
            }
          }
        }
      }
    }
    public $Pagination =>
    object(stdClass)#23 (3) {
      public $Limit =>
      int(10)
      public $Page =>
      int(1)
      public $Count =>
      int(5)
    }

Do conversion optimization like the pros

Your web visitors are your most valuable marketing asset. Are you wasting precious traffic with the wrong conversion optimization strategy?

Most companies start their conversion optimization on the wrong footing. They unknowingly adopt so-called 'best practices' that haven't been properly tested. If you don't have a proven A/B testing process, you could be making big marketing mistakes and not know it.

Learn how to get the best CRO results from WiderFunnel's thousands of experiments on hundreds of websites.

In this webinar, you'll learn:

  • A proven process for optimizing any marketing touchpoint
  • The six factors that are hurting your conversion rate right now - and how to fix them
  • The one best way to discover what motivates your customer to buy from you
  • Surprising A/B test results from leading optimizing companies
Join Our Webinar

 

Delete SKU codes

Overview

Use the deleteSku method to remove product SKU codes through an API call using the below parameters.

Request Parameters

Parameters Required Type/Description
ProductCode Required String. The product code that you can define for each of your offerings. Needs to be unique.
PriceConfigurations Required String.
PriceConfigurationCode Required String. Unique identifier of the pricing configuration.
SkuCode Required String. Unique identifier of the SKU schema.

Request Example

<?php

require ('PATH_TO_AUTH');

$product = new \stdClass();
$product->ProductCode= '6B3CB17DDA_COPY1';

$pricingConfiguration = new \stdClass();
$pricingConfiguration->PriceConfigurationCode = 'E684EC99B0';
$pricingConfiguration->SKUs = ['Product_Test_SKU_001050', 'Product_Test_SKU_001053'];

$product->PriceConfigurations = [$pricingConfiguration];


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

var_dump("deleteSku", $skuOutput);

Response Parameters

Parameters Type/Description
ProductCode String
PriceConfigurations String
PriceConfigurationCode String

Response Example

array(1) {
  [0] =>
  class stdClass#5 (4) {
    public $ProductCode =>
    string(16) "6B3CB17DDA_COPY1"
    public $PriceConfigurations =>
    array(1) {
      [0] =>
      class stdClass#6 (3) {
        public $PriceConfigurationCode =>
        string(10) "E684EC99B0"
        public $SKUs =>
        array(2) {
          [0] =>
          string(23) "Product_Test_SKU_001050"
          [1] =>
          string(23) "Product_Test_SKU_001053"
        }
        public $Errors =>
        array(0) {
        }
      }
    }
    public $SKUs =>
    array(0) {
    }
    public $Errors =>
    array(0) {
    }
  }
}

Search proposals

Overview

Use the searchProposals method via JSON-RPC APIv6 to find a specific proposal or quote.

Request parameters

Request parameters for the searchProposal method via JSON-RPC APIv6
Parameters Type Required/Optional Description
sessionId String Required Unique 2Checkout session ID code.
Name String Optional Proposal name.
Email String Optional The bill to or sell to email.
CreatedBy String Optional The unique external system user identifier.
ModifiedBy String Optional The unique external system user identifier.
Source String Optional The source from where the proposal was created.
CreatedAfter String Optional The UTC date and time in ISO 8601 format.
CreatedBefore String Optional The UTC date and time in ISO 8601 format.
ModifiedAfter String Optional The UTC date and time in ISO 8601 format.
ModifiedBefore String Optional The UTC date and time in ISO 8601 format.
Locked Boolean Optional

Retrieve proposals that are locked or not.

Possible values:

  • True
  • False
Offset Integer Required The offset at which the proposals should be returned. Default value: 0.
Limit Integer Required The maximum number of proposals to return. Default value: 10.
LinkId String Optional The link id for any status.

Request sample

<?php

require ('PATH_TO_AUTH');

$searchParameters = new stdClass();
$searchParameters->Name = "My Proposal Name";
$searchParameters->Email = "example@email.com";
$searchParameters->CreatedBy = "createUser";
$searchParameters->ModifiedBy = "modifyUser";
$searchParameters->Source = "MERCHANT_API";
$searchParameters->CreatedAfter = "2020-01-01T00:00:00+00:00";
$searchParameters->CreatedBefore = "2020-12-31T23:59:59+00:00";
$searchParameters->ModifiedAfter = "2020-01-01T00:00:00+00:00";
$searchParameters->ModifiedBefore = "2020-12-31T23:59:59+00:00";
$searchParameters->Locked = false;
$searchParameters->Offset = 0;
$searchParameters->Limit = 10;

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

try {
    $result = callRPC($jsonRpcRequest, $host);
    echo "Proposal: </br>", 
    var_dump($result);
}
catch (SoapFault $e) {
    echo "Could not fetch proposal: " . $e->getMessage();
    exit;
}

Response

The searchProposals call via JSON-RPC APIv6 returns a list of proposal objects.

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