Skip to main content

Remove product coupon

Overview

Use this method to remove discount coupons applied to products added to cart.

Requirements

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, which is the output of the Login method. An exception is thrown if the values are incorrect
coupon Required (String)
  The coupon/voucher code for a promotion impacting a product added to cart.

Response

Parameters Type/Description
result Boolean
  True or false

Request

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication
require ('PATH_TO_SET_PARTNER'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/Partner/00Set_partner
require ('PATH_TO_ADD_PRODUCT'); // addProduct example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/08Place_an_order/00Add_product_to_cart
require ('PATH_TO_ADD_COUPON'); // addCoupon example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/08Place_an_order/06Add_product_coupon

$couponCode = 'COUPON_CODE_TO_REMOVE';

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

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

Errors

Error Description

EMPTY_CART

The shopping cart is empty

INVALID_COUPON_CODE

The coupon code is empty

INVALID_COUPON

The coupon code is not applied to cart

 

Retrieve wire transfer details

Overview

Retrieve the wire payment details that partners need to use to pay for partner invoices.

Requirements

Next, use setProforma to identify a specific partner invoice.

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier string, output of the Login method. An exception is thrown if the values are incorrect.
refNo Required (String)
  Order reference number of an order that was marked with WIRE as payment method.

Response

Parameters Type/Description

WirePaymentDetails

Object

 

Details below

 

Amount

Double

 

 

The total costs incurred by the partner for a partner invoice invoice.

 

Currency

String

 

 

Order currency ISO code - ISO 4217.

 

PaymentReference

String

 

 

Transaction identifier.

 

RoutingNumber

String

 

 

Identification number assigned to financial institutions.

 

BankAccounts

Array of objects

 

 

Array of BankAccountDetails objects with the structure detailed below. Can be NULL.

 

 

Beneficiary

String

 

 

 

Payment beneficiary name. Can be NULL.

 

 

BankName

String

 

 

 

Beneficiary bank name. Can be NULL.

 

 

BankCountry

String

 

 

 

Beneficiary bank country. Can be NULL.

 

 

BankCity

String

 

 

 

Beneficiary bank city. Can be NULL.

 

 

BankAddress

String

 

 

 

Beneficiary bank address. Can be NULL.

 

 

BankAccount

String

 

 

 

Beneficiary bank account number. Can be NULL.

 

 

BankAccountIban

String

 

 

 

Beneficiary IBAN. Can be NULL.

 

 

BankAccountSwiftCode

String

 

 

 

Beneficiary SWIFT code. Can be NULL.

 

 

Currency

String

 

 

 

Bank account currency ISO code – ISO 4217. Can be NULL.

Request

<?php

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

$proformaNumber = 'YOUR_PROFORMA_NUMBER';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setProforma',
'params' => array($sessionID, $proformaNumber)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

$paymentDetails = new stdClass();
$paymentDetails->Type = 'WIRE';
$paymentDetails->Curency = 'USD';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setPaymentDetails',
'params' => array($sessionID, $paymentDetails)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

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

$refNo = 'YOUR_ORDER_REFERENCE_NUMBER';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getWirePaymentDetails',
'params' => array($sessionID, $refNo)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

 

Errors

Error Description

INVALID_PARTNER

No partner is set.

PAYMENT_PROFORMA

You have to set a partner invoice first.

PAYMENT_NOT_SUPPORTED

The current partner invoice is not set as payable through wire.

 

Retrieve check payment details

Overview

Retrieve the check payment details that customers must use or have used to pay for an order.

Requirements

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier string, output of the Login method. An exception is thrown if the values are incorrect.
refNo Required (String)
  Order reference number of an order that was marked with CHECK as payment method.

Response

Parameter Type/Description

CheckPaymentDetails

Object

 

Details below

 

Beneficiary

String

 

 

Payment beneficiary name. Can be NULL.

 

CheckPostalAddress

String

 

 

Beneficiary address. Can be NULL.

 

CheckAccountHolderName

String

 

 

Beneficiary account holder name. Can be NULL.

 

Country

String

 

 

Beneficiary country. Can be NULL.

 

Amount

Double

 

 

Total order costs. Can be NULL.

 

Currency

String

 

 

Order currency ISO code – ISO 4217. Can be NULL.

Request

<?php

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

$proformaNumber = 'YOUR_PROFORMA_NUMBER';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setProforma',
'params' => array($sessionID, $proformaNumber)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

$paymentDetails = new stdClass();
$paymentDetails->Type = 'CHECK';
$paymentDetails->Curency = 'USD';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setPaymentDetails',
'params' => array($sessionID, $paymentDetails)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

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

$refNo = 'YOUR_ORDER_REFERENCE_NUMBER';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getCheckPaymentDetails',
'params' => array($sessionID, $refNo)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

Errors

Error Description

INVALID_PARTNER

No partner is set.

PAYMENT_PROFORMA

You have to set a partner invoice first.

PAYMENT_NOT_SUPPORTED

The current partner invoice is not set as payable through check.

Retrieve an additional field

Overview

Use the getAdditionalField method to extract information about a specific additional field you set up for your account.

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.

fieldCode

Required (string)

 

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

Response

Parameters Type/Description

AdditionalField

Array of objects

Request

<?php
 
require ('PATH_TO_AUTH');

$FieldCode = 'YOUR_FIELD_CODE';
 
try {
    $AdditionalField = $client->getAdditionalField($sessionID, $FieldCode);
}

catch (SoapFault $e) {
    echo "AdditionalField: " . $e->getMessage();
    exit;
}

var_dump("AdditionalField", $AdditionalField);


?> 

Google Tag Manager Code Integration for Default Flows – Universal Analytics

Overview

The Google Tag Manager (GTM) is a small piece of JavaScript and non-JavaScript code (a container snippet) that you paste into your pages to configure or enable tags from Google Universal Analytics or third parties. For more information on the Google Tag Manager and how to install it, click here.

   This documentation refers to Google Universal Analytics, which is a deprecated version that will be sunset starting July 1st 2023 for free Universal Analytics properties and starting July 1st 2024 for 360 Universal Analytics properties. We strongly recommend you to migrate to Google Analytics 4 as soon as possible.

Setting the Google Tag Manager (GTM)

To implement Google Tag Manager on your website, follow these steps:

  1. Log into your 2Checkout Merchant Control Panel.
  2. Navigate to Setup → Interface templates.
  3. Click to Edit the template that needs to be tracked. An example is shown in the image below:

web analytics in Merchant Control Panel_4.png

4. In the Head Information area → Meta & CSS, paste the Google Tag Manager code for your account at the end of the existing code in the section. An example of the Google Tag Manager code is shown below:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->

Example of GTM code for the <body> tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

The GTM code needs to be placed on your own website as well – one snippet of code in the <head> and the other in the <body> tag, if this step has not already been done previously. See the image below for a screenshot of an example code that needs to be added to your own website. More information can be found on this page: https://developers.google.com/tag-manager/quickstart.

Install GTM

Sending MyOrder Data to Google Universal Analytics

By default, the myOrder object is displayed only for orders with payments authorized instantly (this includes usually credit cards and PayPal), after the payment is complete (transaction needs to be authorized successfully). To have the myOrder object available for all placed orders regardless of the payment status (to send revenue to Google Universal Analytics based on myOrder.TotalPrice, to more offline payment methods orders), follow the steps below:

  1. Log in to your Merchant Control Panel account.
  2. Go to Setup → Ordering Options.
  3. Scroll down to the After sale message area and check the checkbox for the Show message for all placed orders option.

web analytics in Merchant Control Panel_2.png

3. Click Save settings at the bottom of the page.

A JavaScript object called myOrder is available on the ‘Thank you’ page providing information about the purchased products including ID, quantity, name, price, etc.

To see information about orders in Google Universal Analytics, follow these steps:

  1. Log in to your Merchant Control Panel account.
  2. Navigate to Setup → Ordering Options and click on the Analytics tab.

web analytics in Merchant Control Panel_1.png

3. Scroll down to the Tracking script section and add a code snippet (for example add <div></div>).

4. Apply the code to all languages or to the languages for which you want your template to be tracked.

5. Click Save at the bottom of the page.

web analytics in Merchant Control Panel_3.png

Google Tag Manager Configuration

How to configure Google Tag Manager for your own website

1. The Google Analytics - Universal Analytics tag for your own website (ex. www.mywebsite.com) should look as shown in the below image.

GAtag.png

2. This Google Universal Analytics tag for your own website must have Page View selected as Track Type.

tagconfig.png

The variable for the Google Universal Analytics tag should be configured as follows: in the Tracking ID section in the Google Universal Analytics Settings area, add the tracking ID of your own Google Analytics property.

If you don’t know the Google Universal Analytics property ID, you can find it here.

GA settings.png

If you use your own custom domain for the shopping cart, then proceed to step 4.

If you use the 2checkout shopping cart (secure.2checkout.com), further implementation for the cross-domain tracking is needed. In this case, you (merchant) need to proceed to step 2 to count the visitors that first go to your website, and then to secure.2checkout.com as the same visitors in Google Analytics.

3. If you need further implementation for the cross-domain tracking, follow the additional setup needed for the Google Universal Analytics variable. In the More Settings section, under Fields to set, click Add Field. You will see two fields that need to be filled in.  In the first field, enter “cookieDomain” as Field Name, and “auto” as Value. In the second field, enter “allowLinker” as Field Name, and “true” as value. In the section Cross Domain Tracking, in the field Auto Link Domains, enter “secure.2checkout.com” and in the Use Hash as Delimiter field enter “False”, and in the Decorate Forms enter “True”.

adfield.png

4. The triggering for this tag is All Pages.

triggering.png

Implementing Google Universal Analytics with Google Tag Manager for 2Checkout

1. Besides the Google Universal Analytics tag for your own website, create a Google Universal Analytics tag for 2Checkout, as shown in the image below.

tags.png

2. Name this new tag “2Checkout Google Analytics” to differentiate it from your own Google Universal Analytics website tag. Select Event as Track Type and 2Checkout as Category. Select Google Analytics - Universal Analytics Settings and click Enable overriding settings in this tag.

2checkout GA settings.png

3. Under More Settings, select True for Ecommerce and click Use Data Layer. As Tag Firing Options select Once per event, as shown in the below image.

selectUsedataLayer.png

4. In the Trigger Configuration area, create a trigger named 2Checkout Event, with a Custom Event trigger type. Write 2checkout event in the Event name field (this is case sensitive for Google Universal Analytics) and select All Custom Events for when to fire the trigger, as indicated in the following image.2checkout events.png

5. The last step is to Save and Publish all the changes made.

Additional order fields

Overview

Use this object to create / update information on additional order/product fields. 

Parameters

AdditionalField Object

Label

String

 

Field text.

Code

String

 

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

Type

String

 

Field type:

  • LISTBOX
  • CHECKBOX
  • TEXT
  • 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.

               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).

 

 

 

