Simulations (Sandbox only)
Unit's Sandbox environment provides additional operations on top of the regular APIs. Those operations allow you to easily test and simulate activities that would normally take a long time or require interaction with the external world.
A common example for testing would be Simulating a Received ACH Payment to create funds in an account, followed by Simulating a Card Purchase to spend those funds.
Simulation operations are subject to the same authentication scheme as the Live APIs, and therefore require a valid Authentication token.
Create Customer Token Without 2FA
Usually in order to obtain a customer token with write permission we need to perform the following actions:
For simulation purposes we can skip the 2FA requirement by calling only Create Customer Token passing "verificationCode": "000001"
.
curl -X POST 'https://api.s.unit.sh/customers/<CUSTOMER_TOKEN>/token'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "customerToken",
"attributes": {
"scope": "customers accounts payments payments-create counterparties counterparties-create cards-create",
"verificationCode": "000001"
}
}
}'