Skip to main content

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.

note

Simulation operations are subject to the same authentication scheme as the Production APIs, and therefore require a valid Authentication token.

Application Statuses#

By default, all applications in our sandbox will be approved immediately. Below are ways to simulate other statuses:

StatusDescription
PendingReviewIndividual application: set the SSN on the application to 000000004. Business application: set the SSN of the Officer or any Beneficial Owner on the application to 000000004.
AwaitingDocumentsIndividual application: set the SSN on the application to 000000002 to simulate AwaitingDocuments for Address Verification, or 000000003 to simulate AwaitingDocuments for Id Document, or 000000006 to simulate AwaitingDocuments for Social Security Card. Business application: set the SSN of the Officer on the application to 000000005.
DeniedIndividual application: set the SSN on the application to 000000001.

Approve Application#

Approves an Application under PendingReview or AwaitingDocuments status. The Customer Created) webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/applications/{applicationId}/approve
Data TypeapplicationApprove
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/applications/10001/approve'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "applicationApprove",    "attributes": {      "reason": "sandbox"    }  }}'

Deny Application#

Denies an Application under PendingReview or AwaitingDocuments status. The Application Denied webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/applications/{applicationId}/deny
Data TypeapplicationDeny
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/applications/10001/deny'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "applicationDeny",    "attributes": {      "reason": "sandbox"    }  }}'

Approve Document#

Approves an Application Document. The Document Approved) webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/applications/{applicationId}/documents/{documentId}/approve
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/applications/10001/documents/1/approve'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{}'

Reject Document#

Rejects an Application Document. The Document Rejected) webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/applications/{applicationId}/documents/{documentId}/reject
Data TypedocumentReject
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/applications/10001/documents/1/reject'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "documentReject",    "attributes": {      "reason": "blurry image",      "reasonCode": "PoorQuality"    }  }}'

Receive ACH payment#

This API allows you to simulate an incoming ACH payment with the specified amount (in cents) for testing purposes. The Transaction Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/payments
Data TypeachPayment

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).
directionstringThe direction in which the funds flow (currently, only Credit is supported).
descriptionstringPayment description (maximum of 50 characters).

Relationships#

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account receiving the payment.
Example Request:
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": 10000,      "direction": "Credit",      "description": "Payment from Sandbox"    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "1000"        }      }    }  }}'

Note: the status for the sandbox payment requests is always Sent. Please refer to ACH Status for more information about the status codes.

Example Response:
{  "data": {    "type": "achPayment",    "id": "3",    "attributes": {      "createdAt": "2020-06-29T13:17:59.816Z",      "amount": 10000,      "direction": "Credit",      "description": "Payment from Sandbox",      "status": "Sent",      "reason": null    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "1000"        }      },      "customer": {        "data": {          "type": "individualCustomer",          "id": "1"        }      }    }  }}

Transmit ACH payment#

This API allows you to simulate a file transmission to the network for an existing ACH payment with Pending status. After transmission, the status would change to Sent for ACH Credit payment and Clearing for ACH Debit payment. The Payment Sent or Payment Clearing webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/ach/transmit
Data TypetransmitAchPayment

Relationships#

