API Reference

This API reference consists of all the APIs provided by Paymentwall. The Paymentwall API can be interacted with HTTPS requests to obtain certain information from Paymentwall. Typically a JSON object including the required details will be returned except Widget API & Checkout API, which redirect your customer to Paymentwall 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. Paymentwall 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 Paymentwall. 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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/subscription

Tokidoki

Tokidoki is Paymentwall 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
If you use stored package, It can be found in Merchant Area–>Tokidoki–>Packages section
It’s not required if request already contains package_sku_id
package_sku_id
required
varchar
Each package will be identified by an unique SKU ID. This is the SKU ID that you already inputted when you setup your package in Tokidoki section
It’s not required if request already contains package_id
custom
optional
array
Refer to more optional parameters for extra needs or user profile parameters for risk scoring.
tokidoki
required
boolean
If you would like to flexible subscription, You must add ‘tokidoki’ parameter with value 1 .

Endpoint

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

Sample Request for stored package

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'user_email' => 'YOUR_EMAIL@email.com',
    'package_id' => '29',
    '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://api.paymentwall.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) {
    echo $response['data'] . PHP_EOL;
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Sample Request for flexible package

<?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'
));

$productParams = [
'amount' => '1',
'currencyCode' => 'USD',
'name' => 'PRODUCT_NAME',
'productId' => 'PRODUCT_ID',
'productType' => 'subscription',
'periodLength' => '2',
'periodType' => 'month',//period type: day, week, month
'recurring' => '1'
];

$extraParams = [
'tokidoki' => '1',
'email' => 'user@hostname.com'
];

$product = new Paymentwall_Product(
$productParams['productId'],
$productParams['amount'],
$productParams['currencyCode'],
$productParams['name'],
$productParams['productType'],
$productParams['periodLength'],
$productParams['periodType'],
$productParams['recurring']
);

$widget = new Paymentwall_Widget(
'user@hostname.com', // uid
'p1', // widget
[$product],
$extraParams
);

echo $widget->getHtmlCode();
?>

List all current packages

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://api.paymentwall.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://api.paymentwall.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;
}
?>

Show details a package

The API is designed to show details a package.

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

Parameters
Name Description
package_id
required
int
Package ID.

Endpoint

GET https://api.paymentwall.com/developers/tokidoki-api/packages?package_id={package_id}

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://api.paymentwall.com/developers/tokidoki-api/packages?package_id=12';

$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;
}
?>

Create new package

The API is designed to help for merchant create new a package.

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

Note: Data post must be json.

Parameters
Name Description
name
required
varchar
Package name.
sku_id
required
varchar
Package skui id.
price
required
decimal
Package price.
currency_code
required
varchar
Package currency code.
period_length
required
smallint
Recurring billing duration.
period_type
required
tinyint
Recurring period type.
period_limit
required
tinyint
Recurring limited/unlimited.
active
required
tinyint
Package active.

Endpoint

POST https://api.paymentwall.com/developers/tokidoki-api/create-package

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'name' => 'Package Example',
    'sku_id' => 'package_example',
    'price' => '123',
    'currency_code' => 'USD',
    'period_length' => '1',
    'period_type' => 'month',
    'period_limit' => '6'
    'active' => 1
    ];

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

$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/create-package';

$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) {
    echo $response['data'] . PHP_EOL;
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Update a package

The API is designed to help for merchant update a package.

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

Note: Data post must is json

Parameters
Name Description
package_id
required
int
Package ID.
name
required
varchar
Package name.
price
required
decimal
Package price.
currency_code
required
varchar
Package currency code.
period_length
required
smallint
Recurring billing duration.
period_type
required
tinyint
Recurring period type.
period_limit
required
tinyint
Recurring limited/unlimited.
active
optional
tinyint
Package active.

Endpoint

POST https://api.paymentwall.com/developers/tokidoki-api/update-package

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'name' => 'Update Package Example',
    'sku_id' => 'update_package_example',
    'price' => '12',
    'currency_code' => 'USD',
    'period_length' => '1',
    'period_type' => 'month',
    'period_limit' => '6'
    'active' => 1
    ];

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