Set an external reference

Overview

Use the setExternalRef method in conjunction with setSubscriptionUpgrade.

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.

externalRef

Required (string)

 

External reference you control.

Response

Parameters Type/Description

Boolean

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

Request

<?php

require ('PATH_TO_AUTH');

$externalReference = 'YOUR_EXTERNAL_REFERENCE';

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

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

ProductInfo Object Structure

Parameters

Parameter Type/Description
SimpleProduct Object
  Product object with the structure detailed below.
                                                            LongDescription           

String/Optional

 

The product's long description.

                                                            SystemRequirements

String

 

Localized system requirements.

                                                            Platforms

Array of Platform objects/Optional

 

An array of objects detailing the platforms supported by the application. 

                                                            URLImage

String

 

The location of the image in the 2Checkout system.

                                                            TrialURL

String

 

The trial URL for users speaking the language corresponding to the Translation object.

                                                            TrialDescription

String/Optional

 

Descriptive text entered for trials.

                                                            AdditionalInfo

NULL

 

Additional information about the product.

                                                           RenewalProductID

Int

 

The product renewal ID.

                                                           ProductId

String

 

Unique, system-generated product ID.

                                                           ProductCode

String

 

Editable product code that you control.

                                                           ProductName

String

 

Editable product name.

                                                           ProductVersion

