Skip to main content

APIs

Create a Book payment

VerbPOST
URLhttps://api.s.unit.sh/payments
Required Scopepayments-write
Data TypebookPayment
Timeout (Seconds)5

Attributes

amount
integer
The amount (in cents).
description
string
Payment description (maximum of 80 characters), this will show up on statement of the counterparty.
transactionSummaryOverrideOptional
string
Optional. If this field is populated, its contents will be returned as the bookTransaction's summary field (maximum of 100 characters).
idempotencyKeyOptional
string
Optional. See Idempotency.
tagsOptional
object
Optional. See Tags. Tags that will be copied to any transaction that this payment creates (see Tag Inheritance).

Relationships

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.

VerbPATCH
URLhttps://api.s.unit.sh/payments/:paymentId
Required Scopepayments-write
Timeout (Seconds)5

Attributes

tags
object

Response

Response is a JSON:API document.

200 OK

data
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"
}
}
}
}'