$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/update-package';

$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) {
    $response['data'] . PHP_EOL;
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Remove a package

The API is designed to help for merchant remove a package.

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

Note: Data post must is json

Parameters
Name Description
package_id
required
int
Package ID.

Endpoint

POST https://api.paymentwall.com/developers/tokidoki-api/remove-package

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'package_id' => '12'
    ];

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

$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/remove-package';

$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) {
    echo 'Delete package success!';
} else {
    echo $response['error'] . PHP_EOL;
}
?>

List all current subscriptions

The API is designed to get all current subscriptions in the system. In addition, You can list subscriptions by page.

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

Endpoint

GET https://api.paymentwall.com/developers/tokidoki-api/subscriptions

GET https://api.paymentwall.com/developers/tokidoki-api/subscriptions?page={number_page}

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://api.paymentwall.com/developers/tokidoki-api/subscriptions';

$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;
}
?>

Show details a subscription

The API is designed to get a subscriptions in the system by subscription ID or customer email.

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

Endpoint

GET https://api.paymentwall.com/developers/tokidoki-api/subscriptions?subscription_id={subscription_id}

GET https://api.paymentwall.com/developers/tokidoki-api/subscriptions?subscriber_email={email}

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://api.paymentwall.com/developers/tokidoki-api/subscription_id=100345523';
//$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/subscriber_email=user@hostname.com';//remove this comment if find the subscriptions by customer email
$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;
}
?>

Cancel a subscription

The API is designed to cancel a subscription in the system.

Please pass X-ApiKey through HttpHeader, the value is Project Key,which can be found in Merchant Area. Note: Data post must is json data.

Parameters
Name Description
subscription_id
required
int
Subscription ID.
cancel_type
required
boolean
There 2 types of cancel: cancel immediately by value is 0 and cancel at end period with value is 1.

Endpoint

POST https://api.paymentwall.com/developers/tokidoki-api/cancel-subscription

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'subscription_id' => '100345523',
    ];

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

$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/cancel-subscription';

$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) {
    echo "Remove pending cancellation the subscription successfully!";
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Change subscription’s package

Tokidoki offers the ability to change subscription’s package. We provide possibility to upgrade/downgrade from stored package to stored package, non-stored (flexible) package to non-stored package, stored package to flexible package and vice-versa.

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

Parameters
Paramerters Description
subscription_id
required
int
Subscription ID.
package_id
required
int
Package ID. If you would like to stored package
name
required
varchar
Package name If you would like to flexible package
sku_id
required
varchar
Package sku id with flexible package
price
required
decimal
Package price with flexible package
currency_code
required
varchar
Currency code with flexible package
period_length
required
smallint
recurring billing duration with flexible package
period_type
required
tinyint
recurring period type with flexible package
recurring_limit
required
tinyint
recurring limmited/unlimited with flexible package

Endpoint

POST https://api.paymentwall.com/developers/tokidoki-api/request-change-package

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'subscription_id' => '1001101',
    'package_id' => '29'
    ]; //with stored package

//$params = [
    'subscription_id' => '1001101',
    'name' => 'Package Example',
    'sku_id' => 'package_example',
    'price' => '123',
    'currency_code' => 'USD',
    'period_length' => '1',
    'period_type' => 'month',
    'period_limit' => '6'
    ]; //with flexible package

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

$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/request-change-package';

$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) {
    echo 'Request change subscription's package successfully!;
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Remove change package request

The API is designed to remove change (upgrade/downgrade) the package of a subscriptions in the system when That subscription have a request change package.

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

Parameters
Name Description
subscription_id
required
int
Subscription ID.

Endpoint

POST https://api.paymentwall.com/developers/tokidoki-api/remove-change-package

Sample Request

<?php
require_once('path/to/lib/paymentwall.php');
$key = 'YOUR_PROJECT_KEY';
$params = [
    'subscription_id' => '100345523'
    ];

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

$endpoint = 'https://api.paymentwall.com/developers/tokidoki-api/remove-change-package';

$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) {
    echo 'Remove change package successfully!';
} else {
    echo $response['error'] . PHP_EOL;
}
?>