String/Optional

 

The product version number.

                                                           ProductStatus

Boolean

 

The status of the product. Enabled if TRUE, disabled if FALSE.

                                                           ProductType

String/Optional

 

REGULAR or BUNDLE

Defaults to REGULAR.

                                                           Currency

String

 

The currency ISO code used for shipping costs - ISO 4217.

                                                           DefaultCurrency

String

 

The ISO code of the default currency for the pricing configuration.

                                                           Price

String

 

The product price.

                                                           GiftOption

Boolean/Optional

 

TRUE or FALSE depending on whether the product can be gifted or not.

                                                           IdGroup

String

 

The ID of the product group.

                                                           GroupName

String/Optional

 

The name of the Product Group to which the product belongs.

                                                           ShortDescription

String/Optional

 

The product's short description.

                                                           ProductImage

NULL

 

Image object. 

                                                           Languages

Array

 

An array of objects detailing the languages supported by the application.

                                                           PriceIntervals

NULL

 

 

                                                           PriceType

String

 

Possible values:  NET/GROSS.

                                                           PriceSchema

String

 

DYNAMIC

                                                           PriceOptions

Array of AssignedPriceOptionGroup objects

 

PriceOptionsGroupItem object with the structure detailed below.

  Id

String

 

Price option identifier.

  Name

String

 

Pricing configuration name.

  Description

String

 

Description of the pricing option.

  Required

Boolean

 

TRUE or FALSE depending on whether the assigned product field is required or not.

  Type

String

 

The type of pricing option.

  Options

Array of strings

 

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

 

Implement Google Universal Analytics in ConvertPlus and InLine Checkout (without GTM)

Overview 

