Skip to main content

Retrieve order status information

Overview

Get information about an existing order.

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.
refNo Required (String)
  The unique, system-generated identifier of a partner order.

Response

Parameters Type/Description
Order Object

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

$refNo = 'YOUR_ORDER_REFERENCE'

try {
    $Order= $client->getOrderStatus($sessionID, $refNo);
} catch (SoapFault $e) {
    echo "Orderinfo: " . $e->getMessage();
    exit;
}
var_dump ("Orderinfo", $Order);

Errors

Error Description

INVALID_PARTNER

No partner is set.

INVALID_REFERENCE

The provided order reference is invalid.

 

Extend a subscription

Overview

Extend the lifetime of a subscription in the Avangate system on-demand. Use the extendSubscription method to set a new expiration deadline for a subscription.

Parameters

Parameters

Type/Description

sessionID

Required (string)

 

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

SubscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Days

Required (int)

 

Avangate prolongs the lifetime of a subscription using the number of days you send, adding the interval on top of the expiration date.

 

Hint: Use a negative number to reduce the lifetime of a subscription.

 

Cannot be NULL.

Response

Boolean

true or false depending on whether the changes were successful or not.

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;
}
$SubscriptionReferenceTest = '48F5AC7011';
$days = 7;
try {
    $extendedSubscription = $client->extendSubscription($sessionID, $SubscriptionReferenceTest, $days);
}
catch (SoapFault $e) {
    echo "extendedSubscription: " . $e->getMessage();
    exit;
}
var_dump("extendedSubscription", $extendedSubscription);

Additional fields

Overview

This object is returned directly or within a successful response from the following API requests:

  Retrieve an additional field                               Retrieve assigned additional fields                              Retrieve all additional fields    

Additional fields object

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

 

Retrieve pricing list information

Overview

Get the extended info about the pricing list available for a partner, including the products and their pricing options, based on the pricing list code.

Requirements

Parameters

Parameter Type/Description
sessionID Required (string)
  Session identifier, which is the output of the Login method. An exception will be thrown if the values are incorrect
pricingListCode Required (string)
  The unique identifier of the pricing list.

Response

Parameter Type/Description
PricingList Object

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

$pricingListCode = 'YOUR_PRICING_LIST_CODE';

try {
    $PartnerPricingListInfo= $client->getPricingListInformation ($sessionID, $pricingListCode);
} catch (SoapFault $e) {
    echo "PricingLists: " . $e->getMessage();
    exit;
}
var_dump ("PricingLists", $PartnerPricingListInfo);

Error

Error Description
INVALID_PARTNER No partner is set.
PARTNER_PRICING_LISTS_NOT_FOUND There are no pricing lists with provided code.

Retrieve assigned additional fields

Overview

Use the getAssignedAdditionalOrderFields method to extract information about the additional fields assigned to a specific product.

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.

productCode

Required (string)

 

The editable code that you control at product-level, not the unique, system-generated product ID.

Request

<?php

require ('PATH_TO_AUTH');

$productCode = 'YOUR_PRODUCT_CODE';

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

?>

Response

Parameters Type/Description

AdditionalField

Array of objects

Configure shipping methods

Overview

If you plan to offer tangible products via 2Checkout you will need to create at least one shipping method. Read below to learn how you can create a shipping method right from your 2Checkout Merchant Control Panel account.

Create a shipping method

To create a shipping method, follow these steps:

  1. Log in to your Merchant Control Panel account.
  2. Navigate to Setup → Fulfillment, and click on the Shipping methods tab.
  3. In the Add new shipping method area, fill in the following info:
    • Name (mandatory) - This name will be displayed to customers when the shipping method is available for them to select, so you may want to make it fairly descriptive.
    • Tracking URL (optional) - If you will be shipping by a method that will provide tracking numbers, you may want to list the URL at which the tracking numbers may be traced in the Tracking URL field. The URL provided for the shipping method will be included in the shipment confirmation email that can be sent to the customer when the order is marked as shipped.

Click Add to save your shipping method. After saving your work, you are directed to the Edit shipping method page, from where you can perform additional changes.

Countries setup

The Countries section is used to specify what countries a shipping method applies to. Possible configurations are:

  • All Trusted Countries - Ship to all supported countries.
  • Home Country Only - Ship only within your home country.
  • Custom List -  Select specific countries that your shipping method will be used for.
If a buyer is not located within any of the countries for which the shipping method applies, there will be no shipping options available to them during the ordering process.

Example (Custom list): In this example, only 4 countries are added to the shipping method. 

shipping method countries.png

Use the Search bar when looking for countries to add in your shipping method configuration.

