Getting Started

This guide will walk you through the steps to make your first requests to the sandbox API. Calling endpoints in production will follow a similar process but use different URLs.

Overview

To get started with the Astra API, follow these four steps:

  1. Create your developer account and generate API keys.
  2. Create a user intent.
  3. Authorize your client with the test user.
  4. Make a request to the API with an access_token.

Optional

For a code-based walkthrough of the user onboarding process, see our latest recipe:

📘

If you have a working Python 3 environment, you can copy the code from this recipe and run it to quickly create a user with an access_token.

Create your developer account

You will need an active developer account to use Astra's sandbox API.

Sign up and generate API keys

  1. If you haven't already, browse to our Sandbox Dashboard.
  2. Enter your email and set a password.
  3. Enter your first and last name and agree to our Developer Policy and Terms of Service.
  4. When you click Create Account you will be taken to the Dashboard panel.
  5. On the Dashboard panel fill out the two required fields to generate your application's client_id and client_secret:
    1. Name of your application
    2. Add a support email or URL
    3. Redirect URI for your application (you can change this value any time via the Dashboard)
  6. Click the Save Changes button at the bottom of the page. The page will refresh and reveal a new Keys section which will contain the Client ID and Client Secret for your application.

You now have an active developer account. You can always log into this dashboard again using your email address and password.

You may always return to the dashboard to access your keys.

📘

Note that Redirect URIs are used to guide Users back to a specific page in your application after exiting our SDK. You may register multiple Redirect URIs through your Developer Dashboard, but it's important to note that Redirect URIs must remain consistent in OAuth URLs when an end-user is navigating through our SDK.

Create a user intent

To make requests to the Astra API on behalf of an end user, you need authorization, which requires a test user intent. Follow this process to create one.

Creating a user intent

  1. Create a user intent by following the steps in the guide to testing in the sandbox environment.

Authorize your client with the test user

Most endpoints in the Astra API require the end user to authorize your client application. This process generates the authorization code that you exchange for an access token.

  1. Go to the OAuth URL generated in the dashboard. In the Action Type list, select Collect Authorization.
  2. Use the test user intent that you created earlier to sign in, and then select Authorize.
  3. If authorization succeeds, Astra redirects the user to the URI associated with your developer account.
  4. Copy the authorization_code value from the URL.
  5. Exchange the authorization_code for an access_token by sending a POST request to the /v1/oauth/token endpoint.
📘

To securely exchange the authorization_code in step 5, use an API tool such as Postman or a server. If your client is a single-page application (SPA), contact us for more information.

Make a request to the API with an access token

All endpoints that interact with an end user's Accounts or Routines require an access token in the API request header.

  1. Copy the access_token from the previous section.
  2. Add Authorization: Bearer access_token to the header of a request.
  3. Send a request to the API. We recommend using the GET /v1/accounts endpoint.
  4. If the request succeeds, the API returns the appropriate payload.
  5. Contact Astra to configure your client for the payment solutions you plan to use:
  6. You're now ready to set up automated Routines and Transfers.

Did this page help you?