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 Live APIs, and therefore require a valid Authentication token.

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
Timeout (Seconds)5

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
Timeout (Seconds)5

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
Timeout (Seconds)5

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
Timeout (Seconds)5

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
Timeout (Seconds)5

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
Timeout (Seconds)5

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 ACH Received Payment

This API allows you to simulate the creation of an ACH received payment for testing purposes. The receivedPayment.created webhook event will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/received-payments
Data TypeachReceivedPayment
Timeout (Seconds)5

Attributes

NameTypeDescription
amountintegerThe amount (in cents).
completionDateRFC3339 Date stringShows the date on which the received ACH will be completed(settled or repaid).
descriptionstringACH description (maximum of 10 characters), also known as Company Entry Description.
companyNamestringThe name by which the originator is known to the receiver. (maximum of 16 characters)
secCodestringOptional. The 3-letter ACH Standard Entry Class (SEC) Code (e.g. WEB, CCD, PPD, etc.). default will be WEB

Relationships

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account receiving the received payment.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/received-payments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "achReceivedPayment",
"attributes": {
"amount": 10000,
"description": "paycheck simulation Sandbox",
"companyName": "UBER LTD",
"completionDate": "2020-07-30",
"secCode": "PPD"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "1000"
}
}
}
}
}'

Note: the status for the created sandbox received payment will bePending. you may advance and/or complete it. Unlike in production, the received payment will never be completed unless the simulate completion is used

Example Response:
{
"data": {
"type": "achReceivedPayment",
"id": "1337",
"attributes": {
"createdAt": "2022-02-01T12:03:14.406Z",
"status": "Pending",
"wasAdvanced": false,
"amount": 500000,
"completionDate": "2020-07-30",
"companyName": "UBER LTD",
"counterpartyRoutingNumber": "051402372",
"description": "Sandbox",
"traceNumber": "123456789123456",
"secCode": "PPD"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "163555"
}
},
"customer": {
"data": {
"type": "customer",
"id": "129522"
}
}
}
}
}

Complete Received Payment

This API allows you to complete a Received Payment with Pending or Advanced status. The receivedPayment.completed and the Transaction Created for the received payment transaction (and repay advance transaction if the received payment was advances) webhook events will be fired.

VerbPOST
Urlhttps://api.s.unit.sh/sandbox/received-payments/{receivedPaymentId}/complete
Timeout (Seconds)5
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/received-payments/101/complete' \
-H "Authorization: Bearer ${TOKEN}"
Example Response
{
"data": {
"type": "achReceivedPayment",
"id": "1337",
"attributes": {
"createdAt": "2022-02-01T12:03:14.406Z",
"status": "Completed",
"wasAdvanced": true,
"amount": 500000,
"completionDate": "2020-07-30",
"companyName": "UBER LTD",
"counterpartyRoutingNumber": "051402372",
"description": "Sandbox",
"traceNumber": "123456789123456",
"secCode": "PPD"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "163555"
}
},
"customer": {
"data": {
"type": "customer",
"id": "129522"
}
},
"receivePaymentTransaction": {
"data": {
"type": "transaction",
"id": "101"
}
},
"paymentAdvanceTransaction": {
"data": {
"type": "transaction",
"id": "202"
}
},
"repayPaymentAdvanceTransaction": {
"data": {
"type": "transaction",
"id": "890"
}
}
}
}
}