Skip to main content

Disable recurring billing

Overview

Use the disableRecurringBilling method to disable recurring billing for a subscription. When you disable recurring billing, the subscription status doesn’t change. Users continue to use subscriptions with recurring billing disabled until they expire, and Avangate provides them with the option to renew their subscription through manual payments.

Parameters

Parameters Type/Description

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.

Response

Parameters Type/Description

Boolean

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

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

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

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

Retrieve account balance

Overview

Use getPendingPayout to retrieve a detailed estimation of the amount that 2Checkout owes you, based on the sales from your current payout period.

The amounts returned by this API method are approximations, and may not represent the final amount that 2Checkout will pay you at the end of the billing period.

Parameters

Parameters Type/Description
inputParameters

Object (Optional)

Details below

  Currency String (Optional)
   

Use this parameter to show the balance only for a single order currency. Example: 'USD'.

If not sent, or sent as NULL, 2Checkout sends the balance for all order currencies.

  TotalCurrency String (Optional)
   

Use this parameter to show the total account balance in the preferred currency. Example: 'EUR'.

If not sent, or sent as NULL, 2Checkout sends the total balance in the default account currency.

Request

<?php

require('PATH_TO_AUTH');

$inputParameters = new StdClass();
$inputParameters->Currency = 'USD';
$inputParameters->TotalCurrency = 'EUR';

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

echo "<pre>";

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

Response

Pending Payout Object

Parameters   Type/Description
Currencies

Array of objects

Details below

  CurrencyObject

Object

Details below

    Currency

String

      Order currency.
    OrdersTotal

Object

Total order amounts, divided per order source.

                        estore Float
      eStore order amounts from the current payout cycle.
                       affiliates Float
      Amounts from your affiliates orders, during the current payout cycle.
                       partner Float
      Amounts from your partner sales, during the current payout cycle.
                        total Float
      Total sales amount made in the order currency from this object, during the current payout cycle.
  RetainedToDisputesBalance Float
      Amounts retained to your dispute balance reports, in the object order currency.
  ReleasedFromDisputesBalance Float
      Amounts released from your dispute balance reports, in the object order currency.
  RetainedToRollingReserveBalance Float
      Amounts retained to your rolling reserve, in the object order currency.
  ReleasedFromRollingReserveBalance Float
      Amounts retained to your rolling reserve, in the object order currency
  ChargebackFees Float
      Chargeback fees retained in the object order currency.
  ProcessingFees Float
      Processing fees retained by 2Checkout in the object order currency.
  AffiliatesCommission Float
      Affiliate commissions paid by 2Checkout in the object order currency.
  TaxCollected Float
      Tax collected by 2Checkout in the object order currency.
  EstimatedTotalRevenue Float
      The estimated total revenue for the object order currency.
Total    

Object

Total account balance amount

  Currency  

String

      Currency used for expressing the account balance.. If not sent in the API call, 2Checkout uses the account default currency.
  OrdersTotal

 

Object

Total order amounts, divided per order source.

    estore Float
      Amounts from total eStore orders during the currency payout cycle.
                      affiliates Float
      Amounts from total affiliates orders during the currency payout cycle.
                      partner Float
      Amounts from total partner orders during the currency payout cycle.
                      total Float
      Total sales amount during the currency payout cycle.
  RetainedToDisputesBalance Float
      Total amounts retained to your dispute balance during the current payout cycle.
  RetainedFromDisputesBalance Float
      Total amounts released from your dispute balance during the current payout cycle.
  RetainedToRollingReserveBalance Float
      Total amounts retained to your rolling reserve during the current payout cycle.
  RetainedFromRollingReserveBalance Float
      Total amounts released from your rolling reserve during the current payout cycle.
  ChargebackFees Float
      Total chargeback fees retained from your account during the currency payout cycle.
  ProcessingFees Float
      Total processing fees retained by 2Checkout during the current payout cycle.
  AffiliatesCommission Float
      Total affiliates commissions paid by 2Checkout during the current payout cycle.
  TaxCollected Float
      Total tax amount collected by 2Checkout during the current payout cycle.
  EstimatedTotalRevenue Float
      Total estimated revenue for the current payout cycle.

 

Set partner invoice (card payment)

Overview

Use this method to mark the partner invoice that the partner will pay. setProforma works in conjunction with setPaymentDetails and is a prerequisite for payProforma. Call setProforma, then setPaymentDetails and payProforma in this specific order to pay for a Partner Invoice.

You can pay only a single partner invoice at a time.

Requirements

This method requires that a specific partner be set using setPartner.

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.
proformaNumber Required (String)
  The unique number of the partner invoice associated with one or more orders.

Response

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

$proformaNumber = 'YOUR_PROFORMA_NUMBER';

try {
    $Proforma= $client->getProforma ($sessionID, $proformaNumber);
} catch (SoapFault $e) {
    echo "ProformaOutput: " . $e->getMessage();
    exit;
}
var_dump ("ProformaOutput", $Proforma);

 

Errors

Error Description

INVALID_PARTNER

No partner is set.

PAYMENT_PROFORMA

You have to use setPaymentDetails first.

PAYMENT_PROFORMA

This is a paid partner invoice.

PAYMENT_ERROR

Authorization error.

 

SOAP code samples

Overview 

  1. Working code samples for JSON-RPC and SOAP are available in PHP for each documented method, including the clients you need to make API calls. You need to replace the dummy Merchant Code and Secret Key with those available in your Merchant Control Panel.
  2. Working code samples for REST are available for each documented scenario and method. Check out the REST reference for examples. To access code samples, select any scenario and click on the "Working example" link. Working code samples:

 

  • cURL
  • Java
  • JavaScript
  • Node.js
  • Perl
  • Python
  • PHP
  • Ruby
  • Go
  • C#
  • Visual Basic
  • Groovy
  • Objective-C
  • Swift

 

