By default, all checks created in the sandbox environment will follow the normal check issuing workflow until they reach a sent
status. Checks created in sandbox that are in the sent
status will remain in this status until they expire and are subsequently moved to the expired
status 180 days after they are created, or until a stop_payment
request is made on the check which moves it to the stop_payment_pending
status.
Any sandbox webhooks configured for check create or check updates will automatically work.
Issuing A Check
Example Request to Issue a Check
When a check is issued, it will be in a status of pending
.
curl -u $API_KEY_ID:$API_SECRET_KEY https://api.sandbox.treasuryprime.com/check \
-H 'Content-Type: application/json' \
-d '{
"account_id": "acct_1234567890",
"amount": "900.00",
"message": "This is a test message.",
"memo": "This is a test memo",
"recipient": {
"name": "George Washington",
"address": {
"city": "Washington",
"postal_code": "20003",
"state": "DC",
"street_line_1": "1600 Pennsylvania Ave.",
"street_line_2": ""
}
}'
Updating A Check's Status
Checks in sandbox can only be updated to one of two statuses via the API: canceled
or stop_payment_pending
.
Cancel A Check
Checks can only be canceled
within 1 hour of it being created while it is in a pending
status. After this 1-hour window passes,
a check is updated from the pending
status to the sent
status.
Example Request Cancel a Check
curl -u $API_KEY_ID:$API_SECRET_KEY https://api.sandbox.treasuryprime.com/check/ch_1234567890 \
-X PATCH \
-H 'Content-Type: application/json' \
-d '{
"status": "canceled"
}'
Request Stop Payment
A stop_payment
request can be made to checks that are no longer in a pending
status and have transitioned into the sent
status. In sandbox, when a check is moved to the stop_payment_pending
status it will remain in that status until it is moved to the expired
status 180 days after the date it was created.
Example Request to Request stop_payment
curl -u $API_KEY_ID:$API_SECRET_KEY https://api.sandbox.treasuryprime.com/check/ch_1234567890 \
-X PATCH \
-H 'Content-Type: application/json' \
-d '{
"status": "stop_payment"
}'