API Reference

This API reference consists of all the APIs provided by Terminal3 Payments. The Terminal3 Payments API can be interacted with HTTPS requests to obtain certain information from Terminal3 Payments. Typically a JSON object including the required details will be returned except Widget API & Checkout API, which redirect your customer to Terminal3 Payments for hosted checkout payment experience.

If you have any suggestions or confusion about our reference pages, please create a issue directly on our Github.

Library:

https://github.com/paymentwall/paymentwall-php

Library

https://github.com/paymentwall/paymentwall-node

Library

https://github.com/paymentwall/paymentwall-java

Library

https://github.com/paymentwall/paymentwall-ruby

Library

 https://github.com/paymentwall/paymentwall-python

Library

https://github.com/paymentwall/paymentwall-dotnet

Digital Goods

You can set either onetime payment or subscription in products section for your projects. Refer to product configuration for Digital Goods.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
widget
required
string
Widget code. Can be obtained in the widget sections of your projects.
email
required
string
The email of end users. Terminal3 Payments will automatically send a payment receipt to the user once his payment is successfully performed.
history[registration_date]
required
string
Unix timestamp of the registration date. The limitation of length is 10.
ps
required
string
It determines which payment method to be shown on payment page. Required to be in lowercase. Set it to all if you want to use selection form of payment methods provided by Terminal3 Payments. Refer to payment system shortcodes to get the payment method code.
sign_version
required
integer
The signature version. Version 2 uses MD5 and version 3 represents SHA256.
sign
required
string lowercase
The signature of widget.
Refer to signature calculation for more details.
default_goodsid
string
The id of the product which you want to be chosen by default in the widget.
hide_goodsid[]
array
Id of the products that should not be displayed in the widget (e.g. &hide_goodsid[0]=product_1&hide_goodsid[1]=product_2). The array needs to be indexed explicitly for correct request signature calculation (e.g. hide_goodsid[0]=product_1 and not hide_goodsid[]=product_1).
display_goodsid
array
Id of the product to display in the widget e.g. display_goodsid[0]=product_1&display_goodsid[1]=product_2, which should be indexed explicitly.
tokidoki_plan_id
required for subscription
string
Id of the Tokidoki subscription plan.

You can also add optional parameters for extra needs or user profile parameters for risk scoring.

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'api_type' => Paymentwall_Config::API_GOODS,
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$widget = new Paymentwall_Widget(
    'userid', // uid
    'p1', // widget
    array() // Product parts, leave empty for Widget API
    array(
        'email' => 'user@hostname.com', 
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all' // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'addtional_param_name' => 'addtional_param_value'
    )
);

echo $widget->getHtmlCode();
?>

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

var Paymentwall = require('paymentwall');
Paymentwall.Configure(
    Paymentwall.Base.API_GOODS,
    'YOUR_PROJECT_KEY',
    'YOUR_SECRET_KEY'
);

var widget = new Paymentwall.Widget(
    'user4002', // uid
    'p1', // widget
    [], // Product parts, leave empty for Widget API
    {	
        'email': 'user@hostname.com',
        'history[registration_date]': 'registered_date_of_user',
        'ps': 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'additional_param_name': 'additional_param_value'
    }
);
widget.getHtmlCode();

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

Config.getInstance().setLocalApiType(Config.API_GOODS);
Config.getInstance().setPublicKey("YOUR_PROJECT_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

WidgetBuilder widgetBuilder = new WidgetBuilder("USER_ID", "p1");

widgetBuilder.setExtraParams(new LinkedHashMap<String, String>(){
{
    put("email", "YOUR_CUSTOMER_EMAIL");
    put("history[registration_date]","REGISTRATION_DATE");
    put("ps","all"); // Replace the value of 'ps' with specific payment system short code for Widget API uni
}
});

Widget widget = widgetBuilder.build();

return widget.getHtmlCode();

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

require 'paymentwall' # alternatively, require_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'
Paymentwall::Base::setApiType(Paymentwall::Base::API_GOODS)
Paymentwall::Base::setAppKey('YOUR_PROJECT_KEY')
Paymentwall::Base::setSecretKey('YOUR_SECRET_KEY')

widget = Paymentwall::Widget.new(
    'user40012', # uid
    'p1', # widget
    [], # Product parts, leave empty for Widget API
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'additional_param_name' => 'additional_param_value'
    }
)
puts widget.getHtmlCode()

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_GOODS)
Paymentwall.set_app_key('YOUR_PROJECT_KEY')
Paymentwall.set_secret_key('YOUR_SECRET_KEY')

widget = Widget(
    'user4522', # uid
    'fp', # widget
    [], # Product parts, leave empty for Widget API
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'additional_param_name' => 'additional_param_value'
    }
)
print(widget.get_html_code())

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

using Paymentwall;

Paymentwall_Base.setApiType(Paymentwall_Base.API_GOODS);
Paymentwall_Base.setAppKey("YOUR_PROJECT_KEY"); 
Paymentwall_Base.setSecretKey("YOUR_SECRET_KEY");

widget = Widget(
    'user4522', # uid
    'p1', # widget
    [], # Product parts, leave empty for Widget API
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'additional_param_name' => 'additional_param_value'
    }
)
print(widget.get_html_code())

Endpoint

GET https://payments.terminal3.com/api/subscription

Tokidoki

Tokidoki is Terminal3 Payments Subscription Management solution, which allows merchants to control their customers’ subscription payments on recurring basis.

We offer Tokidoki API for recurring billing plan and obtain package details.

Build Widget

Tokidoki API is for implementing subscription solution when product information is stored in Merchant Area Tokidoki section.

Please pass X-ApiKey through HttpHeader, the value is Project Key,which can be found in Merchant Area.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
user_email
required
string
Email of the end-user in your system.
package_id
required
int
It can be found in Merchant Area–>Tokidoki–>Packages section
It’s not required if request already includes package_sku_id
package_sku_id
required
varchar
Each package will be idenfified by an unique SKU ID. This is the SKU ID that you already inputted when you setup the package
It’s not required if request already includes package_id
custom
optional
array
Refer to more optional parameters for extra needs or user profile parameters for risk scoring.

Endpoint

POST https://payments.terminal3.com/developers/tokidoki-api/widget-url

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'user_email' => 'YOUR_EMAIL@email.com',
    'package_id' => 59,
    'package_sku_id' => 'your_package_sku_id',
    'custom' => [
        'success_url' => 'https://www.xxx.com',
        'failure_url' => 'https://www.yyy.com'
        ]
    ];

$curlOptions = [
    CURLOPT_HEADER => false,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-ApiKey:' . $key
        ],
        CURLOPT_POSTFIELDS => json_encode($params)
    ];

$endpoint = 'https://payments.terminal3.com/developers/tokidoki-api/widget-url';

$curl = curl_init();
curl_setopt_array($curl, $curlOptions);
curl_setopt($curl, CURLOPT_URL, $endpoint);
$content = curl_exec($curl);
curl_close($curl);

$response = json_decode($content, true);

if ($response['success'] == 1) {
    header("Location: ".$response['data'] . PHP_EOL);
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Get Package Details

The API is designed to obtain subscription package details.

Please pass X-ApiKey through HttpHeader, the value is Project Key,which can be found in Merchant Area.

Endpoint

GET https://payments.terminal3.com/developers/tokidoki-api/packages

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');

$key = 'YOUR_PROJECT_KEY';

$curlOptions = [
    CURLOPT_HEADER => false,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-ApiKey: ' . $key
        ]
    ];

$endpoint = 'https://payments.terminal3.com/developers/tokidoki-api/packages';

$curl = curl_init();
curl_setopt_array($curl, $curlOptions);
curl_setopt($curl, CURLOPT_URL, $endpoint);
$content = curl_exec($curl);
curl_close($curl);

$response = json_decode($content, true);


if ($response['success'] == 1) {
    var_dump($response['data']) . PHP_EOL;
} else {
    var_dump($response['error']) . PHP_EOL;
}
?>

Virtual Currency

If you are selling points, coins or credtis, virtual currency API can help you to set equivalent currency. Besides, you can also configure your price points for different payment systems. Refer to product configuration for Virtual Currency.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
Assigned ID of the end-user in your system who is viewing the widget. The ID must be unique per user. The maximum length is 64 characters.
widget
required
string
Can be created and obtained in the Widgets section of your project.
email
required
string
Email of end-user. Terminal3 Payments will automatically send a receipt to the user once the payment is completed.
history[registration_date]
required
string
Unix timestamp of the registration date. Maximum length is 10.
ps
required
string
It determines which payment method to be shown on payment page. Required to be in lowercase. Set it to all if you want to use selection form of payment methods provided by Terminal3 Payments. Refer to payment system shortcodes to get the payment method code.
promo
array
Apply promotion to products. Require sign_version 3.
promo[0][type]
string
Value needs to be percent_bonus.
promo[0][discount]
string
Percentage of discount.
promo[0][minimum_amount]
string
Price (including price greater than this) that discount will apply to.
promo[0][minimum_amount_currency]
string
Currency that this discount will apply to.
sign_version
required
integer
Signature version. Version 2 employs MD5 and version 3 utilizes SHA256.
sign
required
string lowercase
The signature of the widget. Refer to Signature Calculation for more details.

You can also add optional parameters for extra needs or user profile parameters for risk scoring.

Endpoint

GET https://payments.terminal3.com/api/ps/?

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'api_type' => Paymentwall_Config::API_VC,
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$widget = new Paymentwall_Widget(
    'user40012', // uid
    'p1', // widget
    array(), // Product parts, leave empty for Widget API
    array(
        'email' => 'user@hostname.com', 
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all' // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'addtional_param_name' => 'addtional_param_value'
    )
);
echo $widget->getHtmlCode();
?>

Endpoint

GET https://payments.terminal3.com/api/ps/?

Sample Request

var Paymentwall = require('paymentwall');
Paymentwall.Configure(
    Paymentwall.Base.API_VC,
    'YOUR_PROJECT_KEY',
    'YOUR_SECRET_KEY'
);

var widget = new Paymentwall.Widget(
    'user40012', // uid
    'p1', // widget
    {	
        'email': 'user@hostname.com',
        'history[registration_date]': 'registered_date_of_user',
        'ps': 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'addtional_param_name': 'addtional_param_value'
    }
);
widget.getHtmlCode();

Endpoint

GET https://payments.terminal3.com/api/ps/?

Sample Request

Config.getInstance().setLocalApiType(Config.API_VC);
Config.getInstance().setPublicKey("YOUR_APPLICATION_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

WidgetBuilder widgetBuilder = new WidgetBuilder("USER_ID", "p1");

widgetBuilder.setExtraParams(new LinkedHashMap<String, String>(){
{
    put("email", "YOUR_CUSTOMER_EMAIL");
    put("history[registration_date]","REGISTRATION_DATE");
    put("ps","all"); // Replace the value of 'ps' with specific payment system short code for Widget API uni
}
});

Widget widget = widgetBuilder.build();

return widget.getHtmlCode();

Endpoint

GET https://payments.terminal3.com/api/ps/?

Sample Request

var Paymentwall = require('paymentwall');
Paymentwall.Configure(
    Paymentwall.Base.API_VC,
    'YOUR_PROJECT_KEY',
    'YOUR_SECRET_KEY'
);

var widget = new Paymentwall.Widget(
    'user40012', # uid
    'p1', # widget
    {
        'email': 'user@hostname.com',
        'history[registration_date]': 'registered_date_of_user',
        'ps' => 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'addtional_param_name': 'addtional_param_value'
    }
);
widget.getHtmlCode();

Endpoint

GET https://payments.terminal3.com/api/ps/?

Sample Request

from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_VC)
Paymentwall.set_app_key('YOUR_PROJECT_KEY')
Paymentwall.set_secret_key('YOUR_SECRET_KEY')

widget = Widget(
    'user40012', # uid
    'p1_1', # widget
    [], # Product parts, leave empty for Widget API
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'additional_param_name' => 'additional_param_value'
    }
)
print(widget.get_html_code())

Endpoint

GET https://payments.terminal3.com/api/ps/?

Sample Request

from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_VC)
Paymentwall.set_app_key('YOUR_PROJECT_KEY')
Paymentwall.set_secret_key('YOUR_SECRET_KEY')

widget = Widget(
    'user4522', # uid
    'p1', # widget
    [], # Product parts, leave empty for Widget API
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace the value of 'ps' with specific payment system short code for Widget API uni
        'additional_param_name' => 'additional_param_value'
    }
)
print(widget.get_html_code())

Endpoint

GET https://payments.terminal3.com/api/ps/?

Onetime payment

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
widget
required
string
Widget code. Can be obtained in the widget sections of your projects.
email
required
string
The email of end users. Terminal3 Payments will automatically send a payment receipt to the user once his payment is successfully performed.
history[registration_date]
required
string
Unix timestamp of the registration date. The limitation of length is 10.
amount
required
double
The amount of your product. The minimum transaction limit is USD 0.3 or equivalent in other currencies.. 2 decimal places are expected.
currencyCode
required
string
Currency code of your product. Format by ISO 4217. 3 letters.
ag_name
required
string
Your product name. The maximum length is 256.
ag_external_id
required
string
ID of your product. Order reference ID could also be set here. We will communicate back to you via the pingback as goodsid parameter. The maximum length is 256.
ag_type
required
string
The payment type of your product. For onetime payment, it is required to be set to fixed.
ps
required
string
It determines which payment method to be shown on payment page. Required to be in lowercase. Set it to all if you want to use selection form of payment methods provided by Terminal3 Payments. Refer to payment system shortcodes to get the payment method code.
sign_version
required
string
The signature version. Version 2 uses MD5 and version 3 represents SHA256.
sign
required
string lowercase
The signature of widget. Refer to signature calculation for more details.