Pricing setup

The options in the Pricing section decide how the cost of your shipping method will be calculated. Possible price configurations are:

  • Free - Creates a shipping method with a base price of ’0.00′. The shipping method will show ‘Free’ in the price column at checkout. No weight or order total surcharges can be added to 'Free' shipping methods, however, the handling fee set at product level 'will apply.
  • Priced - Opens more advanced pricing schemes. Use this option to charge a higher shipping fee based on several factors (country, weight, order amount) or a combination of those factors. The handling fee set at the product level will also apply with this method if they are designated for products included in the order.

Advanced pricing setup

If you selected the pricing option 'Priced' you will be presented with a menu for defining the shipping method surcharge.

Enter a Base Price for your shipping method, in your preferred currency. The Base Price will always be charged on shipping methods that are assigned one regardless of any other surcharges set up for the method. 

Fixed shipping fee

If you selected 'Priced' for your pricing scheme, and only fill in a base price, this will be the flat-rate shipping charge that is used to calculate shipping. Your Base Price can be 0.00 but cannot be a negative value.

Example (fixed price): In this example, the shipping method has a fixed price of $10, and is not affected by customer delivery country, product weight or order total.

fixed price _ shipping.png

Surcharge based on the delivery country

To add surcharges based on customer delivery country, mark the Delivery countries checkbox. You will see displayed a list of the countries added in your shipping method, and you have the possibility to define a surcharge for each individual country. The surcharge currency is the one defined for the base price.

Example (surcharge based on country): In this example, each of the 4 countries added in the shipping method has a surcharge assigned. As the base price defined is $0, only the surcharge amount will be displayed to customers as the shipping method fee in the cart.

delivery_shipping.png

Surcharge based on the total weight

To add surcharges based on the total order weight, mark the Total weight checkbox.

To create a new weight threshold click Add surcharge and specify an amount to be charged if the order weight is under or equal to the maximum weight you define. For example, if you create a surcharge for 10 kg at $5 and 20 kg at $10 and the order weighs 8 kg the shipping surcharge will be $5 plus your base price. If the order weight is 11 kg, the surcharge will be $10 plus your base price.

Keep in mind is that our system allows any measurement unit (ex: kilos, ounces, or pounds) so long as all weights are designated in that measurement. Feel free to use your preferred weight measurements so long as you use them globally for your account.

 

Example (surcharge based on weight): In this example, there are 3 weight thresholds set. If the total order weight is lower than 10 kg, the surcharge added is $5.

For a total order weight between 10.01 - 20.00 kg, the surcharge amount added is $10. A total order weight between 20.01 and 30.00 kg will lead to the display of a $15 fee in the cart. According to the setup, we apply a $5 overcharge per additional unit over 30.00 kg. For instance, a total order weight of 31.00 kg will see a surcharge of $20, while a total order weight of 32.00 kg will have a surcharge of $25.

total_weight_shipping.png

Surcharge based on order total amount

To add surcharges based on the total order amount, mark the Order total checkbox. 

To create a new order total threshold click Add surcharge and specify an amount to be charged if the order total is under or equal to the maximum amount you define.

Example (surcharge based on amount): In this example, there are 4 total amount thresholds set. If the total order amount is lower than $10, the surcharge added is $5.

As your customers continue to spend more on their orders, the shipping surcharge decreases, with the final threshold of $1 for orders that are above $30.

order total_shipping.png

 

Add coupon

Overview

Use the addPromotionCoupon method to add single or multiple coupons to a promotion.

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 coupons to.

promotionCoupon

Required (object)

 

type

Required (string)

 

 

Coupon type. Available values:

  • SINGLE, use in conjunction with Code
  • MULTIPLE, use in conjunction with Codes

 

Code/Codes

Required (string / array of strings)

 

 

Coupon code (for SINGLE) or array of coupon codes (for MULTIPLE).

Response

Parameter Type/Description
promotionCoupon Object

Request

<?php

require ('PATH_TO_AUTH');

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

// Define single coupon object
$promotionCoupon = new stdClass;
$promotionCoupon->Type = 'SINGLE';
$promotionCoupon->Code = 'YOUR_CODE_HERE';

// Define multiple coupon object
$promotionCoupon = new stdClass;
$promotionCoupon->Type = 'MULTIPLE';
$promotionCoupon->Codes = ['YOUR_CODE_1', 'YOUR_CODE_2'];

try {
    $updatedPromotion = $client->addPromotionCoupon ($sessionID, $promotionCode, $promotionCoupon);
}

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

var_dump("UpdatedPromotion", $updatedPromotion);

 

Retrieve partner reseller list