Remove pending cancel subscription

The API is designed to remove pending cancel of a subscriptions in the system when That subscription have a request cancel at end period.

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

Parameters
Name Description
subscription_id
required
int
Subscription ID.

List all current transactions

The API is designed to get all currently transactions in the system.

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

Endpoint

GET https://api.paymentwall.com/developers/tokidoki-api/transactions

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://api.paymentwall.com/developers/tokidoki-api/transactions';

$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;
}
?>

Show details a transaction

The API is designed to show details a transaction in the system by transaction ID.

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

Name Description
transaction_id
required
int
Transaction ID.

Endpoint

GET https://api.paymentwall.com/developers/tokidoki-api/packages?transaction_id={transaction_id}

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://api.paymentwall.com/developers/tokidoki-api/packages?transaction_id=1003708';

$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. Paymentwall 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 Paymentwall. Refer to payment system shortcodes to get the payment method code.
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.
promo
array
Apply promotion to products. Require sign_version 3.

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

Endpoint

GET https://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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. Paymentwall 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 Paymentwall. 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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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. Paymentwall 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 Paymentwall. 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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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 Paymentwall to account for the relevant merchant data when calculating the risk score and during risk review by Paymentwall risk agents.


At the point when an end-user wishes to make a payment, his registration details may be passed to Paymentwall that provides payment processing services, in order for Paymentwall 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.
logo_url
string
Optional URL of the logo to be shown on the widget. Project Logo can also be specifed in Project Settings. logo_url overrides such static project logo.
project_name
string
Optional Public Project Name displayed to end-users in the widget and on the payment receipt. Public Project Name can also be set in the Project Settings. project_name overrides this value.
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.
logo_url
string
Custom company logo url specified.
project_name
string
Custom project name to be displayed on the widget.

Invoice

Paymentwall supports smart and organized e-invoicing solution. To activate it, please send email to devsupport@paymentwall.com with your email address in Paymentwall account.

Refer Invoice document to generate invoices via Paymentwall Merchant area.

Parameters
Parameter Description
invoice_number
required
string
Official Invoice number based on your paybook.
currency
required
string
Refer to currency codes
date
required
string
Invoice date in mm/dd/yyyy format
due_date
required
string
Invoice due date in mm/dd/yyyy format
contacts
required
array
Array of your client’s details. Please refer Contact parameters
items
required
array
Array of your item’s details. Please refer Items parameters
taxes
array
Array of your Invoice taxes. Please refer Taxes and Discount of Invoice parameters
discounts
array
Array of your Invoice discounts. Please refer Tax and Discount of Invoice parameters
key
required
string
Your project public key
sign
required
string
Your signature based on your invoice parameters. Please refer to Signature Calculation
sign_version
required
string
Version of signature

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Sample Request

<?php
$params = json_encode(array(
    'invoice_number'=>'INV-00123',
    'currency'=>'USD',
    'date'=>'07/07/2017',
    'due_date'=>'09/10/2019',
    'contacts'=> array(
        'company_name'=>'ABCD Industries',
        'salutation'=>'Mr.',
        'first_name'=>'John',
        'last_name'=>'Doe',
        'email'=>'john@doe.com',
        'title'=>'CEO',
        'country'=>'US',
        'city'=>'Palo Alto',
        'address'=>'326 Market Street',
        'zipcode'=>'94103',
        'phone_number'=>'(800)5551000',
        'note'=>'This will show on your Invoice'
    ),
    'items'=> array(
        array(
            'quantity'=>20,
            'title'=>'Red apple',
            'description'=>'Fresh apples',
            'unit_cost'=>2,
            'currency'=>'USD',
            'tax'=> array(
                'type'=>'percentage',
                'value'=>'10'
            ),
            'discount'=> array(
                'type'=>'percentage',
                'value'=>'17'
            )
        ),
        array(
            'quantity'=>10,
            'title'=>'Green apple',
            'description'=>'Fresh apples',
            'unit_cost'=>2,
            'currency'=>'USD',
            'tax'=> array(
                'type'=>'percentage',
                'value'=>'10'
            ),
            'discount'=> array(
                'type'=>'percentage',
                'value'=>'17'
            )
        )
    ),
    'taxes'=> array(
        array(
            'type'=>'percentage',
            'value'=>'20',
            'name'=>'VAT EU'
        ),
        array(
            'type'=>'percentage',
            'value'=>'10',
            'name'=>'USA NATIONAL TAX'
        )
    ),
    'discounts'=> array(
        'type'=>'percentage',
        'value'=>'50',
        'name'=>'1 000 000 user discount'
    ),
    'key'=>'YOUR_PROJECT_KEY'
));

