Skip to main content

Book Payments

Create Book Payment

Create a new book payment between accounts.

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

Attributes

NameTypeDescription
amount RequiredintegerThe amount (in cents).
description RequiredstringPayment description (maximum of 80 characters), this will show up on statement of the counterparty.
tags OptionalobjectSee Tags. Tags that will be copied to any transaction that this payment creates (see Tag Inheritance).
idempotencyKey OptionalstringSee Idempotency.

Relationships

NameTypeDescription
account RequiredJSON:API RelationshipThe Deposit Account originating the payment.
operationalAccount RequiredJSON:API RelationshipThe Organization's Operational Account the payment to be made to.

Example Request:

curl -X POST 'https://api.s.unit.sh/ready-to-launch/book-payments' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer ${TOKEN}' \
--data-raw '{
"data": {
"type": "bookPayment",
"attributes": {
"amount": 1000,
"description": "test payment",
"tags": {
"test": "test"
},
"idempotencyKey": "unique-idempotency-key"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "10013"
}
},
"operationalAccount": {
"data": {
"type": "account",
"id": "10020"
}
}
}
}
}'

Response

Returns details of the created book payment including status and associated resources.

Response is a JSON:API document.

200 OK

NameTypeDescription
id RequiredstringIdentifier of the book payment resource.
type RequiredstringType of the book payment resource. The value is always bookPayment.
attributes RequiredJSON ObjectJSON object representing the book payment data.
relationships RequiredJSON:API RelationshipsDescribes relationships between the book payment resource and other resources.

Attributes

NameTypeDescription
createdAt RequiredstringThe date and time the payment was created.
status RequiredstringThe status of the payment.
reason OptionalstringMore information about the failure reason. Present only when the payment status is Rejected.
amount RequiredintegerPayment amount in cents.
description RequiredstringDescription of the payment.
direction RequiredstringThe direction in which the funds flow (always Credit).

Relationships

NameTypeDescription
account RequiredJSON:API RelationshipThe Deposit Account creating the payment.
counterpartyAccount RequiredJSON:API RelationshipThe Deposit Account that is the counterparty (receiving) account for the payment.
customer RequiredOptional, JSON:API RelationshipThe Customer the deposit account belongs to.
customers RequiredOptional, Array of JSON:API RelationshipThe list of Customers the deposit account belongs to.
transaction RequiredJSON:API RelationshipThe Book Transaction generated by this payment.

Example Response:

{
"data": {
"type": "bookPayment",
"id": "12345",
"attributes": {
"createdAt": "2023-10-20T10:15:22.123Z",
"amount": 50000,
"direction": "Credit",
"description": "Payment transfer",
"status": "Sent",
"tags": {},
"userIds": ["user_12345"]
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "10004"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10005"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10000"
}
},
"customers": {
"data": [
{
"type": "customer",
"id": "10000"
}
]
},
"transaction": {
"data": {
"type": "transaction",
"id": "12345"
}
}
}
}
}