APIs
Create a Book payment
| Verb | POST |
| URL | https://api.s.unit.sh/payments |
| Required Scope | payments-write |
| Data Type | bookPayment |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| amount | integer | The amount (in cents). |
| description | string | Payment description (maximum of 80 characters), this will show up on statement of the counterparty. |
| transactionSummaryOverride Optional | string | Optional. If this field is populated, its contents will be returned as the bookTransaction's summary field (maximum of 100 characters). |
| idempotencyKey Optional | string | Optional. See Idempotency. |
| tags Optional | object | Optional. See Tags. Tags that will be copied to any transaction that this payment creates (see Tag Inheritance). |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The Deposit Account originating the payment. |
| counterpartyAccount | JSON:API Relationship | The Counterparty account the payment to be made to. |
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": "bookPayment",
"attributes": {
"amount": 10000,
"description": "Funding"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "555"
}
},
"counterpartyAccount": {
"data": {
"type": "depositAccount",
"id": "99821"
}
}
}
}
}'
Response
Response is a JSON:API document.
Example Response:
{
"data": {
"type": "bookPayment",
"id": "1232",
"attributes": {
"createdAt": "2021-02-21T13:03:19.025Z",
"amount": 1500,
"direction": "Credit",
"description": "Funding",
"status": "Sent"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "555"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10000"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "99821"
}
},
"counterpartyCustomer": {
"data": {
"type": "customer",
"id": "10000"
}
},
"transaction": {
"data": {
"type": "transaction",
"id": "1413"
}
}
}
}
}
Update Book Payment
Update a Book Payment.
| Verb | PATCH |
| URL | https://api.s.unit.sh/payments/:paymentId |
| Required Scope | payments-write |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| tags | object | See Updating Tags. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | BookPayment | The updated Book payment resource. |
Update book payment:
curl -X PATCH 'https://api.s.unit.sh/payments/:paymentId'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "bookPayment",
"attributes": {
"tags": {
"by": null,
"uuid": "83033b64-38f8-4dbc-91a1-313ff0156d02"
}
}
}
}'