You can also add optional parameters for extra needs or user profile parameters for risk scoring.

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'api_type' => Paymentwall_Config::API_GOODS,
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$widget = new Paymentwall_Widget(
    'user40012', // uid
    'p1', // widget
    array(
        new Paymentwall_Product(
        'product301', // ag_external_id
        9.99, // amount
        'USD', // currencyCode
        'Gold Membership', // ag_name
        Paymentwall_Product::TYPE_FIXED // ag_type
        )
    ),
    array(
        'email' => 'user@hostname.com', 
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace it with specific payment system short code for single payment methods
        'addtional_param_name' => 'addtional_param_value'
    )
);
echo $widget->getUrl();
?>

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

var Paymentwall = require('paymentwall');
Paymentwall.Configure(
    Paymentwall.Base.API_GOODS,
    'YOUR_PROJECT_KEY',
    'YOUR_SECRET_KEY'
);

var widget = new Paymentwall.Widget(
    'user40012', // uid
    'p1', // widget 
    [
        new Paymentwall.Product(
            'product301', // ag_external_id
            9.99, // amount
            'USD', // currencycode
            Paymentwall.Product.TYPE_FIXED // ag_type
        )
    ],
    {
        'email': 'user@hostname.com',
        'history[registration_date]': 'registered_date_of_user',
        'ps': 'all', // Replace it with specific payment system short code for single payment methods
        'additional_param_name': 'additional_param_value'
    }
);
widget.getUrl();

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

Config.getInstance().setLocalApiType(Config.API_GOODS);
Config.getInstance().setPublicKey("YOUR_PROJECT_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

WidgetBuilder widgetBuilder = new WidgetBuilder("USER_ID", "p1");

widgetBuilder.setProduct( 
    new ProductBuilder("YOUR_PRODUCT_ID") {
    {
        setAmount(0.99);
        setCurrencyCode("USD");
        setName("YOUR_PRODUCT_NAME");
        setProductType(Product.TYPE_FIXED);
    }
}.build());

widgetBuilder.setExtraParams(new LinkedHashMap<String, String>(){
{
    put("email", "YOUR_CUSTOMER_EMAIL");
    put("history[registration_date]","REGISTRATION_DATE");
    put("ps","all"); // Replace it with specific payment system short code for single payment methods
}
});

Widget widget = widgetBuilder.build();

return widget.getUrl();

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

require 'paymentwall' # alternatively, require_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'
Paymentwall::Base::setApiType(Paymentwall::Base::API_GOODS)
Paymentwall::Base::setAppKey('YOUR_PROJECT_KEY')
Paymentwall::Base::setSecretKey('YOUR_SECRET_KEY')

widget = Paymentwall::Widget.new(
    'user40012', # uid
    'p1', # widget
    [
        Paymentwall::Product.new(
            'product301', # ag_external_id
            9.99, # amount
            'USD', # currencyCode
            'Gold Membership', # ag_name
            Paymentwall::Product::TYPE_FIXED # ag_type
        )
    ],
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', # Replace it with specific payment system short code for single payment methods
        'additional_param_name' => 'additional_param_value'
    }
)
puts widget.getUrl()

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_GOODS)
Paymentwall.set_app_key('YOUR_PROJECT_KEY')
Paymentwall.set_secret_key('YOUR_SECRET_KEY')

product = Product(
    'product301', # ag_external_id
    12.12, # amount
    'USD', # currencyCode
    'test', # ag_name
    Product.TYPE_FIXED # ag_type
)

widget = Widget(
    'user4522', # uid
    'p1', # widget
    [product],
    {
        'email' : 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' : 'all', # Replace it with specific payment system short code for single payment methods
        'additional_param_name' : 'additional_param_value'
    }
)
print(widget.get_url())

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

using Paymentwall;

Paymentwall_Base.setApiType(Paymentwall_Base.API_GOODS);
Paymentwall_Base.setAppKey("YOUR_PROJECT_KEY"); 
Paymentwall_Base.setSecretKey("YOUR_SECRET_KEY");

List<Paymentwall_Product> productList = new List<Paymentwall_Product>();
Paymentwall_Product product = new Paymentwall_Product(
    "product301", // ag_external_id
    9.99, // amount
    "USD", // currencyCode
    "Gold Membership", // ag_name
    Paymentwall_Product.TYPE_FIXED, //ag_type
    );
productList.Add(product);
Paymentwall_Widget widget = new Paymentwall_Widget(
    "user40012", // uid
    "p1", // widget
    productList,
    new Dictionary<string, string>() {
        {
            'email' => 'user@hostname.com',
            'history[registration_date]' => 'registered_date_of_user',
            'ps' => 'all', // Replace it with specific payment system short code for single payment methods
            'additional_param_name' => 'additional_param_value'
        }
    }
);
Response.Write(widget.getUrl());

Endpoint

GET https://payments.terminal3.com/api/subscription

Subscription

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
widget
required
string
Widget code. Can be obtained in the widget sections of your projects.
email
required
string
The email of end users. Terminal3 Payments will automatically send a payment receipt to the user once his payment is successfully performed.
history[registration_date]
required
string
Unix timestamp of the registration date. The limitation of length is 10.
amount
required
double
The amount of your product. The minimum transaction limit is USD 0.3 or equivalent in other currencies.. 2 decimal places are expected.
currencyCode
required
string
Currency code of your product. Format by ISO 4217. 3 letters.
ag_name
required
string
Your product name. The maximum length is 256.
ag_external_id
required
string
ID of your product. Reference ID could also be set here. We will communicate back to you via the pingback as goodsid parameter. The maximum length is 256.
ag_type
required
string
The payment type of your product. For subscription, it is required to be set to subscription.
ag_period_length
required
integer
The length of your subscription duration.
ag_period_type
required
string
The type of your subscription duration. Required to be set to following types, day/week/month/year.
ag_recurring
required
integer
The value could be either 1 or 0. Wether the product is recurring. If product is trial it should always be 1. By default, recurring billing is only supported for product with duration of at least 3 days and less than 1 year.
ag_trial
integer
The value could be either 1 or 0 (1 means trial). If trial is enabled, parameters with * are required.
post_trial_amount*
double
The amount of money of your product after trial period. 2 decimal places are requested.
post_trial_currencyCode*
string
Currency code of your product after trial period. Format by ISO 4217. 3 letters.
ag_post_trial_name*
string
Your product name after trial period. The maximum length is 256.
ag_post_trial_external_id*
string
ID of your product after trial period. The maximum length is 256.
ag_post_trial_period_type*
string
The type of subscription duration for your products after trial period. Required to be set to following types, day/week/month/year.
ag_post_trial_period_length*
integer
The length of subscription duration for your products after trial period.
ps
required
string
It determines which payment method to be shown on payment page. Required to be in lowercase. Set it to all if you want to use selection form of payment methods provided by Terminal3 Payments. Refer to payment system shortcodes to get the payment method code.
sign_version
required
string
The signature version. Version 2 uses MD5 and version 3 represents SHA256.
sign
required
string lowercase
The signature of widget. Refer to signature calculation for more details.

You can also add optional parameters for extra needs or user profile parameters for risk scoring.

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'api_type' => Paymentwall_Config::API_GOODS,
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$widget = new Paymentwall_Widget(
    'user40012', // uid
    'p1', // widget
    array(
        new Paymentwall_Product(
        'product301', // ag_external_id
        9.99, // amount
        'USD', // currencyCode
        'Gold Membership', // ag_name
        Paymentwall_Product::TYPE_SUBSCRIPTION, // ag_type
        1, // ag_period_length
        Paymentwall_Product::PERIOD_TYPE_MONTH, // ag_period_type
        true // ag_recurring
        )
    ),
    array(
        'email' => 'user@hostname.com', 
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', // Replace it with specific payment system short code for single payment methods
        'addtional_param_name' => 'addtional_param_value' 
    )
);
echo $widget->getUrl();
?>

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

var Paymentwall = require('paymentwall');
Paymentwall.Configure(
    Paymentwall.Base.API_GOODS,
    'YOUR_PROJECT_KEY',
    'YOUR_SECRET_KEY'
);

var widget = new Paymentwall.Widget(
    'user40012', // uid
    'p1', // widget 
    [
        new Paymentwall.Product(
            'product301', // ag_external_id
            9.99, // amount
            'USD', // currencyCode
            Paymentwall.Product.TYPE_SUBSCRIPTION, // ag_type
            1, // ag_period_length
            Paymentwall.Product.PERIOD_TYPE_MONTH, // ag_period_type
            true // ag_recurring
        )
    ],
    {
        'email': 'user@hostname.com',
        'history[registration_date]': 'registered_date_of_user',
        'ps': 'all', // Replace it with specific payment system short code for single payment methods
        'additional_param_name': 'additional_param_value'
    }
);
widget.getUrl();

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

Config.getInstance().setLocalApiType(Config.API_GOODS);
Config.getInstance().setPublicKey("YOUR_PROJECT_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

WidgetBuilder widgetBuilder = new WidgetBuilder("USER_ID", "p1");

widgetBuilder.setProduct( 
    new ProductBuilder("YOUR_PRODUCT_ID") {
    {
        setAmount(0.99);
        setCurrencyCode("USD");
        setName("YOUR_PRODUCT_NAME");
        setProductType(Product.TYPE_SUBSCRIPTION);
        setPeriodType("month");
        setPeriodLength(3);
    }
}.build());

widgetBuilder.setExtraParams(new LinkedHashMap<String, String>(){
{
    put("email", "YOUR_CUSTOMER_EMAIL");
    put("history[registration_date]","REGISTRATION_DATE");
    put("ps","all"); // Replace it with specific payment system short code for single payment methods
}
});

Widget widget = widgetBuilder.build();

return widget.getUrl();

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

require 'paymentwall' # alternatively, require_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'
Paymentwall::Base::setApiType(Paymentwall::Base::API_GOODS)
Paymentwall::Base::setAppKey('YOUR_PROJECT_KEY')
Paymentwall::Base::setSecretKey('YOUR_SECRET_KEY')

widget = Paymentwall::Widget.new(
    'user40012', # uid
    'p1', # widget
    [
        Paymentwall::Product.new(
            'product301', # ag_external_id
            9.99, # amount
            'USD', # currencyCode
            'Gold Membership', # ag_name
            Paymentwall::Product::TYPE_SUBSCRIPTION, # ag_type
            1, # ag_period_length
            Paymentwall::Product::PERIOD_TYPE_MONTH, # ag_period
            true # recurring
        )
    ],
    {
        'email' => 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' => 'all', # Replace it with specific payment system short code for single payment methods
        'additional_param_name' => 'additional_param_value'
    }
)
puts widget.getUrl()

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_GOODS)
Paymentwall.set_app_key('YOUR_PROJECT_KEY')
Paymentwall.set_secret_key('YOUR_SECRET_KEY')

product = Product(
    'product301',              # id of the product in your system 
    12.12,                     # price
    'USD',                     # currency code
    'test',                    # product name
    Product.TYPE_SUBSCRIPTION, # this is a time-based product
    1,                         # duration is 1
    Product.PERIOD_TYPE_WEEK,  #               week
    True                       # recurring
)

widget = Widget(
    'user4522', # uid
    'p1', # widget
    [product], 
    {
        'email' : 'user@hostname.com',
        'history[registration_date]' => 'registered_date_of_user',
        'ps' : 'all', # Replace it with specific payment system short code for single payment methods
        'additional_param_name' : 'additional_param_value'
    }
)
print(widget.get_url())

Endpoint

GET https://payments.terminal3.com/api/subscription

Sample Request

using Paymentwall;

Paymentwall_Base.setApiType(Paymentwall_Base.API_GOODS);
Paymentwall_Base.setAppKey("YOUR_PROJECT_KEY"); 
Paymentwall_Base.setSecretKey("YOUR_SECRET_KEY");

List<Paymentwall_Product> productList = new List<Paymentwall_Product>();
Paymentwall_Product product = new Paymentwall_Product(
    "product301", // ag_external_id
    9.99, // amount
    "USD", // currencyCode
    "Gold Membership", // ag_name
    Paymentwall_Product.TYPE_SUBSCRIPTION, // ag_type
    1, // ag_period_length
    Paymentwall_Product.PERIOD_TYPE_YEAR, // ag_period_type
    true // ag_recurring
);
productList.Add(product);
Paymentwall_Widget widget = new Paymentwall_Widget(
    "user40012", 
    "p1", 
    productList,
    new Dictionary<string, string>() {
        {
            'email' => 'user@hostname.com',
            'history[registration_date]' => 'registered_date_of_user',
            'ps' => 'all', // Replace it with specific payment system short code for single payment methods
            'additional_param_name' => 'additional_param_value'
        }
    }
);
Response.Write(widget.getUrl());

Endpoint

GET https://payments.terminal3.com/api/subscription

User Profile

This is a list of additional risk parameters that can be used for risk scoring and risk assessment in order to prevent fraudulent payments. The risk parameters can be passed along with parameters in either widget API or checkout API for Terminal3 Payments to account for the relevant merchant data when calculating the risk score and during risk review by Terminal3 Payments risk agents.


At the point when an end-user wishes to make a payment, his registration details may be passed to Terminal3 Payments that provides payment processing services, in order for Terminal3 Payments to better protect service and end-users from unauthorized payments.

