Instant Debit Funding

What are Debit Cards?

A Debit Card is a type of payment card that deducts or debits funds directly from a User’s checking account. Debit Cards differ from Credit Cards in that the funds are immediately withdrawn from your checking account, while the funds from a Credit card transaction are charged to your line of credit to be paid back at a later date. Debit Cards can be physical (e.g. Visa, Mastercard) or virtual (e.g Apple Pay or Google Pay).

Astra Cards API

Astra is the first and only API to provide fintech developers with a PCI compliant and easy to implement solution for me-2-me transfers between any two debit cards owned by the same individual. With our debit card to debit card solution, settlements are instantaneous, secure, and reliable.

Basic Setup

Below is an outline of the basic steps for standing up me-2-me debit card transactions. In this example, we’ll describe how to connect an external debit card (Card A) and how to issue your own (Card B) to create a Routine of a debit payment type. To learn more about each Card endpoint, please reference our Cards chapter in our documentation.

Obtain an Active Authorization

Obtain an active authorization from the end-user through the Authorization step in our OAuth Module. This step will yield a temporary Authorization code that must be exchanged for an access_token for further API requests to Astra.

Card A: Externally Linked

For all Debit Cards not issued by your company, use our OAuth Module and guide the end–user to the cards/connect screen at https://app.astra.finance/cards/connect to collect their Debit Card information. Astra is PCI compliant and certified.

Card B: Company Issued

Request POST /v1/cards:

curl -X POST 'https://secure.api.astra.finance/v1/cards' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer your_access_token' \
  --data-raw '{
    "card_number": "4242424242424242",
    "card_security_code": "123",
    "expiration_date": "02/24",
    "first_name": "Sally",
    "last_name": "Smith",
    "street_line_1": "123 Astra Ave.",
    "street_line_2": "",
    "city": "Menlo Park",
    "state": "CA",
    "zip_code": "45678"
  }'

Response:

{
    "card_company": "Visa",
    "expiration_date": "02/24",
    "id": "0e241f30-b951-41e3-a89f-31c3a3ed5b2b",
    "last_four_digits": "4242"
}

For your company to issue an end-user a physical or virtual debit card, create the card by way of our POST v1/cards endpoint through our secure API URL. Note that POST requests for this endpoint require you prepend secure. to the api.astra.finance URL. It’s important to note that every OAuth Client (i.e your Company) will need to register at least one Banking Identification Number (BIN) with Astra. All card numbers issued via the POST v1/cards endpoint must match the BIN number that has been registered with Astra.

For Unit customers, please reference their technical documentation below to learn more about enabling card to card payments. Enabling Card to Card Payments with Unit & Astra

GET the IDs for Card A and Card B

Retrieve the ID of Card A and Card B through the GET /v1/cards endpoint.

POST a Routine:

Request POST/routines:

curl -X POST 'https://secure.api.astra.finance/v1/routines' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer your_access_token' \
  --data-raw '{
    "type": "one-time",
    "name": "My Instant Transfer",
    "source_id": "your_source_card_id",
    "destination_id": "your_destination_card_id",
    "amount": 100,
    "start_date": "2022-04-01",
    "payment_type": "debit"
  }'

Response:

{
  "id": "1",
  "type": "one-time",
  "name": "My Instant Transfer",
  "payment_type": "debit",
  "source_id": "source_account_id",
  "destination_id": "destination_account_id",
  "amount": 100,
  "client_correlation_id": "your_unique_id",
  "start_date": "2022-04-01",
  "active": true,
  "status": "active",
  "created": "2022-04-01T15:12:04.746260"
}

POST any Routine and specify the payment type as debit. Use the ID of Card A as the source_id and the ID of Card B as the destination_id. In the blink of an eye, funds from Card A will be withdrawn and be made immediately available via Card B.