Sandbox Integration

Overview

The cards sandbox environment enables you to test your card issuance logic and product experience from your first day developing, without requiring any approval by our bank partner, issuance partner, or card network.

While most endpoints are the same as the standard Bridge API, we do offer some additional features in order to allow you to test money movement in a safe and entirely programmatic fashion.

📘

When interacting with the sandbox, all requests should go to https://api.sandbox.bridge.xyz

Integration

Setup

In order to start your integration, you will need to call the following API which bootstraps your sandbox environment and funds flow.

While you likely use a different funding strategy in production, top_up is the only funding strategy supported in the sandbox.


curl -X POST 'https://api.bridge.xyz/v0/cards_enable\
 --header 'Content-Type: application/json' \
 --header 'Api-Key: <API Key>' \
 -d funding_strategy="top_up"

Creating a card account

You should follow the same steps for creating a customer / card_account, but use the sandbox API URL.

Simulate balance top up

In production, you could top up the card balance by sending funds to the address specified in the funding_instructions of the card account. As it is a normal crypto address, this could be done in a variety of ways, including using Bridge’s very own transfers and virtual accounts APIs.

curl -X POST 'https://api.bridge.xyz/v0/{customer_id}/card_accounts/{card_account_id}/simulate_balance_top_up \
 --header 'Content-Type: application/json' \
 --header 'Api-Key: <API Key>' \
 -d amount="100.0"

Simulate authorization

To simulate a card authorization, you can use the following API:

curl -X POST 'https://api.bridge.xyz/v0/{customer_id}/card_accounts/{card_account_id}/simulate_authorization\
 --header 'Content-Type: application/json' \
 --header 'Api-Key: <API Key>' \
 -d amount="100.0" \ 
 -d merchant_name="test"

When a card transaction is authorized but not yet settled, you will be able to retrieve it using the pending card authorizations endpoint.

Simulate settlement

Similarly, to simulate a card settlement, you can use the following API:

curl -X POST 'https://api.bridge.xyz/v0/{customer_id}/card_accounts/{card_account_id}/simulate_authorization\
 --header 'Content-Type: application/json' \
 --header 'Api-Key: <API Key>' \
 -d amount="100.0" \ 
 -d merchant_name="test" \ 
 -d authorization_id="8c629b9f-f8a6-56a0-a6be-616f87fa564c"

When a card transaction is settled, you will be able to retrieve it using the card transactions endpoint.