Parameters
Name Description
customer[birthday]
string
Unix timestamp of user’s birthday, seconds since Jan 01 1970.
customer[sex]
string
Male or female.
customer[username]
string
Username on the website, if applicable and different from uid parameter.
customer[firstname]
string
Given name of the user.
customer[lastname]
string
Family name of the user.
customer[city]
string
City name.
customer[state]
string
State/province name.
customer[address]
string
The address of customer.
customer[country]
string
Country code, ISO 3166-1 alpha-2, e.g. DE.
customer[zip]
string
ZIP/postal code.
history[membership]
string
Type of membership or loyalty program status at the time right before the payment is being made, if applicable. E.g.: no, gold, silver. Alternatively, in-game level can be passed in format 15/100 (15 out of 100).
history[membership_date]
string
Unix timestamp of last membership update.
history[registration_date]
string
Unix timestamp of the registration date.
history[registration_country]
string
Country code of the country used for the registration, ISO 3166-1 alpha-2.
history[registration_age]
string
Age used for the registration.
history[registration_ip]
string
IP address used for the registration.
history[registration_email]
string
Email address used for the registration.
history[registration_email_verified]
string
Whether the user is verified. 0 or 1.
history[registration_name]
string
First name(s) used for the registration.
history[registration_lastname]
string
Last name(s) used for the registration.
history[registration_source]
string
Identifier of the source where the registration is coming from; use cases: affiliate, referrer, website banner; example: history[registration_source]=affiliate_4312.
history[logins_number]
string
The times of logins since registration date.
history[payments_number]
string
The count of of successful payments made.
history[payments_amount]
string
Cumulative payments by the user converted into USD.
history[followers]
string
Followers, subscribers, friends and etc.
history[messages_sent]
string
The count of messages sent to other users.
history[messages_sent_last_24hours]
string
The count of messages sent to other users in the last 24 hours.
history[messages_received]
string
The count of messages received from other users.
history[interactions]
string
The count of people the user interacted with in total.
history[interactions_last_24hours]
string
The count of people the user interacted with in the last 24 hours.
history[customer_rating]
string
Customer rating out of 100, assigned by provider company or its members.
history[risk_score]
recommend
string
Fraud score or risk score within your system if applicable. varies from 0 to 100 where 0 is the most reliable user and 100 is the most fraudulent.
history[complaints]
string
Number of cases when the user had a complaint.
history[was_banned]
recommend
string
1 or 0 if the user was ever banned.
history[delivered_products]
string
The count of successfully delivered products (if applicable).
history[cancelled_payments]
string
The count of cancelled payments during user’s lifetime if any.

Optional

Optional parameters could be added as additional parameters in either widget API or checkout API for extra needs.

Parameters
Name Description
success_url
string
URL of the page where the end-user should be redirected to after the payment is complete. Additionally, $ref can be added as a placeholder in success_url to pass transaction id. E.g. https://website.com/thank-you?transaction_id=$ref
failure_url
string
URL of the page where the end-user should be redirected to after the payment is failed. It is used when the payment cannot be completed. For credit card, user won’t be redirected to the failure_url page as he may solve some errors by using another card.
pingback_url
string
Optional URL of pingback listener script where pingbacks should be sent. It overrides the default Pingback URL which sets up in Project Settings in Merchant Area. Please send request to devsupport@paymentwall.com for activating this feature.
lang
string
Language code to override the default geo-targeted language of the widget. 2 letters. eg: en. See language codes.
evaluation
integer
The value could be either 1 or 0. For test environment only.
If 1, everyone can see the content without being logged into the merchant account in the same browser session.
country_code
string
The length must be 2-character according to ISO 3166-1 alpha-2 code of the country. Required to be in uppercase. It overrides the location detected by ip.
merchant_order_id
string
When we get a request of checkout API, merchant-order-id is checked. If it is the same, we will warn users that the transaction has been made. Using merchant_order_id can help you to prevent duplicate orders. Please send email to devsupport@paymentwall.com to request for this feature.

Onetime token

Only PCI DSS certificated merchants can use this API, which can help you to obtain one-time token without using Brick.js, but it will NOT return fingerprint.

browser_ip and browser_domain are required to replace fingerprint in this case.

Parameters
name description
public_key
required
string
The project key which can be found in Merchant Area→ My Projects.
card[number]
required
number
User’s Card number, the max length should be 16 digits.
card[exp_month]
required
number
Expiration month, 2 digits from 01 to 12.
card[exp_year]
required
number
Expiration year, 4 digits.
card[cvv]
required
number
CVC/CVV, 3-4 digits depends on the type of credit cards.

An error object will be returned if there is any mistakes in your request, refer to error codes and find solutions accordingly.

Endpoint

 POST https://pwgateway.com/api/token (Live environment)
 
 POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Sample Request

<?php
$tokenModel = new Paymentwall_OneTimeToken();
$token =  $tokenModel->create(array(
    'public_key' => 'YOUR_PUBLIC_KEY',
    'card[number]' => '4242424242424242',
    'card[exp_month]' => '11',
    'card[exp_year]' => '19',
    'card[cvv]' => '123'
));
// send token to charge via $token->getToken();
?>

Endpoint

 POST https://pwgateway.com/api/token (Live environment)
 
 POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Sample Request

var onetimetoken = new Paymentwall.Onetimetoken(
    4000000000000002, // Card number
    01,               // Expiration month
    2020,             // Expiration year
    123               // CVC/CVV
);

onetimetoken.createOnetimetoken(function(response){
    if(response.isSuccessful()){
        if(response.isActivated()){
            token = response.getOnetimeToken();
            card = response.getCardInfo();
        }
    } else{
        error_code = response.getErrorCode();
        error_details = response.getErrorDetails();
    };
});

Endpoint

 POST https://pwgateway.com/api/token (Live environment)
 
 POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Sample Request

OneTimeToken token = new OneTimeToken();
token = (OneTimeToken) token.create(new LinkedHashMap<String, String>(){{
    put("public_key", Config.getInstance().getPublicKey());
    put("card[number]", "4000000000000002");
    put("card[exp_month]", "01");
    put("card[exp_year]", "2020");
    put("card[cvv]", "123");
}});
return token.getToken();

Endpoint

POST https://pwgateway.com/api/token (Live environment)
 
POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Endpoint

POST https://pwgateway.com/api/token (Live environment)
 
POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Endpoint

POST https://pwgateway.com/api/token (Live environment)
 
POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Endpoint

 POST https://pwgateway.com/api/token (Live environment)
 
 POST https://payments.terminal3.com/api/brick/token (Sandbox environment)

Sample Request

curl https://pwgateway.com/api/token \
-d "public_key=YOUR_PUBLIC_KEY" \
-d "card[number]=4000000000000002" \
-d "card[exp_month]=01" \
-d "card[exp_year]=2021" \
-d "card[cvv]=123"

The onetime token object

Attributes
name description
type Object type.
token Value of one time token.
expires_in The remaining time before onetime token expiration, in seconds.
active Whether this token is activated.
card[type] The type of credit cards, could be Visa, Mastercard, Amex, etc.
card[last4] The last 4 digits of credit cards.
card[bin] First 6 digits of credit cards.
card[exp_month] The expire month of user’s credit card.
card[exp_year] The expire year of user’s credit card.

Sample onetime token