NameTypeDescription
paymentJSON:API RelationshipThe ACH Payment to transmit.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/ach/transmit'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "transmitAchPayment",    "relationships": {      "payment": {        "data": {          "type": "achPayment",          "id": "10"        }      }    }  }}'
Example Response:
{  "data": {    "type": "achPayment",    "id": "10",    "attributes": {      "createdAt": "2021-03-09T15:02:01.543Z",      "amount": 10000,      "direction": "Debit",      "description": "Payment from Sandbox",      "status": "Clearing"    },    "relationships": {      "account": {        "data": {          "type": "account",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      }    }  }}

Clear ACH payment#

This API allows you to immediately clear an existing ACH payment with Clearing status without waiting for the end of the clearing period. The Payment Sent and Transaction Created webhook events will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/ach/clear
Data TypeclearAchPayment

Relationships#

NameTypeDescription
paymentJSON:API RelationshipThe ACH Payment to be cleared.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/ach/clear'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "clearAchPayment",    "relationships": {      "payment": {        "data": {          "type": "achPayment",          "id": "10"        }      }    }  }}'
Example Response:
{  "data": {    "type": "achPayment",    "id": "10",    "attributes": {      "createdAt": "2021-03-09T15:02:01.543Z",      "amount": 10000,      "direction": "Debit",      "description": "Payment from Sandbox",      "status": "Sent"    },    "relationships": {      "account": {        "data": {          "type": "account",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      }    }  }}

Return ACH payment#

This API allows you to return an existing ACH payment for testing purposes, the status of payment can either be Clearing or Sent. The Payment Returned and Transaction Created webhook events will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/ach/return
Data TypereturnAchPayment

Relationships#

NameTypeDescription
paymentJSON:API RelationshipThe ACH Payment to be returned.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/ach/return'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "returnAchPayment",    "relationships": {      "payment": {        "data": {          "type": "achPayment",          "id": "10"        }      }    }  }}'
Example Response:
{  "data": {    "type": "achPayment",    "id": "10",    "attributes": {      "createdAt": "2021-03-09T13:51:51.100Z",      "amount": 10000,      "direction": "Debit",      "description": "Payment from Sandbox",      "status": "Returned",      "reason": "R01"    },    "relationships": {      "account": {        "data": {          "type": "account",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      }    }  }}

Receive Wire payment#

This API allows you to simulate an incoming wire payment with the specified amount (in cents) for testing purposes. The Transaction Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/wire-payments
Data TypewirePayment

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).
descriptionstringPayment description (maximum of 50 characters).

Relationships#

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account receiving the payment.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/wire-payments'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "wirePayment",    "attributes": {      "amount": 10000,      "description": "Wire Payment from Sandbox"    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      }    }  }}'
Example Response:
{  "data": {    "type": "wirePayment",    "id": "108",    "attributes": {      "createdAt": "2021-02-24T11:31:10.009Z",      "amount": 10000,      "description": "Wire Payment from Sandbox"    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      }    }  }}

Transmit Wire payment#

This API allows you to simulate a Wire payment transmission to the network for an existing Wire payment with Pending status. After transmission, the status of the payment would change to Sent. The Payment Sent webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/wire/transmit
Data TypetransmitWirePayment

Relationships#

NameTypeDescription
paymentJSON:API RelationshipThe Wire Payment to transmit.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/wire/transmit'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "transmitWirePayment",    "relationships": {      "payment": {        "data": {          "type": "wirePayment",          "id": "2"        }      }    }  }}'
Example Response:
{  "data": {    "type": "wirePayment",    "id": "2",    "attributes": {      "createdAt": "2021-09-15T10:23:56.716Z",      "amount": 200,      "description": "Wire payment"    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10000"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      }    }  }}

Create Card Authorization#

This API allows you to simulate a card purchase authorization with the specified amount (in cents) for testing purposes. The Authorization Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/authorizations
Required Scopeauthorization

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).
cardLast4DigitsstringThe last 4 digits of the debit card involved in the authorization.
merchantNamestringThe name of the merchant.
merchantTypeintegerThe 4-digit ISO 18245 merchant category code (MCC). Use any number (e.g. 1000 for testing).
merchantLocationstringOptional. The location (city, state, etc.) of the merchant.
recurringbooleanOptional. Default: false. Indicates whether the authorization is recurring

Relationships#

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account of the customer.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/authorizations'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "authorization",    "attributes": {      "amount": 2500,      "cardLast4Digits": "0019",      "merchantName": "Apple Inc.",      "merchantType": 1000,      "merchantLocation": "Cupertino, CA",      "recurring": false    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      }    }  }}'
Example Response:
{  "data": {    "type": "authorization",    "id": "125",    "attributes": {      "createdAt": "2021-03-01T12:41:15.063Z",      "amount": 2500,      "cardLast4Digits": "0019",      "merchant": {        "name": "Apple Inc.",        "type": 1000,        "category": "",        "location": "Cupertino, CA"      }    },    "relationships": {      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      },      "account": {        "data": {          "type": "account",          "id": "10001"        }      }    }  }}

Create Card Purchase#

This API allows you to simulate a card purchase (or a refund) with the specified amount (in cents) for testing purposes. The Transaction Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/purchases
Data TypepurchaseTransaction

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).
directionstringThe direction of the purchase- Debit for purchase, Credit for refund.
merchantNamestringThe name of the merchant.
merchantTypeintegerThe 4-digit ISO 18245 merchant category code (MCC). Use any number (e.g. 1000 for testing).
merchantLocationstringOptional. The location (city, state, etc.) of the merchant.
coordinatesCoordinatesOptional. Coordinates of the purchase transaction.
last4DigitsstringThe last 4 digits of the debit card involved in the purchase
recurringbooleanOptional. Default: false. Indicates whether the transaction is recurring

Relationships#

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account of the customer.
authorizationJSON:API RelationshipOptional. Simulates a card purchase with a prior Authorization request (see Authorizations. This will cause the authorization to be removed.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/authorizations'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "purchaseTransaction",    "attributes": {      "amount": 1000,      "direction": "Debit",      "merchantName": "Apple Inc.",      "merchantType": 1000,      "merchantLocation": "Cupertino, CA",      "coordinates": {        "longitude": -77.0364,        "latitude": 38.8951      },      "last4Digits": "1234",      "recurring": false    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10000"        }      }    }  }}'
Example Response:
{  "data": {    "type": "purchaseTransaction",    "id": "12",    "attributes": {      "createdAt": "2020-10-12T21:22:09.528Z",      "amount": 2500,      "direction": "Debit",      "balance": 148490,      "merchantName": "Apple Inc.",      "merchantType": 1000,      "merchantLocation": "Cupertino, CA",      "coordinates": {        "longitude": -77.0364,        "latitude": 38.8951      },      "last4Digits": "1234",      "recurring": false    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "2"        }      },      "card": {        "data": {          "type": "card",          "id": "2"        }      }    }  }}

