Skip to main content

Orders with installments

Overview

Avangate supports local Brazilian Visa, MasterCard and AMEX credit / debit cards limited to national purchases in the local currency BRL (Brazilian Real)

Requirements

  1. Installments are available only for:
    • Brazilian customers
    • Local Visa, MasterCard or AMEX cards
    • Non-recurring transactions
  2. Minimum installment threshold is 5 BRL. Maximum number of installments is 6.
  3. Mandatory information for payments also includes shopper phone number and  Fiscal Code (CPF/CNPJ).

Do local BR cards with / without installments require an addendum to my contract?

Yes. Please contact Avangate for activation.

How does it work?

  1. Create the Order object.
  2. Validate the number of installments available based on total order value. 
  3. Place the order specifying the number of installments. 

Funds collection for installment payments

2Checkout pays you in full, regardless of the number of installments (this is covered directly by the banks). 

 

Overview

Introduction

Use JSON/RPC to invoke methods of version 3.0 of the Avangate API. JavaScript Object Notation remote procedure call protocol is a lightweight data-interchange format. 

Workflow

  1. Use the following URL: https://api.avangate.com/rpc/3.0/
  2. Authenticate using the login method and create a session (connection).
  3. Throughout the lifetime of the session (max 10 minutes) you can invoke all Avangate API methods. To invoke methods you need to send a request to Avangate. Read more on the request object below.
  4. The Avangate system provides responses for all requests. Read more on the response object below.

 

Request

Invoke remote methods by sending requests to Avangate. Request contain single objects serialized using JSON. Read request properties below.

{
    "jsonrpc": 2.0,
    "id": < intidentifier >,
    "method": "<methodName>",
    "params": [ < parametersarray > ]
    }

Request object

jsonrpc

required (String)

 

The version of the JSON-RPC protocol. Needs to be 2.0.

id

required (Int)

 

A mandatory identifier you control used to identify the request and the response. Use only integers.

method

required (String)

 

The name of the method invoked. Case sensitive.

params

optional (Object)

 

An object containing the parameters valid for invoking the method used.

Parameters structure:

  • Provide RPC call parameters by-position using an Array. (structured value)
  • by-position: include all parameters into an Array. Put values in the order expected by Avangate.
  • At this point Avangate doesn’t support by-name parameters.

Response

When the method invocation completes, Avangate replies with a response. The response is a single object serialized using JSON. There are two types of response, with the properties detailed below.

Valid

 

 {
    "id": < intidentifier > ,
    "jsonrpc": 2.0,
    "response": { < return object > }
                }

 

jsonrpc

required (String)

 

The version of the JSON-RPC protocol. Needs to be 2.0.

id

required (Int)

 

A mandatory identifier you control used to identify the request and the response. Use only integers.

response

required on success only (Object)

 

Provided on success (Avangate does not provide it if there is an error invoking the method). Actual value depends on the method invoked.

Invalid

{
    "id": < intidentifier >,
    "jsonrpc":2.0,
    "error":{
        "code": < interrorcode >,
        "message":"<error message>"
            }
    }

 

jsonrpc

required (String)

 

The version of the JSON-RPC protocol. Needs to be 2.0.

id

required (Int)

 

A mandatory identifier you control used to identify the request and the response. Use only integers.

error

required on error only (Object)

 

  • Code - Integer identifying the error.
  • Message - Error description (string).

 

Custom Price Change

Overview

2Checkout automatically sends out the custom price change email to provide shoppers with information about a change in their subscription price. It notifies shoppers that the subscription price has been changed by the service provider.

The custom price change email template is available for customization in the Merchant Control Panel.

Availability

All 2Checkout accounts.

What is the purpose of this email?

2Checkout sends the custom price change email for all shoppers with active subscriptions.

Email content

The email provides detailed information on the content of the subscription and billing cycle:

  1. Subscription details.
  2. Billing cycle and new billing cycle information.
  3. Billing amount details.

Sample

Email Body

Dear [% $LAST_NAME %] [% $FIRST_NAME %],
Please be informed that the next billing amount for your subscription to [% $PRODUCT_NAME %] has been changed by a representative of [%$COMMERCIALNAME%]:

New billing amount: [% $NEW_PRICE.amount %] [% $NEW_PRICE.currency %]
[%if $NEXT_BILLING_DATE %]Next billing date: [% $NEXT_BILLING_DATE %]
[%/if%]
Previous billing amount: [% $OLD_PRICE.amount %] [% $OLD_PRICE.currency %]
Price validity: [%if $NEXT_CIRCLES == false%]all future subscription renewals.
[%else%]the next [% $NEXT_CIRCLES %] subscription renewal(s) from now on, after which the previous billing amount will be charged.
[%/if%]

To manage your subscription, please access your [% $PAYMENT_PARTNER %] myAccount at:
[% $MYACCOUNT_URL %]

For further information regarding this price update, please contact [% $SELLER_COMPANY %][%if $SUPPORT_EMAIL%] at: [% $SUPPORT_EMAIL %][%/if%]
[%if $SUPPORT_WEB%]

Sample Image

subscription price change.JPG

Order session contents

Overview

Retrieve the current cart session content, and learn insights about your customers actions in cart.

You can obtain the VAT or sales TAX based on current cart items, prefill the customer information based on the subscription reference, or get the price applied in cart by using the API method from below.

 

Retrieve a lead

Overview

Use the getLead method to retrieve leads created in the 2Checkout systems by fetching the lead code.

Request Parameters

Parameters Required Type/Description

LeadCode

Optional

String/Array of strings. Retrieves all leads based on their unique identification code (system-generated).

 

 

Email

Optional

String. A valid email address used by the customer

