TS Commerce Developers

Payments API

Current version: v1.1 alpha

With APIs for third-party payments, you have the option of integrating payment methods outside of Storeden's systems.

By creating a Storeden application you will receive one keyset for each installation.

With this keyset you have the possibility to enter the payment authorization in the shop that installed the application.

Each keyset can only have one payment authorization.

List external payments method

List all external payments available for your shop.

GET
/payments/list.json
List external payments method Request

$storeden = new Storeden\Storeden($config);
$payments_list = $storeden->get('/payments/list.json');
					
List external payments method Response

[
    {
        "id": "5876525216f46a8729d1585e",
        "label": "Pay with NFC"
    },
    {
        "id": "5a02d8f016f46ab87f4e6b25",
        "label": "Pay By Cash"
    }
]
					

Get External Payment method

Get information about payment authorization attached to the current api key set.

GET
/payments/payment.json
Get External Payment method Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/payments/payment.json');
					
Get External Payment method Response

{
    "groupUID": 132,
    "instance": "5a02dcd516f46a7d6c4e6b5c",
    "label": "Pay By Cash",
    "redirect_url": "\/payments\/success\/{orderid}",
    "id": "5a04233316f46ad334bf3290"
}
					

Add Payment Method

Add payment to the current keyset.

POST
/payments/payment.json
label required (string) Default name for payment method
callback_url required (string) The url which user is redirected to, after new order placed.
Must contains {orderid} to get OrderID param.
get_more (string) The url fetching alternative methods. Require authorization
Add Payment Method Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['label'] = 'Pay by DummyPayments';
$payload['callback_url'] = 'https://www.dummypayments.net/storeden-payments/{orderid}';

$result = $storeden->post('/payments/payment.json', $payload);
					
Add Payment Method Response

{
    "id": "5a265db216f46a0c157b23c6",
    "translation_key": "admin.payments.5a265db216f46a0c157b23c6",
    "payment_authorization": {
        "label": "Pay by DummyPayments",
        "callback_url": "https:\/\/www.dummypayments.net\/storeden-payments\/{orderid}"
    }
}
					

Remove payment authorization

Remove payment authorization from shop. Instance, translation_key and id can be not the same in reinstallation case

DELETE
/payments/payment.json
payment_id required (StoredenID) Your "ID" for payment
Remove payment authorization Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['payment_id'] = '5a265db216f46a0c157b23c6';

$result = $storeden->delete('/payments/payment.json', $payload);
					
Remove payment authorization Response

{
	"n": 1,
	"err": null
}
					

List configured payments

GET
/payments/configured_payment.json
List configured payments Request

$storeden = new Storeden\Storeden($config);

$result = $storeden->get('/payments/configured_payment.json');
					
List configured payments Response

{
    "payments_index": [
        "paypalcheckout",
        "paypal",
        "amazonpay",
        "stripe",
        "630c6997d4029db14a9c2157"
    ],
    "payments": {
        "paypalcheckout": {
            "available": 1,
            "cost": 0,
            "label": "Paypal and credit card"
        },
        "paypal": {
            "available": 1,
            "cost": 0,
            "label": "Paypal"
        },
        "amazonpay": {
            "available": 1,
            "cost": 0,
            "label": "AmazonPay"
        },
        "stripe": {
            "available": 1,
            "cost": 0,
            "label": "Credit card"
        },
        "630c6997d4029db14a9c2157": {
            "available": 1,
            "cost": 0,
            "label": "Klarna",
            "can_have_child": false
        }
    }
}