{  
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{  
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Sample onetime token

{    
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{    
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Sample onetime token

{    
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{    
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Sample onetime token

{    
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{    
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Sample onetime token

{    
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{    
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Sample onetime token

{    
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{    
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Sample onetime token

{    
    "type":"token",
    "token":"ot_f1e69de76a2eeeefa7532d4301609497",
    "expires_in":290,
    "active":1,
    "card":{    
        "type":"Visa",
        "last4":"0002",
        "bin":"400000",
        "exp_month":"01",
        "exp_year":"2020"
    }
}

Charge

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users.

Parameters
Name Description
amount
required
number
Amount to be charged. The minimum transaction limit is USD 0.3 or equivalent in other currencies.. 2 decimal places is expected.
currency
required
string
Code of the currency, Refer to currency codes.
browser_ip
string
IP address of End-user.
browser_domain
string
Domain of the website where the payment is originating.
description
required
string
Description for the payment.
email
required
string
Email of end-users.
history[registration_date]
required
history[registration_date]
Unix timestamp of the transaction date. Length limitation is 10.
fingerprint
required
string
Unique fingerprint generated by Terminal3 Payments for each transaction. If Brick.js is used, parameter brick_fingerprint will be sent to your backend directly.
You can not obtain brick_fingerprint if Brick.js is not used. In this case, fingerprint is no longer required, you need to use browser_ip and browser_domain instead. E.g. Mobile SDK, onetime token API
token
required
string
The value of One-time token or permanent token.
customer[firstname]
required
string
The first name of card holder.
customer[lastname]
required
string
The last name of card holder.
lang
string
Language code for email receipt localization, format ISO alpha-2, supported languages.
options[capture]
boolean
Whether or not to immediately capture the charge. Default is true. If you don’t want to capture it at once, you can pass options[capture]=0.
plan
required
string
Identifies the product ID, send back as goodsid parameter in pingbacks.
store_card
boolean
Whether to tokenize credit card details for subsequent purchases and return Permanent Token parameter in charge object. Default value is 1.
uid
string
End user id in merchant system. If you pass it to us, we will send it back as uid parameter in pingbacks. If omitted, email will be the value of uid parameter in pingbacks.
custom
array
Parameters defined by merchant in request. To receive these values via pingbacks, please add custom pingback parameter with name=custom and value=OWN.
secure_redirect_url
string
For 3D Secure payments: URL of the billing page where brick_secure_token and brick_charge_id should be sent via POST after the user completes 3D Secure step. It is recommended to embed brick_fingerprint and brick_token into this URL along with the order ID to subsequently pass them into the Charge.
secure_token
string
3D Secure token returned to the website after the user completing the 3D Secure step. Required for submitting additional information after 3D Secure step.
charge_id
string
ID of the transaction which is generated by 3D secure step.
secure
boolean
3D Secure flow is enforced if secure=1 is passed.
recurring
boolean
Required when building your own recurring billing system, please contact integration@paymentwall.com to activate related settings
Value: recurring=1
recurring_id
string
Required when building your own recurring billing system, please contact integration@paymentwall.com to activate related settings
Value: ref id of initial charge request.
Please pass the parameter for every recurring charge request (initial charge request is excluded).

An error object will be returned if there is any mistakes in your request, refer to error codes and find solutions accordingly.

Endpoint

POST https://payments.terminal3.com/api/brick/charge

Sample Request

<?php
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));

$parameters = $_POST;
$chargeInfo = array(
    'email' => $parameters['email'],
    'history[registration_date]' => '1489655092',
    'amount' => 9.99,
    'currency' => 'USD',
    'token' => $parameters['brick_token'],
    'fingerprint' => $parameters['brick_fingerprint'],
    'description' => 'Order #123'
);

$charge = new Paymentwall_Charge();
$charge->create($chargeInfo);
?>

Endpoint

POST https://payments.terminal3.com/api/brick/charge

Sample Request

// We are using Express framework in this sample

var Paymentwall = require('paymentwall');
Paymentwall.Configure(                                                        
    Paymentwall.Base.API_GOODS,
    'YOUR_PUBLIC_KEY',
    'YOUR_PRIVATE_KEY'
);

//custom parameters
var custom = {
    'YOUR_CUSTOM_PARAMETER_NAME': 'YOUR_CUSTOM_PARAMETER_VALUE'
};

var parameters = req.body;
var charge = new Paymentwall.Charge(
    0.5, //price
    'USD', //currency code
    'description', //description of the product
    req.body.email, // user's email
    req.body.brick_fingerprint, // fingerprint generated by Brick.js
    req.body.brick_token, //one-time token
    custom 
);

charge.createCharge(function(brick_response){ }

Endpoint

POST https://payments.terminal3.com/api/brick/charge

Sample Request

Config.getInstance().setPublicKey("YOUR_APPLICATION_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

LinkedHashMap<String,String> chargemap = new LinkedHashMap<String, String>();
chargemap.put("token", request.getParameter("brick_token"); 
chargemap.put("email", "test@paymentwall.com");
chargemap.put("currency", "USD");
chargemap.put("amount", "9.99");
chargemap.put("fingerprint", request.getParameter("brick_fingerprint"));
chargemap.put("description", "description");
chargemap.put("additional_parameter_name", "additonal_parameter_value");
Charge charge = new Charge();
charge = (Charge)charge.create(chargemap);

Endpoint

POST https://payments.terminal3.com/api/brick/charge

Endpoint

POST https://payments.terminal3.com/api/brick/charge


Void a charge

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Endpoint

POST https://payments.terminal3.com/api/brick/charge


Void a charge

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Endpoint

POST https://payments.terminal3.com/api/brick/charge

Sample Request

curl https://payments.terminal3.com/api/brick/charge \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \
-d "token=[TOKEN]" \
-d "amount=9.99" \
-d "currency=USD" \
-d "email=user@host.com" \
-d "fingerprint=[FINGERPRINT_BY_BRICK.JS]" \
-d "description=TestItem"


Void a Charge

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Sample Request

curl https://payments.terminal3.com/api/brick/charge/t123456/void \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \

The charge object

Attributes
Name Description
amount Price of product.
amount_paid Payment amount. It Depends on what currency enduser is billed.
captured Whether the payment is captured.
card[country] Country of where user’s credit card is issued.
card[exp_month] Expiration month of user’s credit card.
card[exp_year] Expiration year of user’s credit card.
card[name] Credit card holder name.
card[token] Permanent token. Refer to guide of permanent token.
card[type] Credit card type.
created Time when charge object is created, in unix timestamp.
currency Currency of product.
currency_paid Currency of end-user payment.
id ID of charge object.
refunded Whether the payment is refunded.
risk Whether the payment is approved by Terminal3 Payments risk system.
secure Whether 3D Secure is applied.
support_link The link to get help for payment.

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Sample charge object

{
    "amount": "9.99",
    "amount_paid": "8.96",
    "captured": false,
    "card": {
        "country": "US",
        "exp_month": "12",
        "exp_year": "2019",
        "last4": "9999",
        "name": "John Doe",
        "token": "2857a8cefec761ef7cdb3f97abf4c7b1",
        "type": "Visa"
    },
    "created": 1482314785,
    "currency": "USD",
    "currency_paid": "EUR",
    "id": "104872652",
    "object": "charge",
    "refunded": false,
    "risk": "approved",
    "secure": false,
    "support_link": "https://payments.terminal3.com/api/account/email-viewer?..."
}

Obtain charge details

Obtain a created charge details by using chargeid.

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
chargeid
required
string
The id of created charge object.

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));
$charge = new Paymentwall_Charge($chargeid);
$charge->get();
$response=$charge->getRawResponseData();
echo $response;
?>

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Sample Request

var charge = new Paymentwall.Charge();
charge.otherOperation(chargeid,'detail',function(brick_response){
    brick_response.getFullResponse('JSON');
});

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Endpoint

GET https://payments.terminal3.com/api/brick/charge/$chargeid

Sample Request

curl https://payments.terminal3.com/api/brick/charge/[chargeId] \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \

Refund a charge

Refund a charge by using its chargeid.

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
chargeid
required
string
The id of created charge object.

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));
$charge = new Paymentwall_Charge($chargeid);
$charge->refund();
$response=$charge->getPublicData();
echo $response;
?>

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Sample Request

var charge = new Paymentwall.Charge();
charge.otherOperation(chargeid,'refund',function(brick_response){
    brick_response.getFullResponse('JSON');
});

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Sample Request

import import com.paymentwall.java.Charge;

Charge charge = new Charge("CHARGE_ID");
charge = (Charge)charge.refund();
return charge.isRefunded();

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/refund

Sample Request

curl https://payments.terminal3.com/api/brick/charge/[chargeId]/refund \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \

Capture a charge

Capture the pre-authorization funds for a created charge. Refer to authorize and capture.

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
chargeid
required
string
The id of created charge object.

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));
$charge = new Paymentwall_Charge($chargeid);
$charge->capture();
$response=$charge->getPublicData();
echo $response;
?>

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Sample Request

var charge = new Paymentwall.Charge();
charge.otherOperation(chargeid,'capture',function(brick_response){
    brick_response.getFullResponse('JSON');
});

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/capture

Sample Request

curl https://payments.terminal3.com/api/brick/charge/t123456/capture \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \

Void a charge

Void the pre-authorization funds for a created charge.

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
chargeid
required
string
The id of created charge object.

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));
$charge = new Paymentwall_Charge($chargeid);
$charge->void();
$response=$charge->getPublicData();
echo $response;
?>

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Sample Request

var charge = new Paymentwall.Charge();
charge.otherOperation(chargeid,'void',function(brick_response){
    brick_response.getFullResponse('JSON');
});

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Endpoint

POST https://payments.terminal3.com/api/brick/charge/$chargeid/void

Subscription

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
amount
required
number
Amount to be charged. The minimum transaction limit is USD 0.3 or equivalent in other currencies.. 2 decimal places is expected.
currency
required
string
Code of the currency. Refer to currency codes.
browser_ip
string
IP address of End-user.
browser_domain
string
Domain of the website where the payment is originating from.
description
required
string
Description for the payment.
email
required
string
Email of end-users.
history[registration_date]
required
history[registration_date]
Unix timestamp of the transaction date. Length limitation is 10.
fingerprint
required
string
Unique fingerprint generated by Terminal3 Payments for each transaction. If Brick.js is used, parameter brick_fingerprint will be sent to your backend directly.
You can not obtain brick_fingerprint if Brick.js is not used. In this case, fingerprint is no longer required, you need to use browser_ip and browser_domain instead. E.g. Mobile SDK, onetime token API
token
required
string
The value of one-time token or permanent token.
customer[firstname]
required
string
The first name of card holder.
customer[lastname]
required
string
The last name of card holder.
lang
string
Language code for email receipt localization, format ISO alpha-2, supported languages.
options[capture]
boolean
Whether or not to immediately capture the charge. Default is true. If you don’t want to capture it at once, you can pass options[capture]=0.
plan
required
string
Identifies the product ID, send back as goodsid parameter in pingbacks.
period
required
string
day/week/month/year
period_duration
required
number
Number of periods mentioned in the period parameter. By default minimum duration for recurring is 3 days. This can be adjusted by contacting devsupport@paymentwall.com.
trial[amount]
number
Trial amount. Free trials are also supported, please contact devsupport@paymentwall.com to have free trials active for your account
trial[currency]
string
Currency code of trail product.
trial[period]
number
Trial recurring period
trial[period_duration]
string
Trial recurring period duration. By default minimum duration is 3 days. This can be adjusted by contacting devsupport@paymentwall.com
uid
string
End user id in merchant system. If you pass it to us, we will send it back as uid parameter in Pingbacks. If omitted, email will be the value of uid parameter in Pingbacks.
custom
array
Parameters defined by merchant in request.To receive these values via Pingbacks, please add custom pingback parameter with name=custom and value=OWN.
tokidoki
boolean
For using TokiDoki recurring billing engine that supports more features such as dunning management, custom email reminders please pass tokidoki=1

An error object will be returned if there is any mistakes in your request, refer to error codes and find solutions accordingly.

Endpoint

POST https://payments.terminal3.com/api/brick/subscription

Sample Request

<?php
Paymentwall_Config::getInstance()->set(array(
    'public_key' => 'YOUR_PUBLIC_KEY',
    'private_key' => 'YOUR_PRIVATE_KEY'
));

$parameters = $_POST;
$subscriptionInfo = array(
    'token' => $_POST['brick_token'],
    'email' => $_POST['email'],
    'currency' => 'USD',
    'amount' => 10,
    'fingerprint' => $_POST['brick_fingerprint'],
    'plan' => 'product_123',
    'description' => 'Order #123',
    'period' => 'week',
    'period_duration' => 2,
    // for using the TokiDoki Recurring Billing
    'tokidoki' => 1, 
    // if trial, add following parameters
    'trial[amount]' => 1,
    'trial[currency]' => 'USD',
    'trial[period]'   => 'month',
    'trial[period_duration]' => 1
);

$subscription = new Paymentwall_Subscription();
$subscription->create($subscriptionInfo);
?>

Endpoint

POST https://payments.terminal3.com/api/brick/subscription

Sample Request

// We are using Express framework in this sample

var Paymentwall = require('paymentwall');
Paymentwall.Configure(                                                        
    Paymentwall.Base.API_GOODS,
    'YOUR_PUBLIC_KEY',
    'YOUR_PRIVATE_KEY'
);

//custom parameters
var custom = {
    'plan': 'product_123', // your product id
    'YOUR_CUSTOM_PARAMETER_NAME': 'YOUR_CUSTOM_PARAMETER_VALUE'
};

var trial = {
    amount: 0.5,
    currency: 'USD',
    period: 'day',
    period_duration: 3
}

var parameters = req.body;
var subscription = new Paymentwall.Subscription(
    0.5, //price
    'USD', //currency code
    'description', //description of the product
    req.body.email, // user's email
    req.body.brick_fingerprint, // fingerprint generated by Brick.js
    req.body.brick_token, //one-time token
    'week', // period
    2, // period_duration
    trial,
    custom 
);

subscription.createSubscription(function(brick_response){
    // Handle response
});

Subscription Request
Endpoint

POST https://payments.terminal3.com/api/brick/subscription

Sample Request

Config.getInstance().setPublicKey("YOUR_APPLICATION_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

LinkedHashMap<String, String> subscriptionmap = new LinkedHashMap<String, String>();

subscriptionmap.put("token", request.getParameter("brick_token"));
subscriptionmap.put("email", request.getParameter("email"));
subscriptionmap.put("currency", "USD");
subscriptionmap.put("amount", "9.99");
subscriptionmap.put("description", "YOUR-DESCRIPTION");
subscriptionmap.put("fingerprint", request.getParameter("brick_fingerprint"));
subscriptionmap.put("plan", "YOUR-PRODUCT-ID");
subscriptionmap.put("period", "week");
subscriptionmap.put("period_duration", "1");

subscriptionmap.put("trail[amount]", "0.5");
subscriptionmap.put("trail[currency]", "USD");
subscriptionmap.put("trail[period]", "day");
subscriptionmap.put("trail[period_duration]", "3");
Subscription subscription = new Subscription();
subscription = (Subscription) subscription.create(subscriptionmap);


Cancel a Subscription

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Code Sample

Subscription subscription = new Subscription("SUBSCRIPTION_ID");
    subscription = (Subscription)(subscription.cancel());
return subscription.isActive();

Endpoint

POST https://payments.terminal3.com/api/brick/subscription


Cancel a Subscription

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Endpoint

POST https://payments.terminal3.com/api/brick/subscription


Cancel a Subscription

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Subscription Request
Endpoint

POST https://payments.terminal3.com/api/brick/subscription


Get Subscription details

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id


Cancel a Subscription

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Subscription request

Endpoint

POST https://payments.terminal3.com/api/brick/subscription

Sample Request

curl https://payments.terminal3.com/api/brick/subscription \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \
-d "token=[TOKEN]" \
-d "email=user@host.com" \
-d "history[registration_date]=1489655092"
-d "currency=USD" \
-d "amount=10" \
-d "fingerprint=[FINGERPRINT_BY_BRICK.JS]" \
-d "description=Order #123" \
-d "plan=product_123" \
-d "period=week" \
-d "period_duration=2"

The subscription object

The array trial will be included in if trial product is enabled for its post-trial subscription.

Attributes
Name Description
active Whether the subscription is activated.
charges The charge ids in history payments.
date_next Next charge date, in unix timestamp.
date_started Subscription start date, in unix timestamp.
expired Whether the subscription is expired.
id Subscription id.
is_trial Whether the subscription is in trial period.
object Object type.
payments_limit The remaining recurring billing time.
period The subscription period, could be day/week/month.
period_duration Length of subscription period.
started Whether the subscription is started.
trial[active] Whether the trial period is activated.
trial[date_next] Next charge date, in unix timestamp.
trial[date_started] Trial period start date, in unix timestamp.
trial[expired] Whether the subscription is expired.
trial[id] Subscription id.
trial[is_trial] Whether the subscription is in trial period.
trial[object] Object type.
trial[payments_limit] The remaining recurring billing time of trial product.
trial[period] The trial period, could be day/week/month.
trial[period_duration] Length of trial period.
trial[started] Whether the trial period is started.

Subscription response object example

{
    "active": 1,
    "charges": {
        "0": "49393608",
        "1": "49393609"
    },
    "date_next": 1419784432,
    "date_started": 1419525232,
    "expired": 0,
    "id": "VCBZT392SW",
    "is_trial": 0,
    "object": "subscription",
    "payments_limit": 0,
    "period": "day",
    "period_duration": 3,
    "started": 1
}

Subscription object example for trail product

{
    "trial": {
        "active": 0,
        "date_next": 1419525232,
        "date_started": 1419438832,
        "expired": 1,
        "id": "VCBZT392SW",
        "is_trial": 1,
        "object": "subscription",
        "payments_limit": 1,
        "period": "day",
        "period_duration": 1,
        "started": 1
    }
}

Subscription response object example

{
  "active": 1,
  "charges": {
    "0": "49393608",
    "1": "49393609"
  },
  "date_next": 1419784432,
  "date_started": 1419525232,
  "expired": 0,
  "id": "VCBZT392SW",
  "is_trial": 0,
  "object": "subscription",
  "payments_limit": 0,
  "period": "day",
  "period_duration": 3,
  "started": 1
}

Subscription object example for trail product

{
  "trial": {
    "active": 0,
    "date_next": 1419525232,
    "date_started": 1419438832,
    "expired": 1,
    "id": "VCBZT392SW",
    "is_trial": 1,
    "object": "subscription",
    "payments_limit": 1,
    "period": "day",
    "period_duration": 1,
    "started": 1
  }
}

Subscription response object example

{
    "active": 1,
    "charges": {
        "0": "49393608",
        "1": "49393609"
    },
    "date_next": 1419784432,
    "date_started": 1419525232,
    "expired": 0,
    "id": "VCBZT392SW",
    "is_trial": 0,
    "object": "subscription",
    "payments_limit": 0,
    "period": "day",
    "period_duration": 3,
    "started": 1
}

Subscription object example for trail product

{
    "trial": {
        "active": 0,
        "date_next": 1419525232,
        "date_started": 1419438832,
        "expired": 1,
        "id": "VCBZT392SW",
        "is_trial": 1,
        "object": "subscription",
        "payments_limit": 1,
        "period": "day",
        "period_duration": 1,
        "started": 1
    }
}

Subscription response object example

{
    "active": 1,
    "charges": {
        "0": "49393608",
        "1": "49393609"
    },
    "date_next": 1419784432,
    "date_started": 1419525232,
    "expired": 0,
    "id": "VCBZT392SW",
    "is_trial": 0,
    "object": "subscription",
    "payments_limit": 0,
    "period": "day",
    "period_duration": 3,
    "started": 1
}

Subscription object example for trail product

{
    "trial": {
        "active": 0,
        "date_next": 1419525232,
        "date_started": 1419438832,
        "expired": 1,
        "id": "VCBZT392SW",
        "is_trial": 1,
        "object": "subscription",
        "payments_limit": 1,
        "period": "day",
        "period_duration": 1,
        "started": 1
    }
}

Subscription response object example

{
    "active": 1,
    "charges": {
        "0": "49393608",
        "1": "49393609"
    },
    "date_next": 1419784432,
    "date_started": 1419525232,
    "expired": 0,
    "id": "VCBZT392SW",
    "is_trial": 0,
    "object": "subscription",
    "payments_limit": 0,
    "period": "day",
    "period_duration": 3,
    "started": 1
}

Subscription object example for trail product

{
    "trial": {
        "active": 0,
        "date_next": 1419525232,
        "date_started": 1419438832,
        "expired": 1,
        "id": "VCBZT392SW",
        "is_trial": 1,
        "object": "subscription",
        "payments_limit": 1,
        "period": "day",
        "period_duration": 1,
        "started": 1
    }
}

Subscription response object example

{
    "active": 1,
    "charges": {
        "0": "49393608",
        "1": "49393609"
    },
    "date_next": 1419784432,
    "date_started": 1419525232,
    "expired": 0,
    "id": "VCBZT392SW",
    "is_trial": 0,
    "object": "subscription",
    "payments_limit": 0,
    "period": "day",
    "period_duration": 3,
    "started": 1
}

Subscription object example for trail product

{
    "trial": {
        "active": 0,
        "date_next": 1419525232,
        "date_started": 1419438832,
        "expired": 1,
        "id": "VCBZT392SW",
        "is_trial": 1,
        "object": "subscription",
        "payments_limit": 1,
        "period": "day",
        "period_duration": 1,
        "started": 1
    }
}

Subscription response object example

{
    "active": 1,
    "charges": {
        "0": "49393608",
        "1": "49393609"
    },
    "date_next": 1419784432,
    "date_started": 1419525232,
    "expired": 0,
    "id": "VCBZT392SW",
    "is_trial": 0,
    "object": "subscription",
    "payments_limit": 0,
    "period": "day",
    "period_duration": 3,
    "started": 1
}

Subscription object example for trial product

{
    "trial": {
        "active": 0,
        "date_next": 1419525232,
        "date_started": 1419438832,
        "expired": 1,
        "id": "VCBZT392SW",
        "is_trial": 1,
        "object": "subscription",
        "payments_limit": 1,
        "period": "day",
        "period_duration": 1,
        "started": 1
    }
}

Obtain subscription details

Obtain a created charge details by using subscriptionid.

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
subscriptionid
required
string
The id of created subscription object.

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));
$subscription = new Paymentwall_Subscription($subscriptionid);
$subscription->get();
$response=$subscription->getRawResponseData();
echo $response;
?>

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Sample Request

var subscription = new Paymentwall.Subscription();
subscription.otherOperation(subscriptionid,'detail',function(response){
    response.getFullResponse('JSON');
});

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Endpoint

GET https://payments.terminal3.com/api/brick/subscription/$id

Sample Request

curl https://payments.terminal3.com/api/brick/subscription/[subscriptionid] \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \

Cancel a subscription

Cancel an active subscription using subscriptionid.

The Private API key is expected to be sent as the value of custom HTTPS header X-ApiKey by using this API. It can only be used for server-to-server calls and should never be exposed to end-users. You will have it been accomplished automatically if you are using our API libraries.

Parameters
Name Description
subscriptionid
required
string
The id of created subscription object.

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => 'YOUR_PRIVATE_KEY'
));
$subscription = new Paymentwall_Subscription($subscriptionid);
$subscription->cancel();
$response=$subscription->getPublicData();
echo $response;
?>

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Sample Request

var subscription = new Paymentwall.Subscription();
subscription.otherOperation(subscriptionid,'cancel',function(response){
    // response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
    response.getFullResponse('JSON');
});

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Endpoint

POST https://payments.terminal3.com/api/brick/subscription/$id/cancel

Sample Request

curl https://payments.terminal3.com/api/brick/subscription/[subscriptionid]/cancel \
-H "X-ApiKey: [YOUR_PRIVATE_KEY]" \

Get token

Get token API is for you to get the token for the transactions with Mobiamo

To activate it please email us at devsupport@paymentwall.com.

Parameter
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
sign_version
required
string
The signature version. Version 2 uses MD5 and version 3 represents SHA256.
ts
required
string
Unix timestamp when the request was initiated, in seconds.
sign
required
string lowercase
The signature of request. Refer to signature calculation for more details.

Get token response

Attributes
Name Description
success Status of the request. Either true or false
token The API token. This will be attached in the header in the next requests.
expire_time The validation period of the token. If the token is invalid or expired, you must call this API again to get the new token.

Endpoint:

POST https://payments.terminal3.com/api/mobiamo/token

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$mobiamo = new Paymentwall_Mobiamo();
$tokenParams = [
	'uid' => 'test'
]

$response = $mobiamo->getToken($tokenParams);
$token = $response['token'];
// store this token to use for next requests
?>

Sample Response

{
    "success": true,
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MDM2NDQ3NzIsImp0aSI6Ik5IcWN0QjZEbGR3bjNmQWxSZ1VuXC8zWkRhQjI1R1dvZlpSelJcL0JMYzNhTT0iLCJleHAiOjE1MDM3MzExNzIsImRhdGEiOnsibWVyY2hhbnRJZCI6IjIiLCJ0aW1lc3RhbXAiOiIxNTAzNjQ0NzEzIiwicHJvamVjdF9pZCI6IjE4MjgxNSJ9fQ.R5jLTYV23qRDaMbHZlun6MDFbWfK9xXTMzPIzNglr0A",
    "expire_time": 86400
}

Initiate payment

This API is to initate the payment with Mobiamo and get the flow to instruct the users to make payment.

token is expected to be sent as the value of custom HTTP header parameter Token by using this API.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
amount
required
double
The amount of your product. It should be set according to the price points.
currency
required
string
Currency code of your product. Needs to be used along with amount. 3 letters. Refer to currency codes.
country
required
string
Country code in ISO 3166-1 alpha-2 format.
product_name
required
string
Your product name. The maximum length is 256.
product_id
required
string
ID of your product. We will communicate back to you via the pingback as goodsid parameter. The maximum length is 256.
is_recurring
optional
boolean
Can be either true or false. Whether the product is recurring. By default, recurring billing is only supported for product with duration of at least 3 days and less than 1 year.
period
optional
string
The type of your subscription duration. Required to be set to following types, value: day - week - month.
period_value
optional
integer
The length of your subscription duration.
carrier
optional
string
The ID of the mobile carrier. This parameter is required in some countries. The list of ID can be found in Mobiamo Carriers.
msisdn
optional
string
User’s phone number in international format: [country code] + [mobile number without 0 at the beginning]
mnc
optional
string
Mobile network code. Required along with mcc to identify user’s carrier and provide relevant instructions.
mcc
optional
string
Mobile country code.

Response

Attributes
Name Description
success Status of the request. Either true or false
ref Reference ID of the transaction
flow The flow of how to make payment:
1. code: users send keyword to shortcode in instructions to receive a pin code. Then you send this code in process payment request.
2. msisdn: users enters phone number. The you send this phone number in process payment request.
3. redirect: You need to redirect users to the redirect_url in the instructions.
The flow depends on the country
price An array includes information about the product.
instructions Instruction parameters for users to make payment:
1. Flow code: keyword and shortcode are included
2. Flow redirect: redirect_url is included
error Error description in case of failed request.
code Error code in case of failed request.

Endpoint:

POST https://payments.terminal3.com/api/mobiamo/init-payment

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$mobiamo = new Paymentwall_Mobiamo();
$initParams = [
	'uid' => 'test', 
	'amount' => 2000, 
	'currency' => 'PHP', //currency of payment in ISO 4217 format
	'country' => 'PH', //country of payment in ISO alpha-2 format
	'product_id' => 'product101', //product id of payment
	'product_name' => 'Test Product', //product name of payment
	'carrier' => '255' //mandatory in some countries - Given id of user's operator
];

//token returned from get token step above
$response = $mobiamo->initPayment($token, $initParams);

$ref = $response['ref'];
// store this token to use for next request
?>

Sample Response

{
    "ref": "21180452",
    "flow": "msisdn",
    "instructions": {},
    "price": {
        "amount": 2000,
        "currency": "PHP",
        "formatted": "PHP 2,000.00",
        "carriers": [{
            "id": 255,
            "name": "Globe"
        }]
    },
    "product_name": "coins",
    "success": true
}

Process payment

This API is to process the payment with the data collected from the users.

token is expected to be sent as the value of custom HTTP header parameter Token by using this API.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
ref
required
string
Reference ID of the transaction
flow
required
string
The flow returned from initiate payment request
data
required
string
The data you collect from users
1. Flow code: users’ submitted pin code
2. Flow msisdn: users’ submitted phone number

Response

Attributes
Name Description
success Status of the request. Either true or false
flow The next flow for users to make payment. This is only applicable in certain countries. If it’s empty, transaction is completed
instructions Instruction for users to make payment if applicable.
error Error description in case of failed request.
code Error code in case of failed request.

Endpoint:

POST https://payments.terminal3.com/api/mobiamo/process-payment

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$model = new Paymentwall_Mobiamo();
$processParams = [
	'uid' => 'test', 
	'ref' => $ref, //reference id returned from initiate payment request 
	'flow' => 'msisdn', //flow returned from initiate payment request
	'data' => '6312345678' //value can be: code user received after sending message / phone number of user
];

//token returned from get token step above
$response = $model->processPayment($token, $processParams);
?>

Sample Response

{
    "success": true,
    "instructions": {
        "shortcode": "2800",
        "keyword": "PW2000",
        "info": "VAT included. For customer support, please contact us at support@mobiamo.com"
    },
    "flow": "code" //Only return if this payment requires next processing step. values can be: code - user send keyword to shortcode in instructions/ msisdn - user input phone number / redirect - redirect user to redirect_url in intructions / 	
}

Get transaction details

This API allows you to get the information about the transactions with Mobiamo API

token is expected to be sent as the value of custom HTTP header parameter Token by using this API.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
uid
required
string
ID of the end-user in your system. The maximum length is 64.
ref
required
string
Reference ID of the transaction

Response

Attributes
Name Description
success Status of the request. Either true or false
ref Reference ID of the transaction
completed Whether the transaction has been completed or not. Can be either true or false
amount The price of the product
currency Currency code of the product
country Country code in ISO 3166-1 alpha-2 format of the transaction
product_name The product name
product_id ID of the product
is_recurring Can be either true or false. Whether the product is recurring
period The type of your subscription duration
period_value The length of your subscription duration
error Error description in case of failed request.
code Error code in case of failed request.

Endpoint:

POST https://payments.terminal3.com/api/mobiamo/get-payment

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'public_key' => 'YOUR_PROJECT_KEY',
    'private_key' => 'YOUR_SECRET_KEY'
));