Create Card Purchase Reversal#

This API allows you to simulate a Purchase Reversal with the specified amount (in cents) for testing purposes. The Transaction Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/reversals
Data TypecardReversalTransaction

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).

Relationships#

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account of the customer.
relatedTransactionJSON:API RelationshipOptional. The Purchase Transaction which the reversal is related to.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/reversals'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "cardReversalTransaction",    "attributes": {      "amount": 2500    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      },      "relatedTransaction": {        "data": {          "type": "transaction",          "id": "150"        }      }    }  }}'
Example Response:
{  "data": {    "type": "cardReversalTransaction",    "id": "165",    "attributes": {      "createdAt": "2021-03-08T13:05:45.924Z",      "amount": 2500,      "balance": 855500    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      },      "relatedTransaction": {        "data": {          "type": "transaction",          "id": "150"        }      }    }  }}

Create ATM Withdrawal#

This API allows you to simulate an ATM Withdrawal with the specified amount (in cents) for testing purposes. The Transaction Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/atm-withdrawals
Data TypeatmTransaction

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).
atmNamestringThe name of the ATM.
atmLocationstringOptional. The location (city, state, etc.) of the ATM.
last4DigitsstringThe last 4 digits of the debit card involved in the withdrawal.

Relationships#

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account of the customer.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/atm-withdrawals'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "atmTransaction",    "attributes": {      "amount": 2500,      "atmName": "HOME FED SAV BK",      "atmLocation": "Cupertino, CA, US",      "last4Digits": "1234"    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      }    }  }}'
Example Response:
{  "data": {    "type": "atmTransaction",    "id": "166",    "attributes": {      "createdAt": "2021-03-08T13:18:27.365Z",      "amount": 2500,      "balance": 855000,      "atmName": "HOME FED SAV BK",      "atmLocation": "Cupertino, CA, US",      "last4Digits": "1234"    },    "relationships": {      "account": {        "data": {          "type": "depositAccount",          "id": "10001"        }      },      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      },      "card": {        "data": {          "type": "card",          "id": "2"        }      }    }  }}

