📍 Bolt Help / Products / Checkout / Bolt Checkout Direct API Integration Guide / Bolt Checkout Direct API Integration Guide
Bolt Checkout Direct API Integration Guide
Learn the basics of setting up a direct API integration using our PHP library.

TIP

Use this guide to set up a direct API Bolt Checkout flow on your website using our PHP library.

Pre-requisites

You must have a Bolt Merchant account to begin. If you do not yet have an account, contact sales to begin onboarding.

API Keys

You must have access to your merchant account’s production and sandbox keys to set up this integration. Both admin and developer-level roles have access to keys; if you are a developer and you do not have access, reach out to your Bolt Admin.

  1. Login to the Merchant Dashboard.
  2. Navigate to Developers.
  3. Scroll to Keys.
  4. Select Click to Reveal

NOTE

The Publishable Key supports the multi-step checkout use case by default. To build other checkout flows such as Payment-Only, switch divisions using the Division dropdown. The publishable key is a long string of lower and upper case letters and numbers that consists of three sections.

Environments

You must have all of the following merchant accounts set up to build, test, and deploy your integration:

WARNING

Never share your API Keys or Signing Secrets externally.

PHP Examples

Use your API keys and environment URLs to set up your config.php and init_example.php configurations. The following examples can be downloaded from our PHP library.

config.php

<?php

return [
    'API_KEY' => '{{YOUR_API_KEY}}',
    'IS_SANDBOX' => true,
    'AUTH_CAPTURE' => true,
    'SIGNING_SECRET' => '{{YOUR_SIGNING_SECRET}}',
    'PUBLISHABLE_KEY' => '{{YOUR_PUBLISHABLE_KEY}}',
    'PUBLISHABLE_KEY_PAYMENT_ONLY' => '{{YOUR_PAYMENT_ONLY_DIVISION_PUBLISHABLE_KEY}}',
    'CONNECT_SANDBOX_BASE' => 'https://connect-sandbox.bolt.com',
    'CONNECT_PRODUCTION_BASE' => 'https://connect.bolt.com',
    'API_SANDBOX_URL' => 'https://api-sandbox.bolt.com',
    'API_PRODUCTION_URL' => 'https://api.bolt.com'
];

init_example.php

<?php
require(dirname(__DIR__) . '/init.php');
require(dirname(__FILE__) . '/Data.php');
$config = require(dirname(__FILE__) . '/config.php');

// Set configuration data for example
\BoltPay\Bolt::$apiKey = @$config['API_KEY'];
\BoltPay\Bolt::$apiPublishableKey = @$config['PUBLISHABLE_KEY'];
\BoltPay\Bolt::$apiPublishablePaymentOnlyKey = @$config['PUBLISHABLE_KEY_PAYMENT_ONLY'];
\BoltPay\Bolt::$signingSecret = @$config['SIGNING_SECRET'];
\BoltPay\Bolt::$isSandboxMode = @$config['IS_SANDBOX'];
\BoltPay\Bolt::$authCapture = @$config['AUTH_CAPTURE'];
\BoltPay\Bolt::$connectSandboxBase = !@$config['CONNECT_SANDBOX_BASE'] ?: $config['CONNECT_SANDBOX_BASE'];
\BoltPay\Bolt::$connectProductionBase = !@$config['CONNECT_PRODUCTION_BASE'] ?: $config['CONNECT_PRODUCTION_BASE'];
\BoltPay\Bolt::$apiSandboxUrl = !@$config['API_SANDBOX_URL'] ?: $config['API_SANDBOX_URL'];
\BoltPay\Bolt::$apiProductionUrl = @$config['API_PRODUCTION_URL'] ?: $config['API_PRODUCTION_URL'];

How to Integrate with Bolt Checkout

  1. Generate an order token by sending a POST request to /v1/merchant/orders.
  2. Install the Checkout Button on your storefront using /v1/checkout_button.
  3. Build out your Merchant Callback API to interact with the Bolt API and handle various operations for the order, such as:
  4. Listen for webhook events related to the order’s changing transaction status.

Sections in This Guide

Filter by Section
Filter by Topic