$mobiamo = new Paymentwall_Mobiamo();
$getPaymentParams = [
    'uid' => 'test', 
    'ref' => $ref, //reference id returned from initiate payment request 
];

//token returned from get token step above
$response = $mobiamo->processPayment($token, $getPaymentParams);
?>

Sample Response

{
    "success" => true,
    "completed" => true, //value: true/false - indicate this payment was already successfull or not
    "amount" => 2000,
    "currency" => "PHP",
    "country" => "PH",
    "product_name" => "Test Product",
    "msisdn" => "63123456789",
    "ref" => "w123456789"
}

Pricepoint

Price Points API allows merchants to retrieve the list of mobiamo price points for a country.

Parameters
Name Description
country_code
required
string
Country code in ISO 3166-1 alpha-2 format.
currency_converted
string
Currency code in ISO 4217 format to be used for converting the price point amounts from local currency to the converted currency.
key
required
string
The project key which can be found in Merchant Area→ My Projects.
ps
required
string
The value must be mobiamo.
sign_version
required
integer
Signature version. Version 2 uses MD5 and version 3 uses SHA256.
sign
required
string lowercase
The request signature. Refer to Signature Calculation for more details.

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');

$params = array(
    'country_code'=>'GB',
    'key'=>'YOUR_PROJECT_KEY',
    'ps'=>'mobilegateway', 
    'sign_version'=>2
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    $params['sign_version']
    );

$url = 'https://payments.terminal3.com/api/price-points/?'.http_build_query($params);

$curl = curl_init($url);

curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
$response = curl_exec($curl);
echo $response;
?>

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Endpoint

GET https://payments.terminal3.com/api/price-points/

Sample Response

[{
    "amount": 1,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.14
}, {
    "amount": 1.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 1.7
}, {
    "amount": 2,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.27
}, {
    "amount": 2.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 2.84
}, {
    "amount": 3,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 3.41
}, {
    "amount": 4.5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.11
}, {
    "amount": 5,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 5.68
}, {
    "amount": 10,
    "currency": "GBP",
    "currency_converted": "EUR",
    "amount_converted": 11.36
}]

Generate ePIN

You can use this api to generate ePin if you are a MINT reseller.