Overview

Use this method to retrieve a list of resellers defined and stored for one of your partners.

Requirements

This method requires you to set a specific partner using setPartner.

Parameters

Parameters Type/Description
sessionID Required (string)
  Session identifier, which is the output of the Login method. An exception will be thrown if the values are incorrect.

Response

Parameter Type/Description
Reseller Array of reseller objects.

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

try {
    $Resellers= $client->getPartnerResellers ($sessionID);
} catch (SoapFault $e) {
    Echo "AllResellers: " . $e->getMessage();
    exit;
}
var_dump ("AllResellers ", $Resellers);

Errors

Error Description

NOT_FOUND_PARTNER

Set a partner before calling this method.

 

Set the customer reference in the InLine Cart

Overview

Use the Cart object to set customer reference to the InLine Cart by calling theTwoCoInlineCart.cart.setCustomerReference(customer-reference)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 currency use TwoCoInlineCart.cart.setCurrency(currency-code).
  5. In order to set order external reference useTwoCoInlineCart.cart.setCustomerReference(customer-reference)method.
  6. You can see below a signature token request payload for this example. A success response contains a JSON with the property “signature“ which needs to be used at the next step to set the signature using the TwoCoInlineCart method.
{
    "merchant": "AVLRNG",
    "currency": "USD",
    "reference": {
        "customer": "test-customer-ref"
    },
    "products": [
        {
            "code": "74B8E17CC0"
        }
    ]
}

The above payload will generate the signature b8c419f437a1b13065d191b8a0e124433d195d086a38448a67f126d01ffe7ad2.

7. Use the TwoCoInlineCart.cart.setSignature('b8c419f437a1b13065d191b8a0e124433d195d086a38448a67f126d01ffe7ad2') method to set the signature.

8. 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.cart.setCurrency('USD');
  TwoCoInlineCart.products.add({
    code: "74B8E17CC0"
  });
  TwoCoInlineCart.cart.setSignature('b8c419f437a1b13065d191b8a0e124433d195d086a38448a67f126d01ffe7ad2');
  TwoCoInlineCart.cart.setCustomerReference('test-customer-ref');
  TwoCoInlineCart.cart.checkout();
});

Demo

After setting the customer reference in the InLine cart using the above method, your cart should look like this:

 

Local payments in Japan - JCB

Overview

Japan is a large eCommerce market, given the high internet penetration rate and the large urban population. 75% of the over 127 million Japanese have purchased products online at least once. The latest studies show that nearly 90% of them have placed orders from mobile devices, such as smartphones and tablets.

ECommerce transactions in Japan have surpassed $100B in 2014, most of the electronic transactions taking place in the local market, with less than 20% of online shoppers buying products from abroad.

Japanese shoppers have spent $1.8B in purchasing products from businesses located in the US and China. Merchants selling to shoppers in the US and China have exported products amounting to roughly $1.4B and $0.5B respectively. Following the US and China, the biggest markets for Japanese merchants are South Korea and Thailand.

Japanese is the official language, with more than 125 million speakers, making localization a key element in the Japanese eCommerce scenery.

Related links

Key payment methods

When it comes to preferred payment methods, credit and debit cards are the payment methods of choice, with 71% of transactions. Cash and convenience store payments are the second most used payment method, totaling 18% of transactions. Other payment methods, including Direct Debit, amount to only 11% of the total number of transactions.

Payment methods Japan

Japan is no stranger to mobile payments either, being one of the first countries to introduce advanced electronic payment methods. The most popular mobile payment methods include smartcard chips and corresponding Java applications that link together mobile credit cards and e-money.

Visa and MasterCard are the two most popular card schemes used by Japanese shoppers, followed by JCB, American Express, and other payment methods.

Alternative payment methods used by Japanese shoppers include:

  • Bank transfers
  • Cash
  • Mobile Suica - mobile payment system used in Japan's biggest cities
  • PayPal
  • Yahoo! Easy payment - online payment service used on Yahoo! Japan Auctions

What 2Checkout offers

As of September 2011, over 70 million Japanese JCB cardholders were generating 9,600 billion yen in transactions annually. JCB holds a 40% market share in the Japanese credit card industry with no less than 56 million JCB cards in circulation.

In addition to Visa/MasterCard support, 2Checkout offers support for JCB.

With over 25% of all Japanese 2Checkout transactions having been paid with JCB, supporting this payment method is highly important for merchants wanting to penetrate the Japanese eCommerce market.

Besides payment processing, 2Checkout also covers support and legal issues:

  • Customer support: +81 (0)3-4579-0155
  • Risk and anti-fraud management
  • Tax compliance

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