Copy payment info

Overview

Copy card-on-file data available in the 2Checkout system from a source subscription to an imported target subscription. 2Checkout uses the existing payment information to charge customers as a part of the recurring billing (renewal) process.

Use the copyPaymentInfo method.

Requirements

The imported target subscription and the source subscription must belong to the same customer. The 2Checkout system checks to make sure that the 2Checkout Customer Reference (an internal identifier) coincides with the customer accounts associated with the target and source subscriptions.

Availability

Please contact 2Checkout directly if you wish to take advantage of this feature.

How does this method work?

  1. Customer A purchases Subscription A using a VISA credit card and you import Subscription B for the same customer with no data or with an AMEX card.
  2. When 2Checkout renews Subscription A, it charges Customer A using the VISA, while using the AMEX (if the data was provided) for Subscription B charges.
  3. When you copy the payment data from Subscription A to Subscription B, the 2Checkout system uses the VISA credit card to renew both subscriptions according to their respective recurring billing cycles. 2Checkout charges customers during the recurring billing process for the imported target subscription using the payment method they used to purchase the source subscription.

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.

TargetSubscriptionReference

Required (string)

 

The 2Checkout Subscription Reference of the imported target subscription, to which 2Checkout copies the payment on file data associated with the source subscription.

SubscriptionReference

Required (string)

 

The 2Checkout Subscription Reference of the source subscription whose attached payment on file data 2Checkout copies to the target subscription.

Response

Parameter Type/Description

Boolean

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

Request

<?php

require ('PATH_TO_AUTH');

$TargetSubscription = 'FFAE3C9429';
$SourceSubscription = '9F4154733C';

try {
    $payInfo = $client->copyPaymentInfo($sessionID, $TargetSubscription, $SourceSubscription);
}
catch (SoapFault $e) {
    echo "payInfo: " . $e->getMessage();
    exit;
}
var_dump("payInfo", $payInfo);

 

Account Payouts

Overview

Retrieve the account balance from your current payout period, detailed for each billing currency.

You can also search for the historical transfers issued by 2Checkout for your account, and filter the results based on the payment date, method or invoice paid.

 

 

Pay partner invoice (card payment)

Overview

Pay a partner invoice that was set using setProforma. Works in conjunction with setProforma and setPaymentDetails. Call setProforma, then setPaymentDetails and payProforma in this specific order to pay for a partner invoice.

Requirements

This method requires that a specific partner be set using setPartner.

You also need to use setProforma to mark a partner invoice for payment, and specify the payment method with setPaymentDetails.

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.

Response

Parameter Type/Description
result Boolean
  True or false.

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
require('PATH_TO_setProforma'); // setProforma example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/14Billing/00Capture_card_payment/00Set_partner_invoice
require('PATH_TO_setPaymentDetails'); // setPaymentDetails example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/14Billing/00Capture_card_payment/02Set_partner_invoice_payment_details

try {
    $ProformaPay= $client->payProforma($sessionID);
} catch (SoapFault $e) {
    Echo "ProformaPaid: " . $e->getMessage();
    exit;
}
var_dump ("ProformaPaid ", $ProformaPay);

Errors

Error Description

INVALID_PARTNER

No partner is set.

PAYMENT_PROFORMA

You must use setPaymentDetails first.

PAYMENT_PROFORMA

This is a paid partner invoice.

PAYMENT_ERROR

Authorization error.

 

Retrieve proposal by ID

Overview

Use the getProposalById method via JSON-RPC APIv6 to retrieve a proposal/quote using a specific ID.

Request Parameters

Request parameters for the getProposalById JSON-RPC APIv6 method
Parameters Type Required/Optional Description
proposalId String

Required

The unique merchant proposal ID generated by the 2Checkout system.

sessionId String Required Unique 2Checkout session ID code.

Request Sample

<?php

require ('PATH_TO_AUTH');

$proposalID = "0573e71d-38bb-4d61-88ca-b3c557517c68";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getProposalById';
$jsonRpcRequest->params = array($sessionID, $proposalID);
$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 getProposalById call via JSON-RPC APIv6 returns the Proposal object.

Subscription additional information fields

Overview

Use this object to assign, update, retrieve and delete additional information fields from your subscriptions.

Parameters

Parameters Type/Description

fieldName

String

 

The name of the additional information field. Used for identifying additional information fields.

fieldValue

String

 

The value of the additional information field.

 

 

Retrieve product price

Overview

Get the price for a product in a new purchase scenario, based on the product ID, the pricing list it's assigned to, and specific pricing options.

Requirements

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

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.
productId Required (string)
  The unique identifier of the product from your system.
pricingListCode Required (string)
  The unique identifier of the pricing list.
priceOptions Optional (StringArray)
  Array of pricing option codes. These identifiers mark the individual options inside pricing options configuration groups. Can be NULL.

Response

Parameter Type/Description
UnitPrice Object
  UnitPrice object.

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

$productId = 'YOUR_PRODUCT_ID';
$pricingListCode = 'YOUR_PRICING_LIST_CODE';
$priceOptions = array(
'PRICE_OPTION_CODE_1',
'PRICE_OPTION_CODE_2'
);

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

Errors

Error Description

INVALID_PARTNER

No partner is set.

PRODUCT_ERROR

Invalid product ID.

PARTNER_PRICING_LISTS_NOT_FOUND

There are no pricing lists with the provided code.

PRODUCT_NOT_FOUND

There is no active product with the provided ID in the given pricing list.

 

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