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:
- Create your developer account and generate API keys.
- Create a user intent.
- Authorize your client with the test user.
- 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
- If you haven't already, browse to our Sandbox Dashboard.
- Enter your email and set a password.
- Enter your first and last name and agree to our Developer Policy and Terms of Service.
- When you click
Create Accountyou will be taken to the Dashboard panel. - On the Dashboard panel fill out the two required fields to generate your application's
client_idandclient_secret:- Name of your application
- Add a support email or URL
- Redirect URI for your application (you can change this value any time via the Dashboard)
- 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
- 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.
- Go to the OAuth URL generated in the dashboard. In the Action Type list, select Collect Authorization.
- Use the test user intent that you created earlier to sign in, and then select Authorize.
- If authorization succeeds, Astra redirects the user to the URI associated with your developer account.
- Copy the
authorization_codevalue from the URL. - Exchange the
authorization_codefor anaccess_tokenby sending aPOSTrequest to the/v1/oauth/tokenendpoint.
To securely exchange the
authorization_codein 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.
- Copy the
access_tokenfrom the previous section. - Add
Authorization: Bearer access_tokento the header of a request. - Send a request to the API. We recommend using the
GET /v1/accountsendpoint. - If the request succeeds, the API returns the appropriate payload.
- Contact Astra to configure your client for the payment solutions you plan to use:
- Instant Disbursements (account-to-card, also called P2C), in either of its two modes:
- Instant Funding (card-to-card)
- Card to Account
- Accelerated ACH (account-to-account)
- Real-Time and Same-Day Transfers
- Book Transfer
- Cross-Border Payments
- You're now ready to set up automated Routines and Transfers.
Updated 1 day ago