Type

Optional String. Must be one of the existing types of leads:
  • New
  • Used
  • UsedSuccess
  • Stopped
  • NotStopped

StartDate

Optional String. The start date of the interval; format must be yyyy-mm-dd.

EndDate

Optional String. The end date of the interval; format must be yyyy-mm-dd.

ProductCode 

Optional

String/Array of strings. Searches for all leads containing the product code.

Language

Optional String. The language of the shopper cart; ISO 639-1 two-letter code.

Country

Optional String. The customers billing country; ISO 3166 two-letter code.

GeneratedFrom 

Optional String. API, shopping cart, ConvertPlus. Display the leads based on the source where they were created – via API or via the 2Checkout ordering engines.

Request Example

<?php

require ('PATH_TO_AUTH');

$jsonRpcRequest = array (
    'method' => 'getLead',
    'params' => array($sessionID, '60E6C4B574'),
    'id' => $i++,
    'jsonrpc' => '2.0'
);

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

Response Example

class stdClass#18 (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#19 (1) {
    public $0 =>
    class stdClass#20 (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#21 (5) {
        public $CycleLength =>
        NULL
        public $CycleUnit =>
        NULL
        public $CycleAmount =>
        NULL
        public $ContractLength =>
        NULL
        public $ContractUnit =>
        NULL
      }
      public $RenewalInformation =>
      class stdClass#22 (1) {
        public $SubscriptionReference =>
        NULL
      }
      
      }
      public $MarketingCampaigns =>
      class stdClass#23 (3) {
        public $Type =>
        string(2) "23"
        public $ParentCode =>
        string(1) "m"
        public $CampaignCode =>
        string(2) "23"
      }
      public $Price =>
      class stdClass#24 (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#25 (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#26 (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#27 (1) {
    public $ShippingMethod =>
    class stdClass#28 (1) {
      public $Code =>
      string(5) "sdfsd"
    }
  }
  public $PaymentDetails =>
  class stdClass#29 (4) {
    public $Type =>
    string(2) "CC"
    public $Currency =>
    string(3) "EUR"
    public $PaymentMethod =>
    class stdClass#30 (2) {
      public $RecurringEnabled =>
      bool(false)
      public $CardPayment =>
      class stdClass#31 (1) {
        public $InstallmentsNumber =>
        string(2) "23"
      }
    }
    public $CustomerIP =>
    string(7) "1.2.3.4"
  }
  public $Promotions =>
  array(1) {
    [0] =>
    string(0) ""
  }
}

 

Update product

Overview

Use the updateProduct method to update the configuration of a subscription plan/product you already configured 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.

Product

Required (object)

 

Use this object to configure your subscription plans/products.

 

You can update/edit all parameters, except the following:

  • AvangateID
  • ProductType

Exceptions

When updating a subscription plan/product, you also update its PricingConfigurations. However, you cannot modify:

  • The pricing configuration CODE.
  • The PricingSchema from DYNAMIC to FLAT or vice versa.  

Request

<?php

require ('PATH_TO_AUTH');

$ProductCode = 'NewProdCodeAPI12345';

try {
$myProduct = $client->getProductByCode($sessionID, $ProductCode);
}

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

$myProduct->ProductName = 'Edited_From_API_Again';

var_dump ($myProduct);

try {
    $NewSubscriptionPlan = $client->updateProduct($sessionID, $myProduct);
}

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

var_dump("UpdatedProductInfo", $NewSubscriptionPlan);

?>

Response

bool(true)

 

Pricing configuration

Overview

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

Pricing configuration object

Parameters Type/Description
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.

 

 

Next renewal price

Overview

Use the methods below to set or retrieve information related to the next renewal price to be charged on a customer's subscription.

 

Generate SKU Schema

Overview

Stock keeping unit or SKU is a number assigned to a particular product by a digital or physical retail store for easy identification and inventory tracking purposes. The SKU number is a string of alphanumeric characters that uniquely identify details such as price, product options, and manufacturer of a particular product or service. SKUs are used in order notifications, electronic delivery, export files, etc.

SKU Management

For companies that manage large product catalogs with defined SKUs and that make regular changes to their prices and products (new versions, new options), the manual process performed in the Merchant Control Panel needs to be supported by an automatic solution as well. By using an automated flow, merchants decrease the time needed for this process, and also reduce the risk of human errors associated with the manual process.

In the 2Checkout platform, SKUs can be associated with a unique combination made up of:

  • Product identification element
  • Pricing configuration
  • Plus minimum one of the following:
    • Currency – defined as applicable to all currencies or only to specific ones
    • Volume Discounts – defined as specific quantity or intervals (applicable only according to the volume discounts that are defined at pricing configuration level)
    • Purchase Types – possible values: new purchase, renewal, upgrade, and trial
    • Pricing Options – will be available considering the pricing option groups assigned to the selected pricing configuration

 

 

Reseller

Overview

Structure

Reseller Object
ResellerCode String
  Unique, system generated reseller identifier. Can be NULL.
Company String
  Reseller company name. Can be NULL.
FirstName String
  Reseller first name. Can be NULL.
LastName String
  Reseller last name. Can be NULL.
Email String
  Reseller email. Can be NULL.
Phone String
  Reseller phone. Can be NULL.
Fax String
  Reseller fax. Can be NULL.
Country String
  Reseller country ISO language code (ISO 639-1 two-letter code). Can be NULL.
State String
  Reseller state. For example, "Alabama","Alaska","Arizona". Can be NULL.
City String
  Reseller city. Can be NULL.
Address String
  Reseller address. Can be NULL.
PostalCode String
  Reseller ZIP code. Can be NULL.

 

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