Resources »

Guides »

Integrations »

Stripe »

Cerb + Stripe

Introduction

In this guide we’ll walk through the process of linking Cerb to Stripe. You’ll be able to use Stripe’s full API from bots in Cerb to automate whatever you need.

Get your API keys from the Stripe dashboard

  1. Visit the Stripe API keys settings page.

  2. Make a note of your Publishable Key and Secret Key for the next step.

Create the Stripe service in Cerb

  1. Navigate to Setup » Configure » Import Package.

  2. Paste the following package:

     
    	
     {
       "package": {
         "name": "Stripe Connected Service",
         "revision": 1,
         "requires": {
           "cerb_version": "9.1.0",
           "plugins": []
         },
         "configure": {
           "placeholders": [],
           "prompts": [
             {
               "type": "text",
               "label": "Publishable Key",
               "key": "prompt_publishable_key",
               "params": {
                 "default": "",
                 "placeholder": "(paste your Publishable Key)"
               }
             },
             {
               "type": "text",
               "label": "Secret Key",
               "key": "prompt_secret_key",
               "params": {
                 "default": "",
                 "placeholder": "(paste your Secret Key)"
               }
             }
           ]
         }
       },
       "records": [
         {
           "uid": "service_stripe",
           "_context": "connected_service",
           "name": "Stripe",
           "extension_id": "cerb.service.provider.http.basic",
           "params": {
             "base_url": "https://api.stripe.com/"
           }
         },
         {
           "uid": "account_stripe",
           "_context": "connected_account",
           "name": "Stripe",
           "service_id": "{{{uid.service_stripe}}}",
           "owner__context": "cerberusweb.contexts.app",
           "owner_id": "0",
           "params": {
             "username": "{{{prompt_publishable_key}}}",
             "password": "{{{prompt_secret_key}}}"
           }
         }
       ]
     }
    	
     
     
  3. Click the Import button.

  4. Enter your publishable and secret keys from Stripe.

  5. Click the Import button again.

Use the connected account in bot behaviors

You can use the connected account you just created to access Stripe’s API from bot behaviors in Cerb. This is typically accomplished using the Execute HTTP Request action from a bot, and selecting the connected account in the Authentication: section.

You can import the Stripe Bot package for a working example.