Skip to main content

Quickstart

This quickstart guide walks you through building a simple use case in sandbox.

You can fully use Quickstart Postman collection to follow along.

The guide will show you how to:

  • Create an account under an individual's name (Peter Parker)
  • Fund it with $1,000
  • Create a virtual debit card under this account
  • Spend $500 at Amazon with that card

Prerequisites

  1. Sign up for a sandbox account and choose Custom Build.
  2. Developer → API Tokens — create a token with all scopes.

Step 1 — Create an Application

To identify a customer, create an Application with their details.

Once the application is approved, a Customer is created.

The response includes the Customer id under relationships.

Use that id when creating the account.

curl -X POST 'https://api.s.unit.sh/applications'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "individualApplication",
"attributes": {
"ssn": "721074426",
"fullName": {
"first": "Peter",
"last": "Parker"
},
"dateOfBirth": "2001-08-10",
"address": {
"street": "20 Ingram St",
"city": "Forest Hills",
"state": "NY",
"postalCode": "11375",
"country": "US"
},
"email": "peter@oscorp.com",
"phone": {
"countryCode": "1",
"number": "5555555555"
},
"ip": "127.0.0.2",
"occupation": "ArchitectOrEngineer",
"annualIncome": "Between50kAnd100k",
"sourceOfIncome": "EmploymentOrPayrollIncome",
"tags": {
"userId": "106a75e9-de77-4e25-9561-faffe59d7814"
},
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8"
}
}
}'

Step 2 — Create a Deposit Account

Accounts are created under a Customer.

Use the customer id from the previous step to create a Deposit Account for Peter Parker.

curl -X POST 'https://api.s.unit.sh/accounts'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "depositAccount",
"attributes": {
"depositProduct": "checking",
"tags": {
"purpose": "checking"
},
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8"
},
"relationships": {
"customer": {
"data": {
"type": "individualCustomer",
"id": "20001"
}
}
}
}
}'

Step 3 — Fund the Account

Before Peter can spend, the account needs a balance.

To fund Peter's account, use the "incoming ACH credit" sandbox simulation.

The request below adds $1,000.

curl -X POST 'https://api.s.unit.sh/sandbox/payments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "achPayment",
"attributes": {
"amount": 100000,
"direction": "Credit",
"description": "Payment from Sandbox"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "42"
}
}
}
}
}'

Step 4 — Create a Virtual Debit Card

Create a virtual debit card on Peter's account.

Once created, virtual cards can be used for purchases right away.

curl -X POST 'https://api.s.unit.sh/cards'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "individualVirtualDebitCard",
"attributes": {
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8",
"limits": {
"dailyWithdrawal": 50000,
"dailyPurchase": 50000,
"monthlyWithdrawal": 500000,
"monthlyPurchase": 700000
}
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "42"
}
}
}
}
}'

Step 5 — Make a Card Purchase

In sandbox, card purchases are simulated — they debit the account like a real transaction.

Send the request below to simulate a $500 purchase at Amazon.

Use the last4Digits from the card on Peter's account.

curl -X POST 'https://api.s.unit.sh/sandbox/purchases'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "purchaseTransaction",
"attributes": {
"amount": 50000,
"direction": "Debit",
"merchantName": "Amazon",
"merchantType": 1000,
"last4Digits": "1234"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "42"
}
}
}
}
}'