You can implement Google Universal Analytics without the Google Tag Manager (GTM) to help you track and monitor your ConvertPlus and InLine checkout orders in order to improve the shopping experience and increase conversion rate.

   This documentation refers to Google Universal Analytics, which is a deprecated version that will be sunset starting July 1st 2023 for free Universal Analytics properties and starting July 1st 2024 for 360 Universal Analytics properties. We strongly recommend you to migrate to Google Analytics 4 as soon as possible.

Availability 

Google Universal Analytics can be set for all 2Checkout accounts.

Implement Google Universal Analytics in ConvertPlus and InLine Checkout

Follow these steps to implement Google Universal Analytics in ConvertPlus and InLine Checkout:

1. Navigate to your Google Universal Analytics account.

2. Copy your Google Universal Analytics Tracking ID and use it in your 2Checkout Merchant Control Panel to set up Google Universal Analytics for your ConvertPlus and InLine carts.

3. To get your Google Universal Analytics Tracking ID, go to Google Universal Analytics → Admin → Tracking Info → Tracking Code. Under Tracking ID you will find the code you need to copy and paste into your Merchant Control Panel.

google analytics without GTM.png

4. In your Google Universal Analytics account, make sure you have Enhanced Ecommerce enabled. To enable it, navigate to Admin → View Settings → Ecommerce settings. Make sure the Enable Ecommerce & Enable Enhanced Ecommerce Reporting settings are both ON.

google analytics without GTM_1.png

5. In your Google Universal Analytics account, make sure you exclude the 2Checkout domains from the referral list. Go to Admin → Admin → Property settings → Tracking info → Referral Exclusion List.

6. Add your website’s domain and the following 2Checkout domains: secure.2checkout.com and tracking.avangate.net.

google analytics without GTM_2.png

Cross-domain tracking settings

For cross-domain tracking between your website and the 2Checkout shopping cart, additional settings are needed. The Google Analytics JavaScript tracking code on your own website must be updated to include a linker to the 2Checkout domains: secure.2checkout.com and tracking.avangate.net. 

Below you have an example of the Google Universal Analytics tracking script for gtag.js. 2Checkout Google Universal Analytics tracking implementation is based on gtag.js.

The part highlighted in yellow represents the cross-domain tracking setting that needs to be added to the Google Universal Analytics script on your website. 

GA_MEASUREMENT_ID from the Google Universal Analytics script below is the Google Universal Analytics Tracking ID, which you can find under Google Universal Analytics → Admin → Tracking Info → Tracking Code section

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gta...MEASUREMENT_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());  
  gtag('config', 'GA_MEASUREMENT_ID', {
     'linker': {
            'domains': ['secure.2checkout.com', 'tracking.avangate.net']
        }
    });

</script>

Merchant Control Panel Settings

The Analytics section in your Merchant Control Panel allows you to integrate Google Universal Analytics in the ConvertPlus or InLine ordering engines and thus track the behavior of your shoppers on the 2Checkout pages.

Follow these steps to complete your analytics integration:

  1. Log into your Merchant Control Panel.
  2. Navigate to Setup → Ordering options.
  3. Click on the Analytics tab.
  4. Click on the ConvertPlus and InLine Checkout tab.

web analytics in Merchant Control Panel_5.png

5. In the Google Universal Analytics box, click on Set up. 

Google Universal Analytics without GTM - Set up

6. Fill in the Google Universal Analytics Tracking ID (Here is how you obtain itand click Save.

ConvertPlus & Inline Checkout Google Universal Analytics Tracking ID

7. Complete the integration by using the slider to activate Google Universal Analytics.

ConvertPlus & Inline Checkout Activate Google Universal Analytics

1. The 2Checkout data layer for Google Universal Analytics tracking is placed in an iFrame. This data layer contains eCommerce information built on the structure required by Google Universal Analytics reporting for the following events : checkout, purchase and remove from cart.

2. For fully enhanced eCommerce reporting in Google Universal Analytics, it is recommended that you send information to Google Universal Analytics from your website that includes product impression, product detail and add to cart. More information on enhanced eCommerce reporting can be found here: https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce.

Pricing strategies for software, IoT and digital goods

With every industry going digital, it's clear that value has shifted from hardware to software and services. As new digital goods and services emerge - Internet of Things for example - digital marketers are facing an ever-changing set of monetization challenges aimed at building long-term, recurring revenue relationships.

Join featured guest speakers Amy Konary at IDC Research and Omkar Munipalle, Director, Cloud Strategy and Business.

Development at Gemalto (formerly SafeNet) in a 2Checkout thought-leading webinar that will explore:

  • The evolving role of software in a digital business
  • Understand new pricing & licensing models - subscriptions, consumption-based, outcome-based
  • Linking customer experience with software monetization
  • How to overcome constraints that prevent seamless digital commerce
Join Our Webinar

 

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