$post = curl_init();
curl_setopt($post, CURLOPT_URL, 'https://api.paymentwall.com/developers/invoice-api/invoice');
curl_setopt($post, CURLOPT_HTTPHEADER, array(
    'X-ApiKey: YOUR_SECRET_KEY'
));
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $params);
curl_exec($post);
?>

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Endpoint

POST https://api.paymentwall.com/developers/invoice-api/invoice

Sample Request

curl https://api.paymentwall.com/developers/invoice-api/invoice \
-H "X-ApiKey: [YOUR_SECRET_KEY]" \
-d "invoice_number":"INV-00355" \
-d "currency":"USD" \
-d "date":"05/05/2017" \
-d "due_date":"06/05/2017"\
-d "contacts":[{
        "company_name":"ABCD Industries",
        "salutation":"Mr.",
        "first_name":"John",
        "last_name":"Doe",
        "email":"liangnexcolor@gmail.com",
        "title":"CEO",
        "country":"US",
        "city":"Palo Alto",
        "address":"326 Market Street",
        "zipcode":"94103",
        "phone_number":"(800)5551000",
        "note":"This will show on your Invoice"
    }] \
-d "items":[{
        "quantity":5,
        "title":"Red apple",
        "description":"Fresh apples",
        "unit_cost":10,
        "currency":"USD",
        "tax":{
            "type":"percentage",
            "value":"1"
        },
        "discount":{
            "type":"percentage",
            "value":"1"}
      },{
        "quantity":10,
        "title":"Green apple",
        "description":"Fresh apples",
        "unit_cost":10,
        "currency":"USD",
        "tax":{
            "type":"percentage",
            "value":"1"
        },
        "discount":{
            "type":"percentage",
            "value":"2"}
    }] \
-d "taxes":[{
        "type":"percentage",
        "value":"THE-TAX-VALUE",
        "name":"USA NATIONAL TAX"
    }] \
-d "discounts":[{
        "type":"percentage",
        "value":"THE-PERCENTAGE-VALUE",
        "name":"Royalty User Discount"
    }] \
-d "key":"[YOUR_PROJECT_KEY]"

Contacts

Parameters
Parameter Description
company_name
string
Company name
salutation
string
Mr./Ms./Dr.
first_name
required
string
First name of your client
last_name
required
string
Last name of your client
email
required
string
Email address of your client
title
string
Position in company_name
country
string
Country of your client
city
string
City of your client
address
string
Address of your client
zipcode
string
Zip code of your client
phone_number
string
Phone number of your client
note
string
Internal information about this client

Items

Parameters
Parameter Description
quantity
required
int
Number of item which your client orders
unit_cost
required
float
Price point of item
currency
required
string
Currency code in ISO 4217
Currency of Invoice and Items must be same.
title
required
string
Name of Item
description
string
Item description
tax
array
Item tax. Please refer Taxes and Discount of Items parameters
discount
array
Item discount. Please refer Taxes and Discount of Items parameters

Invoice tax/discount