Activate Card#

Activate a card. The Card Activated webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/cards/{cardId}/activate
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/cards/9/activate' \-H "Authorization: Bearer ${TOKEN}"

Generate Account Statement#

Generate an account statement. The statement includes any transactions performed between the beginning of the current month and up until EOD yesterday. The Statements Created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/accounts/{accountId}/generate-statement
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/accounts/10001/generate-statement' \-H "Authorization: Bearer ${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".

Example Request:
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"    }  }}'

Create Card Purchase Authorization Request#

This API allows you to simulate a card purchase authorization request with the specified amount (in cents) for testing purposes. It can be used to test the Programmatic Authorization of Card Purchases functionality, as the Pending Authorization Request webhook event will be fired .

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/authorization-requests/purchase
Data TypepurchaseAuthorizationRequest

Attributes#

NameTypeDescription
amountintegerThe amount (in cents).
merchantNamestringThe name of the merchant.
merchantTypeintegerThe 4-digit ISO 18245 merchant category code (MCC). Use any number (e.g. 1000 for testing).
merchantLocationstringOptional. The location (city, state, etc.) of the merchant.
recurringbooleanOptional. Default: false. Indicates whether the authorization is recurring

Relationships#

NameTypeDescription
cardJSON:API RelationshipThe debit card used in the purchase.
curl -X POST 'https://api.s.unit.sh/sandbox/authorization-requests/purchase'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{  "data": {    "type": "purchaseAuthorizationRequest",    "attributes": {      "amount": 2500,      "merchantName": "Apple Inc.",      "merchantType": 1000,      "merchantLocation": "Cupertino, CA",      "recurring": false    },    "relationships": {      "card": {        "data": {          "type": "card",          "id": "7"        }      }    }  }}'
Example Response:
{  "data": {    "type": "purchaseAuthorizationRequest",    "id": "5",    "attributes": {      "createdAt": "2021-06-24T08:07:22.520Z",      "amount": 2500,      "status": "Pending",      "partialApprovalAllowed": false,      "merchant": {        "name": "Apple Inc.",        "type": 1000,        "category": "",        "location": "Cupertino, CA"      },      "recurring": false    },    "relationships": {      "customer": {        "data": {          "type": "customer",          "id": "10000"        }      },      "account": {        "data": {          "type": "account",          "id": "10001"        }      },      "card": {        "data": {          "type": "card",          "id": "7"        }      }    }  }}

Transmit Check Deposit#

This API allows you to simulate a file transmission to the network for an existing Check Deposit with Pending status. After transmission, the status would change to Clearing. The Check Deposit Clearing) webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/check-deposits/{checkDepositId}/transmit
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/check-deposits/122/transmit' \-H "Authorization: Bearer ${TOKEN}"

Clear Check Deposit#

This API allows you to immediately clear an existing Check Deposit with Clearing status without waiting for the end of the clearing period. The Check Deposit Sent) and the Transaction Created webhook events will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/check-deposits/{checkDepositId}/clear
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/check-deposits/122/clear' \-H "Authorization: Bearer ${TOKEN}"

Return Check Deposit#

This API allows you to return an existing Check Deposit with Sent status, for testing purposes. The Check Deposit Returned) and the Transaction Created webhook events will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/check-deposits/{checkDepositId}/return
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/check-deposits/122/return' \-H "Authorization: Bearer ${TOKEN}"