Parameters
Parameters Description
auth[key]
required
string
API Public Key
Can be obtained under Settings of the Reseller Account
auth[timestamp]
required
int
Current UNIX time
auth[sign]
required
string
The request signature
Refer to this link for signature algorithm
params[serviceId]
int
ID of the service to generate
Default value is 0, ePIN generated can be used in all services
params[currencyCode]
required
string(3)
ISO 4217 currency code of the ePIN value
params[ePinNominalValue]
required
int
Value of the ePIN
params[ePinsCount]
int
Quantity of the ePINs to generate
Default value is 1.
params[countryCode]
string(2)
ISO 3166-1 alpha-2 code of the country of service
params[activationRequired]
boolean
Can be either 0 or 1
If [1], it generates Inactive ePins. If [0] or omitted, it generates Active ePins.
params[test]
boolean
Can be either 0 or 1.
If [1], you will receive one of test keys to verify the response.

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Request

<?php
$secret = 'YOUR_SECRET_KEY';

$params = array(
    'params[serviceId]' => 0,
    'params[currencyCode]' => 'USD',
    'params[ePinNominalValue]' => 5,
    'params[ePinsCount]' => 1,
    'params[countryCode]' => 'US',
    'params[activationRequired]' => 1,
    'params[test]' => 1
);
$auth = [
    'auth[key]' => 'YOUR_AUTH_KEY',
    'auth[timestamp]' => time()
];
ksort($params);
$auth['auth[sign]'] = md5($auth['auth[key]'] . $auth['auth[timestamp]'] . implode('', $params) . $secret);

$postParams = array_merge($auth, $params);

$post = curl_init();
curl_setopt($post, CURLOPT_URL, 'https://payments.terminal3.com/pwapi/mint');
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $postParams);
$response = curl_exec($post);
echo $response;
?>

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Endpoint

POST  https://payments.terminal3.com/pwapi/partners-mint (MINT app)
POST: https://payments.terminal3.com/pwapi/mint (MINT reseller)

Sample Response

{
    "success": true,
    "data": [{
        "pin_id": 52775,
        "pin_code": "5311 8601 2711 2955",
        "pin_time_expired": 1521796425,
        "pin_generated_time": 1490260425,
        "pin_nominal_value": "5.0000",
        "cu_code": "USD",
        "cu_id": 1,
        "pin_tr_amount": "5.0000"
    }],
    "reference": "186177"
}

Get ePIN balance

Parameters
Parameter Description
auth[key]
required
string
API Public Key
Can be obtained under Settings of the Reseller Account
auth[timestamp]
required
int
Current UNIX time
auth[sign]
required
string
The request signature
Refer to this link for signature algorithm

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Request

<?php
$secret='YOUR_SECRET_KEY';

$params =[];
$auth = [
    'auth[key]' => 'YOUR_AUTH_KEY',
    'auth[timestamp]' => time()
];
$auth['auth[sign]'] = md5($auth['auth[key]'] . $auth['auth[timestamp]'] . implode('', $params) . $secret);

$url = 'https://payments.terminal3.com/pwapi/mint-balances?'.http_build_query($auth);

$curl = curl_init($url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
$response = curl_exec($curl);
echo $response
?>

Sample Response

{
    "success": true,
    "data": [{
        "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Response

{
    "success": true,
    "data": [{
        "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Response

{
    "success": true,
    "data": [{
    "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Response

{
    "success": true,
    "data": [{
        "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Response

{
    "success": true,
    "data": [{
        "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Response

{
    "success": true,
    "data": [{
        "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

Endpoint

GET https://payments.terminal3.com/pwapi/mint-balances

Sample Response

{
    "success": true,
    "data": [{
        "cu_code": "USD",
        "balance_amount": "9944.0655"
    }],
    "reference": "186178"
}

MINT redemption

This API is for merchants to allows users to redeem a MINT ePin.

Parameters
Parameter Description
amount
required
int
The amount of money to pay
currency
required
string
Currency code of the ePIN. Refer to currency codes.
epin
required
array
List of ePINs to redeem
Currently, it is only possible to redeem one ePin at a time.
app_key
required
string
The project key which can be found in Merchant Area→ My Projects.
user_id
required
string
ID of the user in merchant’s system

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Sample Request

<?php
$params = array(
    'amount' => 0.12,
    'currency' => 'USD',
    'epin[0]' => '8661217792834101',
    'app_key' => 'YOUR_PROJECT_KEY',
    'user_id' => 'user101'
);

$post = curl_init();

curl_setopt($post, CURLOPT_URL, 'https://payments.terminal3.com/api/pure-mint/payment');
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($post);

echo $response;
?>

Sample Response

{
    "change_amount" : 0.12,                 
    "change_currency" : "USD",              
    "success" : 1                         
}

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Response

{
    "change_amount" : 0.12,                                 
    "change_currency" : "USD",                            
    "success" : 1                                                 
}

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Response

{
    "change_amount" : 0.12,                 
    "change_currency" : "USD",              
    "success" : 1                         
}

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Response

{
    "change_amount" : 0.12,                 
    "change_currency" : "USD",              
    "success" : 1                         
}

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Response

{
    "change_amount" : 0.12,                                 
    "change_currency" : "USD",                            
    "success" : 1                                                 
}

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Response

{
    "change_amount" : 0.12,                 
    "change_currency" : "USD",              
    "success" : 1                         
}

Endpoint

POST https://payments.terminal3.com/api/pure-mint/payment

Sample Request

curl https://payments.terminal3.com/api/pure-mint/payment \ 
-d "amount=0.12" \
-d "currency=USD" \
-d "epin=[YOUR-EPIN]" \
-d "app_key=[YOUR-PROJECT-KEY]" \
-d "user_id=[YOUR-USER-ID]"

Sample Response

{
    "change_amount" : 0.12,                 
    "change_currency" : "USD",              
    "success" : 1                         
}

Error codes

Codes
Error codes Description
1001 General internal error
1002 Application not loaded
1003 User banned
2001 Empty E-Pin
2002 Empty project key
2003 Wrong amount
2004 Wrong currency
2005 Epin is not array
2006 Empty user id
3001 Mint is not activated for this project
3002 Epin expired
3003 Epin is not activated
3004 Epin duplicate
3005 Epin is not available for this application
3006 Epin is invalid
3007 Only one epin is allowed
3008 Epin tracking failure
3009 Epin insufficient funds
4001 Maximum attempts exceeded

Cancellation

This API allows to issue a request to refund a transaction or to cancel a recurring billing payment. If the response is successful, a ticket will be created under Research and Refund in your account.

Note : If you are using test project key, ticket will not be generated. Please try again with LIVE project key with real transaction.

Parameters
Parameter Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
ref
required
string
Payment reference ID.
Can be obtained from parameter ref in pingback request.
type
required
integer
Type of the ticket:
1. Refund
2. Recurring billing cancellation
3.Others
message
required
string
Description of the ticket, a short instruction about the reason of cancellation is expected.
sign_version
required
integer
Signature version
Version 2 employs MD5 and version 3 uses SHA256.
sign
required
string lowercase
The request signature. Refer to Signature Calculation for more details.
test_mode
integer
Either 0 or 1.
1 means that the API is used in test mode, in this case no real ref is required.
uid
string
ID of end-users in your system. ref is not required if uid is submitted.

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'ref' => 't1234',
    'uid' => 'user40012',
    'sign_version' => 2,
    'type' => 1,
    'message' => 'cancelled order',
    'test_mode' => 1,
    'sign_version' => 2
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    $params['sign_version']
);

$post = curl_init();
curl_setopt($post, CURLOPT_URL, 'https://payments.terminal3.com/developers/api/ticket');
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($post);
echo $response;

Sample Response

{"result":1}

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Response

{"result":1}

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Response

{"result":1}

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Response

{"result":1}

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Response

{"result":1}

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Response

{"result":1}

Endpoint

POST https://payments.terminal3.com/developers/api/ticket

Sample Request

curl https://payments.terminal3.com/developers/api/ticket \
-d "key=[YOUR_PROJECT_KEY]" \
-d "ref=t1234" \
-d "uid=user40012" \
-d "type=1" \
-d "message=cancelled order" \
-d "is_test=1" \
-d "sign_version=2" \
-d "sign=[SIGNATURE]" \

Sample Response

{"result":1}

Coupon

Coupon API allows merchants to create coupons for discounts, promotions and special offers.

Creating a coupon

Parameters
Parameter Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
timestamp
required
int
Current UNIX time
sign
required
string
The Request Signature
All parameters must be put into signature calculation.
You MUST use SHA256 for signature algorithm.
percent_off
required*
int
Discount percentage
Value can be from 1 to 99.
amount_off
required*
int
Discount amount
currency_code
required*
string
ISO 4217 currency code of the discount amount
name
string
Coupon name, default value is null.
number_of_coupons
int
Number of coupons to be created
If multiple coupons are created and code parameter is provided, the coupon will be generated as follows: code+‘random string’.
If there is no code parameter in the request, a ‘random string’ will be generated as the coupon code. Defaul value is 1.
code
string
If number_of_coupons equals to 1, this parameter is the coupon code.
If number_of_coupons is more than 1, coupon codes will be generated using the following algorithm: code + 7 random digits.
activate
boolean
Either 1 or 0
Activating coupon after creating.
max_redemptions
int
The number of times that coupon can be redeemed
expiration_date
int
Coupon expiration date
The expiration_date MUST be greater than the timestamp.

Either percent_off or amount_off should be included in the request, currency_code is required if you are using amount_off.

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'timestamp' => time(),
    'percent_off' => 10,
    'name' => 'Coupon_1',
    'number_of_coupons' => 1,
    'code' => 'TESTCOUPON_1',
    'activate' => 'Yes',
    'max_redemptions' => 1,
    'expiration_date' => '08/20/2017',
    'available_applications' => 'ALL'
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SERCRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    3 //signature version must be 3
);

$post = curl_init();
curl_setopt($post, CURLOPT_URL, 'https://payments.terminal3.com/api/coupon');
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($post);
echo $response;
?>

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 0,
    "max_redemptions": 1,
    "expiration_date": "08\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 0,
    "max_redemptions": 1,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 0,
    "max_redemptions": 1,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Response

{
	"name": "Coupon_1",
	"times_redeemed": 0,
	"max_redemptions": 1,
	"expiration_date": "07\/20\/2017",
	"status": "active",
	"code": "TESTCOUPON_1",
	"currency": null,
	"percent_off": 10,
	"amount_off": null
}

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 0,
    "max_redemptions": 1,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 0,
    "max_redemptions": 1,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

POST https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 0,
    "max_redemptions": 1,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Retrieving information about a coupon

Parameters
Parameter Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
code
required
string
Eg: TESTCOUPON
Code of coupon
history[registration_date]
required
int
eg: 1484900291
Current UNIX time
sign
required
string
The Request Signature
All parameters must be put into signature calculation.
You MUST use SHA256 for signature algorithm.

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

require_once('path/to/lib/paymentwall.php');
$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'code' => 'TESTCOUPON_1',
    'timestamp' => time(),
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    3 //signature version
);

$url = 'https://payments.terminal3.com/api/coupon?'.http_build_query($params);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,TRUE);
$response = curl_exec($curl);
echo $response;
?>

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "08\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Endpoint

GET https://payments.terminal3.com/api/coupon

Sample Response

{
    "name": "Coupon_1",
    "times_redeemed": 1,
    "max_redemptions": 2,
    "expiration_date": "07\/20\/2017",
    "status": "active",
    "code": "TESTCOUPON_1",
    "currency": null,
    "percent_off": 10,
    "amount_off": null
}

Delivery Confirmation

Delivery Confirmation API allows you to notify Terminal3 Payments about successful delivery of the purchased item(s) to the user. This information helps us resolve dispute cases and refund requests in the fastest and the most efficient manner.

The required parameters are different with the type of your products, refer to digital or physical.


This API expects secret key to be sent as custom HTTPS header “X-ApiKey”.

Endpoint

POST https://payments.terminal3.com/api/delivery

Endpoint

POST https://payments.terminal3.com/api/delivery

Endpoint

POST https://payments.terminal3.com/api/delivery

Endpoint

POST https://payments.terminal3.com/api/delivery

Endpoint

POST https://payments.terminal3.com/api/delivery

Endpoint

POST https://payments.terminal3.com/api/delivery

Endpoint

POST https://payments.terminal3.com/api/delivery

Digital

Parameters
Parameter Description
payment_id
required
string
Terminal3 Payments reference ID of the transaction. It can be obtained from parameter ref in pingback request.
merchant_reference_id
required
string
The order ID of the transaction in your system.
type
required
string
Type of delivery, required to be set as digital.
is_test
integer
Can be either 0 or 1. 1 means test API calls.
status
required
string
Refer to Status.
estimated_delivery_datetime
required
date
Estimated delivery date of the order. Format: 2017/01/15 15:04:55 +0500.
estimated_update_datetime
required
date
When the next status is planned to update. Format: 2017/01/16 15:04:55 +0500.
reason
required
string
Additional description for the status updated. It can be set as null if it is not convenient to provide.
refundable
required
string
Either true or false. Whether the order is refundable at this stage.
attachments
required
array
Array attachments of the proofs of delivery. URL of pictures is expected. Could be set as null if it is not convenient to provide.
details
required
string
Description of order status which is showed to Terminal3 Payments and recipient.
product_description
string
Description of the new product in case of subsitution or change.
shipping_address[email]
required
string
The email address of your customers.

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'private_key' => '[YOUR_SECRET_KEY]'
));

$delivery = new Paymentwall_GenerericApiObject('delivery');

$response = $delivery->post(array(
    'payment_id' => 'b63400368',
    'merchant_reference_id' => 'order_12345',
    'type' => 'digital',
    'status' => 'delivered',
    'estimated_delivery_datetime' => '2015/01/15 15:00:00 +0300',
    'estimated_update_datetime' => '2015/01/15 11:00:00 +0300',
    'refundable' => true,
    'details' => 'Item will be delivered via email by 3PM on 2015/01/15',
    'shipping_address[email]' => 'user@hostname.com',
    'reason' => 'none',
    'attachments[0]' => '@/usr/local/www/content/proof/b63400368/1.png',
    'attachments[1]' => '@/usr/local/www/content/proof/b63400368/2.png',
));
if (isset($response['success'])) {
    // delivery status is successfully saved
} elseif (isset($response['error'])) {
    var_dump($response['error'], $response['notices']);
}
?>

Sample Response

{
    "success": 1
}

Sample Request

'use strict';
var HttpAction = require('paymentwall/lib/HttpAction'),
    util = require('util'),
    querystring = require('querystring'),
    ApiObject = require('paymentwall/lib/ApiObject'),
    Paymentwall = require('paymentwall');

Paymentwall.Configure(
    Paymentwall.Base.API_GOODS,
    'YOUR_PROJECT_KEY ',
    'YOUR_SECRET_KEY '
);

var api = new ApiObject();
api.createDeliveryRequest = function() {
    var url = this.BRICK_BASE_URL;
    var method = 'POST';
    var post_options = this.createPostOptions(url, '/api/delivery', method);
    return post_options;
};

var post_options = api.createDeliveryRequest();

var post_data = {
    "payment_id" : "b63400368",
    "merchant_reference_id" : "order_12345",
    "type" : "digital",
    "status" : "delivered",
    "estimated_delivery_datetime" : "2018/08/23 15:00:00 +0300",
    "estimated_update_datetime" : "2018/08/23 11:00:00 +0300",
    "refundable" : true,
    "details" : "Item will be delivered via email by 3PM on 2018/08/23",
    "shipping_address[email]" : "user@hostname.com",
    "reason" : "none",
    "attachments" : {}
};

post_data = querystring.stringify(post_data);

HttpAction.runAction(post_options, post_data, true, function(response) {
    response = response.JSON_chunk;
    if(response.success) {
        // delivery status is successfully saved
    } else if(response.error) {
        console.log(response.error);
        console.log(response.notices);
    }
});

Sample Response

{
    "success": 1
}

Sample Response

{
    "success": 1
}

Sample Response

{
    "success": 1
}

Sample Response

{
    "success": 1
}

Sample Response

{
    "success": 1
}

Sample Request

curl https://payments.terminal3.com/api/delivery \
-H "X-ApiKey: [YOUR_SECRET_KEY]" \
-d "payment_id=b111260108" \
-d "merchant_reference_id=order_12345" \
-d "type=digital" \
-d "status=started" \
-d "is_test=1" \
-d "estimated_delivery_datetime=2017/01/15 15:04:55 +0500" \
-d "estimated_update_datetime=2017/01/16 15:04:55 +0500" \
-d "refundable=false" \
-d "details=Item will be delivered via email by 3PM on 2017/01/15" \
-d "shipping_address[email]=test@paymentwall.com"
-d "reason=none"

Sample Response

{
    "success": 1
}

Physical

Parameters
Parameter Description
payment_id
required
string
Terminal3 Payments reference ID of the transaction. Can be obtained from parameter ref in pingback request.
merchant_reference_id
required
string
The order ID of the transaction in your system.
type
required
string
Type of delivery, required to be set as physical.
is_test
integer
Can be either 0 or 1. 1 means test API calls.
status
required
string
Refer to Status.
estimated_delivery_datetime
required
date
Estimated delivery date of the order. Format: 2017/01/15 15:04:55 +0500.
estimated_update_datetime
required
date
When the next status update is planned. Format: 2017/01/16 15:04:55 +0500.
reason
required
string
Additional description for the status update. Could be set as null if it is not convenient to provide.
refundable
required
string
Can be either true or false. Whether the order is refundable at this stage.
attachments
required
array
Array attachments of the proofs of delivery. URL of pictures is expected. Could be set as null if it is not convenient to provide.
details
required
string
Description of order status update to be showed to Terminal3 Payments and recipient.
product_description
string
Description of the new product in case of substitution or change.
shipping_address[email]
required
string
The email address of your customers.
shipping_address[country]
required
string
Shipping address country, ISO alpha-2 code.
shipping_address[city]
required
string
Shipping address city.
shipping_address[zip]
required
string
Shipping address zip/postal code.
shipping_address[state]
required
string
Shipping address state or province.
shipping_address[street]
required
string
Shipping address street.
shipping_address[phone]
required
string
Phone number of the recipient.
shipping_address[firstname]
required
string
Firstname of the recipient.
shipping_address[lastname]
required
string
Lastname of the recipient.

Status

Possible values
Name Description
order_placed Order has been placed within merchants system.
This status should be sent immediately after receiving a pingback.
order_preparing Merchant started to look for ordered item in stock, processing the order.
started The delivery has been started.
delivering Item is being delivered.
delivered Item has been delivered to the end-user. Attachment of delivery proof is expected in this case.
consumed Item is consumed by the end-user. Eg: activation keys, in-game virtual currency.
waiting_user_action User’s action is requested to complete the delivery. Eg: check the item or pick it up.
delayed Delay in delivery.
Parameter reason is required to specify the cause.
failed_will_retry Delivery to end user failed. Waiting for retry.
order_cancelled Order has been cancelled, waiting for refund or substitution.
Parameter reason is required to specify the cause. Eg: out of stock
retry_started Attempt to retry on delivery.
refund_requested End user made a refund request on the order.
refund_request_declined Merchant decline request to refund.
Parameter reason is required to specify the cause.
refund_request_accepted Order will be refunded.
Details parameter should include refund information.
refund_issued The original payment has been refunded.
Details parameter should include refund information.
A call to Cancellation API is needed for the refund of original payment.
cancelled_subscription Cancel Subscription.
substitution_requested Changes need to be made to the order after paid.
Parameter reason is required to specify the cause.
substitution_accepted Changes have been accepted by merchant. Subsequent changes in the status - started or order_preparing are expected.
substitution_declined Changes have been declined by the merchant.
Parameter reason is required to specify the cause.

Payment Status

This API allows you to check the status of a payment via payment reference ID.

To activate it please email us at devsupport@paymentwall.com.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
ref
required
string
Payment reference ID.
Can be obtained from parameter ref in pingback request.
uid
string
ID of end-users in your system
ag_external_id
string
It can be obtained from parameter goodsid in pingback request.
sign_version
required
integer
Signature version
Version 2 employs MD5 and version 3 uses SHA256.
sign
required
string
The request signature.
Refer to Signature Calculation for more details

Parameter ref is not required if you have submitted uid and ag_external_id for transactions in live environment.

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');

$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'ref' => 'b123456789',
    'uid' => 'user40012',
    'callback' => 'paymentStatusHandler',
    'sign_version' => 2
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    $params['sign_version']
);

$url = 'https://payments.terminal3.com/api/rest/payment/?'.http_build_query($params);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl); 
echo $response;
?>

Sample Response:

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user101",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Response

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user40012",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Response

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user40012",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Response

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user40012",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Response

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user40012",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Response

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user40012",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Endpoint

GET https://payments.terminal3.com/api/rest/payment

Sample Request

curl https://payments.terminal3.com/api/rest/payment \
-d "key=[YOUR_PROJECT_KEY]" \
-d "ref=t1234" \
-d "sign_version=2" \
-d "sign=[SIGNATURE]" \

Sample Response

{  
    "object":"payment",
    "id":"t1234",
    "created":1490101573,
    "amount":"100.00",
    "currency":"USD",
    "refunded":false,
    "risk":"approved",
    "uid":"user40012",
    "product_id":"product_123",
    "payment_system":"gateway",
    "subscription":{  
        "object":"subscription",
        "id":"subs_id_123",
        "period":"month",
        "period_duration":1,
        "payments_limit":12,
        "is_trial":0,
        "started":1,
        "expired":0,
        "active":0,
        "date_started":1490101633,
        "date_next":1492780033
    }
}

Payment Systems

Payment system API can retrieve the list of payment systems activated for a project in a specific country along with their names, logos and short codes.

Parameters
Name Description
country_code
required
string
Country code.
ISO 3166-1 alpha-2 code of the country.
currency_converted
string
Currency code of your product.
Format by ISO 4217. 3 letters.
include_pricepoints
string
1 or 0 to include pricepoints for Mobiamo.
key
required
string
The project key which can be found in Merchant Area→ My Projects.
sign_version
required
integer
Signature version. Version 2 uses MD5 and version 3 represents SHA256.
sign
required
string
The signature of widget.
Refer to signature calculation for more details.

Payment system response

Attributes
Name Description
id The payment system short code, ps, could be used as optional parameter.
name Payment system name.
new_window Payment methods require opening a new window or redirecting users to a new url.
img_url URL of the payment system logo.
img_class The class of image. Can be ignored as it doesn’t have any usage.
ps_type_id The payment method category of payment system.
1 - Credit cards. 2 - Bank transfer. 3 - Prepaid cards. 4 - E-wallet. 5 - Mobile payment.

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');

$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'country_code' => 'US',
    'sign_version' => 2
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    $params['sign_version']
);

$url = 'https://payments.terminal3.com/api/payment-systems/?'.http_build_query($params);
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
$response = curl_exec($curl);
echo $response;
?>

Sample Response:

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
    },
    {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
    },
    {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
    },
    {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
    },
    {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
    }
]

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Response

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
    },
    {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
    },
    {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
    },
    {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
    },
    {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
    }
]

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Response

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
     },
     {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
     },
     {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
     },
     {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
     },
     {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
     }
]

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Response

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
    },
    {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
    },
    {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
    },
    {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
    },
    {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
    }
]

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Response

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
    },
    {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
    },
    {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
    },
    {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
    },
    {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
    }
]

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Response

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
    },
    {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
    },
    {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
    },
    {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
    },
    {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
    }
]