Parameters
Parameter Description
type
required
string
percentage
Type of tax / discount. Currently only percentage is available.
value
required
float
Value of tax / discount. Example: 10.00 for 10.00%
name
required
string
Name of tax / discount

Item tax/discount

Parameters
Parameter Description
type
required
string
percentage
Type of tax / discount of this item. Currently only percentage is available.
value
required
float
Value of tax / discount of this item. Example: 10.00 for 10.00%

Invoice response attributes

Invoice email will be sent automatically to the contacts[email] and you will get invoice overview in json format.Below are the attributes of response.

Attributes
Parameter Description
invoice_number Your invoice number passed in requests
application_id Your project id in Paymentwall
date Unix Timestamp value of the date you set for invoice
due_date Unix Timestamp value of the due date you set for invoice
currency Code of the currency you set for invoice in ISO 4217 format
status Status of Invoice. sent / paid / outstanding
email Client’s email. Invoice is sent to this email address
total_amount Total price of invoice after invoice tax / invoice discount is applied
sub_total_amount Total price of invoice products without invoice tax / invoice discount
invoice_id Internal invoice ID
public_id Public invoice ID sent to client
status_formatted Formatted version of Invoice status
due_date_formatted Formatted version of invoice due date
date_formatted Formatted version of invoice date
view_url URL to see the invoice
payment_url URL to make payment for the invoice
pdf_url URL to download PDF version of the invoice
owner Array of your company information. You can set the information at Invoice > Settings tab. Please refer Invoice for details

The other attributes are same with the parameters you sent over request to Invoice API.

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "04\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "04\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "04\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "04\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "04\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "04\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

Sample Response

[
    {
        "invoice_number": "INV-00355",
        "application_id": 166111,
        "date": 1493960400,
        "due_date": 1491368400,
        "currency": "USD",
        "status": "sent",
        "email": "liangnexcolor@gmail.com",
        "total_amount": "149.4800",
        "sub_total_amount": "149.4800",
        "invoice_id": 6893,
        "public_id": "95NMR5ODQUWM0YPJ2XQ5",
        "status_formatted": "Sent",
        "due_date_formatted": "06\/05\/2017",
        "date_formatted": "05\/05\/2017",
        "view_url": "https:\/\/api.paymentwall.com\/api\/invoice\/view?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "payment_url": "https:\/\/api.paymentwall.com\/api\/invoice\/?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "pdf_url": "https:\/\/api.paymentwall.com\/api\/invoice\/download-pdf?key=cd36b8635c7296dad972a239142c4b84&uid=liangnexcolor%40gmail.com&sign_version=2&id=95NMR5ODQUWM0YPJ2XQ5&sign=bd1fe15077982c3ecf609b3f75f86592",
        "owner": {
            "company_name": "Liang's company",
            "country_name": "China",
            "address": "4th middle road, North",
            "city": "BeiJing",
            "state": 699,
            "first_name": "",
            "last_name": "",
            "zipcode": "100085",
            "logo_url": "https:\/\/api.paymentwall.com\/\/images\/logo2.png"
        },
        "currency_code": "USD",
        "sub_total_amount_formatted": "149.48 USD",
        "total_amount_formatted": "149.48 USD",
        "items": [
            {
                "application_id": 166111,
                "title": "Red apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "1"
                },
                "item_id": 8347,
                "quantity": "10.00",
                "line_total": 99.99,
                "line_total_formatted": "99.99 USD",
                "unit_cost_formatted": "10.00 USD"
            },
            {
                "application_id": 166111,
                "title": "Green apple",
                "description": "Fresh apples",
                "unit_cost": "10.00",
                "currency": "USD",
                "tax": {
                    "type": "percentage",
                    "value": "1"
                },
                "discount": {
                    "type": "percentage",
                    "value": "2"
                },
                "item_id": 8348,
                "quantity": "5.00",
                "line_total": 49.49,
                "line_total_formatted": "49.49 USD",
                "unit_cost_formatted": "10.00 USD"
            }
        ],
        "contacts": [
            {
                "application_id": 166111,
                "first_name": "John",
                "last_name": "Doe",
                "salutation": "Mr.",
                "email": "liangnexcolor@gmail.com",
                "company_name": "ABCD Industries",
                "title": "CEO",
                "address": "326 Market Street",
                "country": "US",
                "country_formatted": "United States",
                "city": "Palo Alto",
                "zipcode": "94103",
                "phone_number": "(800)5551000",
                "note": "This will show on your Invoice",
                "contact_id": 7275
            }
        ],
        "taxes": [
            
        ],
        "discounts": [
            
        ],
        "bank_details": [
            
        ],
        "show_pay_button": true
    }
]

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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/token (Sandbox environment)

