Authentication

Tip! This guide is for API Key authentication, if you are using OAUTH, please refer to Payment Links for Platforms API.

API Key Authentication is designed for merchants who want to integrate directly with their own Shuttle account. This method uses HTTP Basic Authentication with your account credentials.

How It Works

API Key Authentication uses your Shuttle account username and password to authenticate API requests. Your credentials are encoded using Base64 and sent in the Authorization header of each request.

Authentication Method

Basic Authentication

Use your Shuttle account credentials with HTTP Basic Authentication:

Authorization: Basic Base64(username:password)

Where username:password is your Shuttle account username and password, encoded in Base64.

Required URL Structure

When using Basic Authentication, you must include your instance ID in the URL path:

https://app.shuttleglobal.com/c/api/instances/{instance_id}/[endpoint]

Replace {instance_id} with your actual Shuttle instance ID.

Implementation Guide

Step 1: Encode Your Credentials

First, create a Base64-encoded string of your username and password:

Format: username:password

Examples:

// JavaScript
const credentials = btoa("your_username:your_password");

// Python
import base64
credentials = base64.b64encode(b"your_username:your_password").decode('ascii')

// curl
curl -u "your_username:your_password" [URL]

Step 2: Make API Requests

Include the encoded credentials in your Authorization header:

Example Request:

GET https://app.shuttleglobal.com/c/api/instances/inst_123/payment_links
Authorization: Basic eW91cl91c2VybmFtZTp5b3VyX3Bhc3N3b3Jk
Content-Type: application/json

Complete Examples:

// JavaScript with fetch
const response = await fetch('https://app.shuttleglobal.com/c/api/instances/inst_123/payment_links', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic ' + btoa('your_username:your_password'),
    'Content-Type': 'application/json'
  }
});

// Node.js with axios
const axios = require('axios');

const response = await axios.get('https://app.shuttleglobal.com/c/api/instances/inst_123/payment_links', {
  auth: {
    username: 'your_username',
    password: 'your_password'
  }
});
# Python with requests
import requests
from requests.auth import HTTPBasicAuth

response = requests.get(
    'https://app.shuttleglobal.com/c/api/instances/inst_123/payment_links',
    auth=HTTPBasicAuth('your_username', 'your_password')
)
# curl examples
curl -u "your_username:your_password" \
  https://app.shuttleglobal.com/c/api/instances/inst_123/payment_links

# Or with manual header
curl -H "Authorization: Basic eW91cl91c2VybmFtZTp5b3VyX3Bhc3N3b3Jk" \
  https://app.shuttleglobal.com/c/api/instances/inst_123/payment_links