Custom Fee
The custom fee endpoint allows organizations to charge fees to a customer’s account. This is useful for collecting platform fees or service charges, e.t.c.
Create Custom Fee
You can create a custom fee by calling the /api/v1/fee/custom-fee and passing details such as the amount, description and the account to be charged.
The amount charged with the custom fee endpoint gets settled in the Organization's REVENUE account.
| Method | Endpoint |
|---|---|
POST | {{baseUrl}}/api/v1/fee/custom-fee |
Below are sample request and response payloads.
curl --request POST \
--url https://api.sandbox.getanchor.co/api/v1/fee/custom-fee \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-anchor-key: <API Key>' \
--data '
{
"data": {
"type": "CustomerFee"
"attributes": {
"currency": "NGN",
"amount": 1000,
"description": "Platform fee"
},
"relationships": {
"account": {
"data": {
"type": "DepositAccount",
"id": "17145771745590-anc_acc"
}
}
}
}
}'{
"data": {
"id": "17466058524700-anc_csf",
"type": "CustomerFee",
"attributes": {
"amount": 1000,
"feeType": "CUSTOM",
"status": "PENDING"
},
"relationships": {
"sourceAccount": {
"data": {
"id": "17145771745590-anc_acc",
"type": "DepositAccount"
}
},
"destinationAccount": {
"data": {
"id": "16922123761583-anc_acc",
"type": "DepositAccount"
}
}
}
}
}
| Field | Description |
|---|---|
| type | Type of the resource, i.e CustomerFee |
| amount | Amount to be charged in the least denomination of the currency. Eg 1000 means N10 for Nigerian Naira |
| currency | Currency of the fee (e.g., "NGN"). |
| description | Description of the fee being charged |
| account.id | ID of the account to be charged. |
| account.type | Type of the account be charged. Eg DepositAccount |
List All Fees
You can call the endpoint below to list all the fees charged by your organization.
| Method | Endpoint |
|---|---|
GET | {{baseUrl}}/api/v1/fee//charged-by-organization/{customfeeId} |
Fetch Specific Fee
To fetch a fee custom fee previously charged, call the below endpoint passing the custom fee ID:
| Method | Endpoint |
|---|---|
GET | {{baseUrl}}/api/v1/fee/charged-by-organization/{customfeeId} |
Updated 1 day ago