Skip to content

Authentication

Authentication with the API

To authenticate with the API, use this code:

1
curl -u <your_api_key>: "https://api.stancer.com/v1/checkout/paym_SKMLflt8NBATuiUzgvTYqsw5"

Warning

Make sure to replace <your_api_key> with your API key.

1
2
3
4
5
6
use Stancer::Config;

my $config = Stancer::Config->init(['<your_public_keys>', '<your_secret_keys>']);

$config->mode(Stancer::Config::TEST); # Not needed, TEST mode is set by default
                                    # But you need to change the mode to go on production ;)

Warning

Make sure to replace <your_public_keys> and <your_secret_keys> with your API keys (test and production).
We will use the right key depending on mode configuration.

1
2
3
4
5
6
<?php
$config = Stancer\Config::init(['<your_public_keys>', '<your_secret_keys>']);

$config->setMode(Stancer\Config::TEST_MODE); # Not needed, TEST mode is set by default
                                           # But you need to do it to go on production ;)
?>

Warning

Make sure to replace <your_public_keys> and <your_secret_keys> with your API keys (test and production).
We will use the right key depending on mode configuration.

1
2
3
4
import Stancer

conf = Stancer.Config()
conf.keys = ('<your_public_keys>', '<your_secret_keys>')

Warning

Make sure to replace <your_public_keys> and <your_secret_keys> with your API keys (test and production).
We will use the right key depending on mode configuration.

Stancer's payment service use API keys to allow access to the API. You can register for a new API key at our SignUp website.

The authentication to the API is performed via HTTP Basic Auth, you do not need to provide a password. Stancer's payment service expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Basic eW91cl9hcGlfa2V5Og==