Endpoint

GET https://payments.terminal3.com/api/payment-systems/

Sample Request

curl https://payments.terminal3.com/api/payment-systems/ \
-d "key=[YOUR_PROJECT_KEY]" \
-d "country_code=RU" \
-d "sign_version=2" \
-d "sign=[SIGNATURE]" \

Sample Response:

[
    {
        "id":"paypal",
        "name":"PayPal",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_paypal.png",
        "img_class":"paypal",
        "ps_type_id":4
    },
    {
        "id":"alipay",
        "name":"AliPay",
        "new_window":true,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_alipay.png",
        "img_class":"alipay",
        "ps_type_id":4
    },
    {
        "id":"neosurf",
        "name":"Neosurf",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_neosurf.png",
        "img_class":"neosurf",
        "ps_type_id":3
    },
    {
        "id":"mobiamo",
        "name":"Mobiamo",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mobiamo.png",
        "img_class":"mobiamo",
        "ps_type_id":5
    },
    {
        "id":"mint",
        "name":"MINT",
        "new_window":false,
        "img_url":"https:\/\/payments.terminal3.com\/images\/ps_logos\/pm_mint.png",
        "img_class":"mint",
        "ps_type_id":3
    }
]

Product Details

You can update the information of a product that is stored under Products Section in Terminal3 Payments merchant dashboard by using this API.

To activate it please email us at devsupport@paymentwall.com.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
ag_external_id
required
string
Product SKU ID.
Set up under Products Section in your Merchant Account. It is also passed as goodsid in pingback request.
country_code
string
Country code in ISO 3166-1 alpha-2 format.
It is determined by user IP by default.
sign_version
required
int
eg: 2, 3
Signature version
Version 2 uses MD5 and version 3 uses SHA256.
sign
required
string
The request signature.
Refer to Signature Calculation for more details

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');

$params = array(
    'key'=>'YOUR_PROJECT_KEY',
    'ag_external_id'=>'product101',
    'country_code'=>'US',
    'callback'=>'productDetailsHandler',
    'sign_version'=>2
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    $params['sign_version']
);

$url = 'https://payments.terminal3.com/api/rest/product/?'.http_build_query($params);
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
$response = curl_exec($curl);
echo $response;
?>

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Endpoint

GET https://payments.terminal3.com/api/rest/product/

Sample Request

curl https://payments.terminal3.com/api/rest/product \
-d "key=[YOUR_PROJECT_KEY]" \
-d "ag_external_id=product_100244" \
-d "sign_version=2" \
-d "sign=[SIGNATURE]" \

Sample Response

{
    "object":"product",
    "id":"T20170101",
    "name":"testproduct",
    "amount":"9.99",
    "currency":"USD",
    "order":2,
    "best_value":0,
    "most_popular":0,
    "is_default":0,
    "type":"fixed",
    "show_discount":0,
    "old_price":"19.99",
    "product_description":"",
    "custom_fields":"",
    "slug":"testproduct",
    "product_pic_url":"",
    "promotion":""
}

Geolocation

You can use this API call for client-side or server-side detection of user’s location. This API also works tightly with Terminal3 Payments Risk Scoring.

Parameters
Name Description
key
required
string
The project key which can be found in Merchant Area→ My Projects. Project status should be LIVE to use this API.
uid
required
string
User’s id.
User’s account id used in your system.
user_ip
string
E.g. 255.255.255.255
IP address of the user.
callback
string
Callback function. Can be used for JSON on client side.

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Request

require_once('path/to/lib/paymentwall.php');
$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'uid' => 'user101',
    'user_ip' => '192.168.1.101'
);

