APIs
Create Fee
Creates a fee for an Account.
| Verb | POST |
| URL | https://api.s.unit.sh/fees |
| Required Scope | accounts-write |
| Data Type | fee |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| amount | integer | The amount (in cents) to charge the account. |
| description | string | Description of the fee (maximum of 50 characters). |
| tags Optional | object | Optional. See Tags. |
| idempotencyKey Optional | string | Optional, but strongly recommended. See Idempotency. |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The account to charge the fee. |
Example Request:
curl -X POST 'https://api.s.unit.sh/fees'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "fee",
"attributes": {
"amount": 1000,
"description": "Monthly Subscription"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10097"
}
}
}
}
}'
Response
Response is a JSON:API document.
Example Response:
{
"data": {
"type": "fee",
"id": "1234",
"attributes": {
"amount": 1000,
"description": "Monthly Subscription"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10097"
}
}
}
}
}
Reverse Fee
Reverse a fee for an Account.
| Verb | POST |
| URL | https://api.s.unit.sh/fees/reverse |
| Required Scope | accounts-write |
| Data Type | feeReversal |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| description | string | Description of the fee (maximum of 50 characters). |
| tags Optional | object | Optional. See Tags. |
| idempotencyKey Optional | string | Optional, but strongly recommended. See Idempotency. |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The account to reverse the fee. |
| transaction | JSON:API Relationship | The transaction to reverse. |
Example Request:
curl -X POST 'https://api.s.unit.sh/fees/reverse'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "feeReversal",
"attributes": {
"description": "Monthly Subscription - reverse"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10097"
}
},
"transaction": {
"data": {
"type": "transaction",
"id": "1"
}
}
}
}
}'
Response
Response is a JSON:API document.
201 Created
| Name | Type | Description |
|---|---|---|
| data | FeeReversal | The requested resource after the operation was completed. |
Example Response:
{
"data": {
"type": "fee reversal",
"id": "2",
"attributes": {
"amount": 100,
"description": "Monthly Subscription - reverse"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "10097"
}
},
"transaction": {
"data": {
"type": "transaction",
"id": "1"
}
}
}
}
}