Shell Python Node PHP C# Ruby

Authentication

# Curl supports HTTP basic authentication with the `-u` command
# To use the `-u` command, add a `:` onto the API key.
curl "https://api.payload.co/transactions" \
    -u secret_key_3bW9JMZtPVDOfFNzwRdfE:
import payload as pl
pl.api_key = 'secret_key_3bW9JMZtPVDOfFNzwRdfE'
require "payload"
Payload.api_key = "secret_key_3bW9JMZtPVDOfFNzwRdfE"
<?php
require_once('vendor/autoload.php');
use Payload\API as pl;
pl::$api_key = "secret_key_3bW9JMZtPVDOfFNzwRdfE";
?>
var pl = require('payload-api')
pl.api_key = 'secret_key_3bW9JMZtPVDOfFNzwRdfE'
using Payload;
pl.api_key = "secret_key_3bW9JMZtPVDOfFNzwRdfE";

To authenticate with Payload, use the API secret key found in Settings > API Keys. The secret key is passed as the username field in an HTTP Basic Auth header.

Environments & Profiles

Production Request

curl https://api.payload.co \
    -u secret_key_3bW9JMZtPVDOfFNzwRdfE:
import payload as pl
pl.api_key = 'secret_key_3bW9JMZtPVDOfFNzwRdfE'
require 'payload'
Payload.api_key = 'secret_key_3bW9JMZtPVDOfFNzwRdfE'
<?php
require_once('vendor/autoload.php');
use Payload\API as pl;
pl::$api_key = 'secret_key_3bW9JMZtPVDOfFNzwRdfE';
?>
var pl = require('payload-api');
pl.api_key = 'secret_key_3bW9JMZtPVDOfFNzwRdfE'
using Payload;
pl.api_key = "secret_key_3bW9JMZtPVDOfFNzwRdfE";

Test Request

curl https://api.payload.co \
    -u test_secret_key_dwjVajaCQKO4RJuV:
import payload as pl
pl.api_key = 'test_secret_key_dwjVajaCQKO4RJuV'
require 'payload'
Payload.api_key = 'test_secret_key_dwjVajaCQKO4RJuV'
<?php
require_once('vendor/autoload.php');
use Payload\API as pl;
pl::$api_url = 'test_secret_key_dwjVajaCQKO4RJuV';
?>
var pl = require('payload-api');
pl.api_key = 'test_secret_key_dwjVajaCQKO4RJuV'
using Payload;
pl.api_key = "test_secret_key_dwjVajaCQKO4RJuV";

Every environment and profile you have access to within your dashboard will have a unique api key. To learn more about setting up test environments, see test environment.

Authenticating between a sandbox test environment and a production environment is based on the api key. You'll notice that the sandbox api keys will start with test_.