$url = 'https://payments.terminal3.com/api/rest/country?' .http_build_query($params);
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl);
echo $response;
?>

Sample Response

{
    "code":"US",
    "country":"United States"
}

Sample Response when callback parameter is present

callbackFunction({
    "code":"US",
        "country":"United States"
})

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Response

{
    "code":"US",
    "country":"United States"
}

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Response

{
    "code":"US",
    "country":"United States"
}

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Response

{
    "code":"US",
    "country":"United States"
}

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Response

{
    "code":"US",
    "country":"United States"
}

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Response

{
    "code":"US",
    "country":"United States"
}

Endpoint

GET https://payments.terminal3.com/api/rest/country

Sample Request

curl https://payments.terminal3.com/api/rest/country \
> -d "key=[YOUR_PROJECT_KEY]" \
> -d "uid=[USER_ID]" \

Sample Response

{
    "code":"US",
    "country":"United States"
}

Receipt

This API allows to pull receipt of each click.

Parameters
Parameter Description
key
required
string
The project key which can be found in Merchant Area→ My Projects.
ref
required
string
Payment reference ID.
Can be obtained from parameter ref in pingback request.
type
required
integer
Type of the receipt:
0. Payment
2. Refund
format
required
string
Format of the receipt:
html
pdf
download
integer
When format is pdf, you can choose either download or not by passing 0/1.
string
integer
Accepts 1 when format is pdf and download is 0 to receive content as string.
sign_version
required
integer
Signature version
Version 2 employs MD5 and version 3 uses SHA256.
sign
required
string lowercase
The request signature. Refer to Signature Calculation for more details.

Endpoint

GET https://payments.terminal3.com/api/rest/receipt

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');

$params = array(
    'key' => 'YOUR_PROJECT_KEY',
    'ref' => '123456789',
    'type' => '0',
    'format' => 'html',
    'sign_version' => 2
);

Paymentwall_Config::getInstance()->set(array('private_key' => 'YOUR_SECRET_KEY'));
$params['sign'] = (new Paymentwall_Signature_Widget())->calculate(
    $params,
    $params['sign_version']
);

$url = 'https://payments.terminal3.com/api/rest/receipt/?'.http_build_query($params);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl); 
echo $response;

Sample Response

{ "body":"<!DOCTYPE html>.....<\/html>", "type":"html" }

Sample Error Response:

{ "type":"Error", "object": Error", "error": "Request signature is invalid", "code": 4009 }

Shop API

This section explains the API parameters for Shop. You can find more details about how it works in the Shop guide.

Parameters
Name Description
country_code
String
country Alpha-2 code

Endpoint:

GET https://[shop_domain].terminal3.com/
Parameters
Name Description
product_id
required
integer
Product ID
slug
required
string
Product slug parameter
Product name reformatted to snake case
quantity
integer
Products quantity
email
string
Email of the end-user

Endpoint:

GET https://[shop_domain].terminal3.com/product/[slug]/[product_id]

Use shop as a widget

Please switch the setting in Shop > Settings in Terminal3 dashboard as shown below:

Widget mode


After that shop can be called with the parameters below.

Parameters
Name Description
uid
string
ID of a customer in your system (email, unique login name). Requires sig parameter.
email
string
Customer’s email. Requires sig parameter.
country_code
string
Customer country code. In Alpha-2 ISO 3166-1 format. If it is not set - we will define country automatically.
ps
integer
Payment System Shortcode from Terminal3 Payments Documentation
sig
string
Request Signature. See Signature section.
Required for parameters uid, email, promo, custom_parameters.
promo[product_id]
integer
Terminal3 product ID, displayed on Shop > Products in Terminal3 dashboard. Requires sig parameter.
promo[type]
string
Promo type:
* discount - apply a discount of x%
* bonus - apply a bonus of x% or of a given number, works for products with Type = Virtual Currency
promo[calc]
string
Promo calculation type:
* percent - percentage off for type=discount, or percentage bonus for type=bonus
* number - amount of bonus for type=bonus
promo[value]
float
Promo value - e.g. 5 for 5% discount.
custom_parameters[…]
array
Array of key-value custom parameters, to be displayed in the Pingback. Requires sig parameter.
customer[…]
array
User Profile parameters used for Risk.
history[…]
array
User Profile parameters used for Risk.

Endpoint:

GET https://[shop_domain].terminal3.com/

Virtual currency widget

This section explains the API parameters for Virtual Currency Widget. You can find more details about how it works in the Virtual Currency Widget guide.

Parameters
Name
For wirtual currency widget use the same parameters as for Shop in widget mode

Endpoint:

GET https://[shop_domain].terminal3.com/pricepoint

Fast Checkout

This section explains the API parameters for Fast Checkout. You can find more details about how it works in the Fast checkout guide.

Parameters
Name Description
product[0][name]
required
string
Product name
product[0][vat]
required
integer
VAT category
product[0][sku_id]
required
string
Product ID
product[0][type]
required
string
Specify whether it is a one-time payment.
Example: fixed
product[0][quantity]
required
integer
Number of products to be purchased.
product[0][amount]
required
numeric
Total amount to be paid.
currency_code
required
string
Currency in which customer makes a payment in ISO 3166-1 alpha-2 code.
ts
integer
Time when request was initiated, represented as Unix timestamp. If it’s older than 60 minutes, user sees an error message.
email
string
Your customer’s email. Terminal3 will automatically send a payment receipt and products to the customer. Requires sig parameter.
pingback_url
required
string
Optional URL of pingback listener script where pingbacks should be sent. Overrides the default Pingback URL set up in your Store Settings.
uid
required
string
ID of a customer in your system (email, unique login name). Requires sig parameter.
tax_strategy
integer
The way we will apply taxes. Could be:
0 - do not apply tax
1 - on top of the price
2 - included into the price
country_code
string
Customer country code. In Alpha-2 ISO 3166-1 format.
If it is not set - we will define country automatically.
sig
required
string
Request Signature. See Signature section. Required for promo parameters.

Endpoint:

GET https://[shop_domain].terminal3.com/fast-checkout

Pingback format

This section explains parameters for Pingback. You can find more details about how it works in the Pingback guide.

Parameters
Name Description
type
string
Type of pingback.
Format: String {payment / chargeback / refund/ partial_refund}.
reference
string
T3 Payments click_id, external payment reference from payment processor.
Format: String.
transaction_id
integer
Internal T3 transaction id.
Format: Integer.
order_id
integer
Internal T3 order_id
Format: Integer.

Order

Parameters
Name Description
id
integer
Terminal3 order id.
Format: Numeric
uid
string
Customer identifier in merchant’s system. Matches uid passed in the Pricepoint Widget API.
Format: Hexadecimal, up to 256 characters long
processed_at
string
Date + time + time zone when order was created
Format: Y-m-d H:i:s e
currency_code
string
Currency in which the payment was made, in ISO 3166-1 alpha-2 code.
Format: String
country
string
Customer country code. In Alpha-2 ISO 3166-1 format.
Format: SO 3166-1 alpha-2 code of the country
total_revenue
string
Amount paid by the customer.
Format: Float, round to 2 decimal places.
gross_revenue
string
Amount paid less the tax.
Format: Float, round to 2 decimal places.
net_revenue
string
Net merchant revenue, excluding the tax, fees and rolling reserve.
Format: Float, round to 2 decimal places.
tax
string
Total tax paid by the customer.
Format: Float, round to 2 decimal places.
commission
string
Terminal3 fees.
Format: Float, round to 2 decimal places.
rolling_reserve
string
Rolling reserve.
Format: Float, round to 2 decimal places.
user_email
string
Customer email from which the order was made.
Format: Float, round to 2 decimal places.
payment_type
string
Payment method used by the customer.
Format: Float, round to 2 decimal places.
custom_attributes
object
Custom fields from shop’s settings payment attributes.
Format: Json
custom_parameters
object
Custom parameters. Required if has been set on widget initialization.
Format: Json
products
object
List of products purchased.
Format: Array

Example of a Pingback

{
    "type": "payment",
    "order_id": "3462",
    "transaction_id": "3526",
    "reference": "b65216354",
    "order" : {
        "id": 3462,
        "uid": 43565342,
        "processed_at": "2019-07-11 08:06:59 UTC",
        "currency_code": "EUR",
        "country": "DE",
        "total_revenue": "33.00",
        "gross_revenue": "33.00",
        "net_revenue": "29.86",
        "tax": "0.00",
        "commission": "1.65",
        "rolling_reserve": "1.49",
        "user_email": "user@paymentwall.com",
        "payment_type": "Credit Card",
        "custom_attributes": {
            "country_region": "MB",
            "company_name": "Apple inc.",
            "company_email": "apple@icloud.com",
            "other_attribute": "Other attribute value"
        },
        "products": [
           {
                "id": "130",
                "sku": "UID-0001332-1",
                "title": "Product Title",
                "quantity": 2,
                "purchase": {
                       "amount": "15.00",
                       "total_amount": "11.25",
                       "discount" : "3.75",
                       "tax": "0.00",
                       "tax_rate": "0.00"
                }
           }
        ]
    }
}

Example of a Pingback for Virtual currency with using promo parameters

{
    "type": "payment",
    "order_id": "3462",
    "transaction_id": "3526",
    "reference": "b65216354",
    "order" : {
        "id": 3462,
        "uid": 43565342,
        "processed_at": "2019-07-11 08:06:59 UTC",
        "currency_code": "EUR",
        "country": "DE",
        "total_revenue": "33.00",
        "gross_revenue": "33.00",
        "net_revenue": "29.86",
        "tax": "0.00",
        "commission": "1.65",
        "rolling_reserve": "1.49",
        "user_email": "user@paymentwall.com",
        "payment_type": "Credit Card",
        "custom_attributes": {
            "country_region": "MB",
            "company_name": "Apple inc.",
            "company_email": "apple@icloud.com",
            "other_attribute": "Other attribute value"
        },
        "custom_parameters": {
            "custom_param_1": "value_1",
            "custom_param_2": "value_2",
        },
        "products": [
           {
                "id": "130",
                "sku": "UID-0001332-1",
                "title": "In-Game Coins",
                "quantity": 2,
                "package": {
                    "amount": "1000",
                    "total_amount": "1350",
                    "bonus_percent": "35",
                    "bonus_amount": "350"
                },
                "promo": {
                    "discount": {
                        "calc": "percent",
                        "value": "25"
                    },
                    "bonus": {
                        "calc": "percent",
                        "value": "35"
                    }
                },
                "purchase": {
                       "amount": "15.00",
                       "total_amount": "11.25",
                       "discount" : "3.75",
                       "tax": "0.00",
                       "tax_rate": "0.00"
                       "discount_percent": "25"
                }
           }
        ]
    }
}

Products

Parameters
Name Description
id
integer
Product id.
Format: Numeric
sku
string
Product external identifier.
Format: String
title
string
Product name.
Format: String
quantity
integer
Product quantity.
Format: Numeric
purchase
object
Product financial data for 1 item.
Format: Json
package
object
Information about the virtual currency package, required for Virtual Currency package products.
Format: Json
promo
object
Promo parameters. Required if promo parameters has been set on widget initialization.
Format: Json

Package

Parameters
Name Description
amount
integer
Amount of virtual currency before bonus.
Format: Numeric
total_amount
integer
Total amount of virtual currency with bonus applied.
Format: Numeric
bonus_percent
integer
Bonus in percent.
Format: Numeric
bonus_amount
integer
Bonus in virtual currency . Set directly or calculated based on bonus_percent. From dashboard or redefined via promo parameter.
Format: Numeric

Promo

Parameters
Name Description
discount
object
Discount from promo parameter.
Format: Json
bonus
object
Bonus from promo parameter.
Format: Json

Discount

Parameters
Name Description
calc
string
Promo calculation type. Corresponds to promo[calc] parameter or type of calculation set up in the dashboard.
Format: String {amount / percent}
value
integer
Discount value.
Format: Numeric

Bonus

Parameters
Name Description
calc
string
Promo calculation type. Corresponds to promo[calc] parameter or type of calculation set up in the dashboard.
Format: String {amount / percent}
value
integer
Bonus value.
Format: Numeric

Purchase

Parameters
Name Description
amount
string
Item price set by merchant.
Format: Float, round to 2 decimal places.
total_amount
string
Item price paid by the customer.
Format: Float, round to 2 decimal places.
discount
string
Discount for product at the moment when order created.
Format: Float, round to 2 decimal places.
discount_percent
integer
Actual discount that was applied. From dashboard or redefined via promo parameter
Format: Integer.
tax
string
Item tax.
Format: Float, round to 2 decimal places.

Negative pingback

Negative pinbacks has one of statuses: chargeback, refund, partial_refund

Parameters
Name Description
amount
string
Amount charged.
Format: Float, round to 2 decimal places.
currency_code
string
Currency code of the amount, in ISO 3166-1 alpha-2 code.
Format: String. Example: USD.
fee
string
The amoubt that T3 will charge from merchant. In chargeback case = $25, in refund case depend on certain PS fee + amount refunded
Format: Float.
reason
integer
Code of reason. Reasons codes described in Paymentwall api documentation
Format: Integer. Example: 2.
processed_at
integer
Unix timestamp of transaction time.
Format: Integer. Example 12453475.

Example of a negative Pingback

{
  "type": "chargeback",
  "order_id": "6325",
  "transaction_id": "4274",
  "reference": "b65386312",
  "amount": "1.00",
  "currency_code": "USD",
  "fee": "25.0000",
  "reason": "4",
  "processed_at": "1581002374"
}