Endpoint

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

Endpoint

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

Endpoint

 POST https://pwgateway.com/api/token (Live environment)
 
 POST https://api.paymentwall.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 Paymentwall 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.
Charge with a permanent token will work only with same uid.
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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/charge

Endpoint

POST https://api.paymentwall.com/api/brick/charge


Void a charge

Endpoint

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

Endpoint

POST https://api.paymentwall.com/api/brick/charge


Void a charge

Endpoint

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

Endpoint

POST https://api.paymentwall.com/api/brick/charge

Sample Request

curl https://api.paymentwall.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://api.paymentwall.com/api/brick/charge/$chargeid/void

Sample Request

curl https://api.paymentwall.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 Paymentwall 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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/charge/$chargeid

Endpoint

GET https://api.paymentwall.com/api/brick/charge/$chargeid

Endpoint

GET https://api.paymentwall.com/api/brick/charge/$chargeid

Endpoint

GET https://api.paymentwall.com/api/brick/charge/$chargeid

Endpoint

GET https://api.paymentwall.com/api/brick/charge/$chargeid

Sample Request

curl https://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/charge/$chargeid/refund

Endpoint

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

Endpoint

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

Endpoint

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

Sample Request

curl https://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/charge/$chargeid/capture

Endpoint

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

Endpoint

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

Endpoint

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

Endpoint

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

Sample Request

curl https://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/charge/$chargeid/void

Endpoint

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

Endpoint

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

Endpoint

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

Endpoint

POST https://api.paymentwall.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 Paymentwall 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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/subscription/$id/cancel

Code Sample

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

Endpoint

POST https://api.paymentwall.com/api/brick/subscription


Cancel a Subscription

Endpoint

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

Endpoint

POST https://api.paymentwall.com/api/brick/subscription


Cancel a Subscription

Endpoint

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

Subscription Request
Endpoint

POST https://api.paymentwall.com/api/brick/subscription


Get Subscription details

Endpoint

GET https://api.paymentwall.com/api/brick/subscription/$id


Cancel a Subscription

Endpoint

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

Subscription request

Endpoint

POST https://api.paymentwall.com/api/brick/subscription

Sample Request

curl https://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/subscription/$id

Sample Request

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

Endpoint

GET https://api.paymentwall.com/api/brick/subscription/$id

Endpoint

GET https://api.paymentwall.com/api/brick/subscription/$id

Endpoint

GET https://api.paymentwall.com/api/brick/subscription/$id

Endpoint

GET https://api.paymentwall.com/api/brick/subscription/$id

Endpoint

GET https://api.paymentwall.com/api/brick/subscription/$id

Sample Request

curl https://api.paymentwall.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://api.paymentwall.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://api.paymentwall.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://api.paymentwall.com/api/brick/subscription/$id/cancel

Endpoint

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

Endpoint

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

Endpoint

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

Endpoint

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

Sample Request

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

Tokenization API

Brick Tokenization API accepts one-time token generated using Brick.js along with user information parameters and initiates a Auth / Void Transaction. Once the process is complete, the API returns Brick permanent token which can be used multiple times for charging.

Headers
Name Description
x-apikey
required
string
Your Brick Test / Live Private Key
Parameters
Name Description
token
required
string
One time token generated using Brick.js
email
required
email
User’s Email address
firstname
required
string
First Name of the user
lastname
required
string
Last Name of the user