Push To Card Payment
Push To Card Payment allows you to move fund from a Deposit Account to an external card instantly. It is an async api, i.e, you will need to subscribe to payment.rejected event and payment.sent in order to understand if the payment was sent or rejected.
Push To Card Status
Push to card payment has a status attribute, which represents its current status.
| Status | Description |
|---|---|
| Pending | Payment was created but not yet proccessed. At this point the funds have already been debited from the Deposit Account but have not yet been sent and are still not available in the external card. |
| Sent | Payment is completed. At this point the funds should become available in the external card. |
| Rejected | Payment was rejected. |
Create Push To Card payment
Create a push to card payment to an external card that is registered in Astra.
| Verb | POST |
| URL | https://api.s.unit.sh/payments |
| Required Scope | payments-write |
| Data Type | pushToCardPayment |
| Timeout (Seconds) | 5 |
Attributes
amount
integer
The amount (in cents).
description
string
Payment description (maximum of 50 characters).
tagsOptional
object
Optional. See Tags. Tags will be inherited to any transaction created by this payment (see Tag Inheritance).
Relationships
Example Request:
curl -X POST 'https://api.s.unit.sh/payments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "pushToCardPayment",
"attributes": {
"amount": "42",
"description": "Push to card payment description",
"configuration": {
"astra": {
"authToken": "<ASTRA_AUTH_TOKEN>",
"institutionId": "astra_ins_942",
"destinationCardId": "8ub2371a-nc35-4e1c-acfb-3fd42317m986",
"routingNumber": "042214241",
"accountNumber": "308423524285",
"referenceId": "referenceId-42"
}
}
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "4242"
}
}
}
}
}'
Response
Example Response:
{
"data": {
"type": "pushToCardPayment",
"id": "7",
"attributes": {
"createdAt": "2023-03-30T11:08:49.411Z",
"amount": 250,
"direction": "Credit",
"description": "My Unit Account to Card Routine #10",
"status": "Pending"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "75"
}
},
"customer": {
"data": {
"type": "customer",
"id": "77"
}
},
"transaction": {
"data": {
"type": "transaction",
"id": "82"
}
},
"org": {
"data": {
"type": "org",
"id": "401"
}
},
"achPayment": {
"data": {
"type": "achPayment",
"id": "188"
}
}
}
}
}