Skip to main content

Sandbox Simulations

Unit exposes the following sandbox-specific endpoints, in addition to all other endpoints. They allow you to easily test and simulate real-world events - external activity, or internal activity that may normally take a long time to occur.

Note

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

Transmit ACH repayment

This API allows you to simulate a file transmission to the network for an existing ACH repayment with Pending status. This operation will also transmit the underlying ACH payment. After transmission, the status would change to Clearing for the ACH repayment and the underlying ACH Debit payment. Payment Clearing and Repayment Status Changed webhook events will be fired.

VerbPOST
URLhttps://api.s.unit.sh/sandbox/ach-repayments/transmit
Data TypetransmitAchRepayment
Timeout (Seconds)5

Relationships

NameTypeDescription
repaymentJSON:API RelationshipThe ACH Repayment to transmit.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/ach-repayments/transmit'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "transmitAchRepayment",
"relationships": {
"repayment": {
"data": {
"type": "achRepayment",
"id": "10"
}
}
}
}
}'
Example Response:
{
"data": {
"type": "achRepayment",
"id": "8",
"attributes": {
"createdAt": "2024-05-02T13:56:15.975Z",
"amount": 1,
"direction": "Debit",
"description": "test",
"isCapitalPartner": false,
"status": "Clearing",
"reason": null
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "10003"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10034"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1048"
}
}
}
}
}

Clear ACH repayment

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

VerbPOST
URLhttps://api.s.unit.sh/sandbox/ach-repayments/clear
Data TypeclearAchrepayment
Timeout (Seconds)5

Relationships

NameTypeDescription
repaymentJSON:API RelationshipThe ACH Repayment to be cleared.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/ach-repayments/clear'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "clearAchRepayment",
"relationships": {
"repayment": {
"data": {
"type": "achRepayment",
"id": "10"
}
}
}
}
}'
Example Response:
{
"data": {
"type": "achRepayment",
"id": "8",
"attributes": {
"createdAt": "2024-05-02T13:56:15.975Z",
"amount": 1,
"direction": "Debit",
"description": "test",
"isCapitalPartner": false,
"status": "Sent",
"reason": null
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "10003"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10034"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1048"
}
}
}
}
}

Return ACH repayment

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

VerbPOST
URLhttps://api.s.unit.sh/sandbox/ach-repayments/return
Data TypereturnAchRepayment
Timeout (Seconds)5

Relationships

NameTypeDescription
repaymentJSON:API RelationshipThe ACH Repayment to be returned.
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/ach-repayments/return'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "returnAchRepayment",
"relationships": {
"repayment": {
"data": {
"type": "achRepayment",
"id": "10"
}
}
}
}
}'
Example Response:
{
"data": {
"type": "achRepayment",
"id": "5",
"attributes": {
"createdAt": "2024-04-30T15:18:56.677Z",
"amount": 1,
"direction": "Debit",
"description": "test",
"isCapitalPartner": true,
"status": "Returned",
"reason": "R01"
},
"relationships": {
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10010"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1045"
}
}
}
}
}

Simulate Originating Recurring Repayment

Simulates an origination of a repayment from a Recurring Repayment program. This allows you to simulate the creation of a scheduled Repayment without needing to wait for the full cycle to end. After originating a repayment, a Repayment Created, Payment Created for the underlying payment and Transaction Created webhook events will be fired.

NOTE: if the provided Credit Account has a balance of 0, a Recurring Repayment Skipped event will be fired instead.

VerbPOST
URLhttps://api.s.unit.sh/sandbox/recurring-repayments/5/originate
Timeout (Seconds)5
Example Request:
curl -X POST 'https://api.s.unit.sh/sandbox/recurring-repayments/5/originate'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{}'
Example Response:
{
"data": {
"type": "recurringCapitalPartnerBookRepayment",
"id": "1",
"attributes": {
"createdAt": "2024-02-29T11:27:13.751Z",
"updatedAt": "2024-05-02T13:26:21.269Z",
"schedule": {
"startTime": "2024-02-21",
"interval": "Monthly",
"nextScheduledAction": "2024-07-21",
"dayOfMonth": 21
},
"description": "Capital Partner Book Repayments",
"transactionSummaryOverride": "override",
"tags": {},
"numberOfRepayments": 4,
"status": "Active"
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10005"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10012"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10000"
}
}
}
}
}