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.
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.
| Verb | POST |
| URL | https://api.s.unit.sh/sandbox/wire-payments |
| Data Type | wirePayment |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| amount | integer | The amount (in cents). |
| description | string | Payment description (maximum of 50 characters). |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The 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.
| Verb | POST |
| URL | https://api.s.unit.sh/sandbox/wire/transmit |
| Data Type | transmitWirePayment |
| Timeout (Seconds) | 5 |
Relationships
| Name | Type | Description |
|---|---|---|
| payment | JSON:API Relationship | The 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": "FedWirePayment",
"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"
}
}
}
}
}