Charges
The charges object represents charges against transactions raised by a merchant acquirer. It includes details such as the booking reference, transaction details, and any associated metadata like card type and country.
Charge Model
Properties
- Name
booking
- Type
- object
- Description
Details about the booking, including the Felloh booking ID and your reference.
- Name
charges
- Type
- object
- Description
Details about the charges, including amount, currency, and rate.
- Name
metadata
- Type
- object
- Description
Metadata related to the transaction, such as card type and country type.
- Name
transaction
- Type
- object
- Description
The transaction model that the charge relates to.
<div class="syntax-highlighter"><pre style="color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:.5em 0;overflow:auto;background:#1b0f27"><code class="language-json" style="white-space:pre;color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;direction:ltr;text-align:left;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none"><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"booking"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"id"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"ce9c7525-ec4e-44cd-a400-f2b6c8a5e1a9"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"booking_reference"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"ABC-1234"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"charges"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"amount"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"2013"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"currency"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"GBX"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"rate"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"0.85"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"metadata"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"level"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"PERSONAL"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"card_type"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"DEBIT"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"country_type"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"DOMESTIC"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"payment_brand"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"MASTER"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"transaction"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"id"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"a9832728-0107-11ed-b939-0242ac120002"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"amount"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">130808</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"completed_at"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"2024-03-31T04:01:14.000Z"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"created_at"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"2024-03-31T04:00:10.149Z"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"currency"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"GBX"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span>
</span><span></span><span class="token" style="color:#d4d4d4">}</span><span>
</span></code></pre></div>
Fetch All
This endpoint retrieves all charges associated with an organisation within a specified date range.
Parameters
- Name
organisation
required
- Type
- string
- Description
The organisation ID that you want to fetch charges for. You can find the organisation you have access to by using the List all organisations method.
- Name
date_from
- Type
- date
- Description
The starting date for fetching charges, in ISO 8601 format.
- Name
date_to
- Type
- date
- Description
The ending date for fetching charges, in ISO 8601 format.
- Name
skip
- Type
- integer
- Description
Pagination offset - see the pagination section for details.
- Name
take
- Type
- integer
- Description
Number of records to return - see the pagination section for details.
Returns
Returns an array of Charge Models
Request
<div class="syntax-highlighter"><pre style="color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:.5em 0;overflow:auto;background:#1b0f27"><code class="language-javascript" style="white-space:pre;color:#9cdcfe;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;direction:ltr;text-align:left;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none"><span class="token" style="color:#c586c0">import</span><span> </span><span class="token">axios</span><span> </span><span class="token" style="color:#c586c0">from</span><span> </span><span class="token" style="color:#ce9178">'axios'</span><span class="token" style="color:#d4d4d4">;</span><span> </span> <span></span><span class="token" style="color:#569CD6">const</span><span> response </span><span class="token" style="color:#d4d4d4">=</span><span> </span><span class="token" style="color:#c586c0">await</span><span> axios</span><span class="token" style="color:#d4d4d4">.</span><span class="token method property-access" style="color:#c0a9e5">post</span><span class="token" style="color:#d4d4d4">(</span><span> </span><span> </span><span class="token" style="color:#ce9178">'https://api.felloh.com/agent/charges'</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span> </span><span class="token" style="color:#d4d4d4">{</span><span> </span><span> </span><span class="token literal-property" style="color:#9cdcfe">organisation</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">'X9876'</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span> </span><span class="token literal-property" style="color:#9cdcfe">date_from</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">'2020-02-01'</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span> </span><span class="token literal-property" style="color:#9cdcfe">date_to</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">'2021-05-10'</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span> </span><span class="token literal-property" style="color:#9cdcfe">skip</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">10</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span> </span><span class="token literal-property" style="color:#9cdcfe">take</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">20</span><span> </span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span> </span><span class="token" style="color:#d4d4d4">{</span><span> </span><span> </span><span class="token literal-property" style="color:#9cdcfe">headers</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span> </span><span class="token string-property" style="color:#9cdcfe">'Content-Type'</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">'application/json'</span><span class="token" style="color:#d4d4d4">,</span><span> </span><span class="token string-property" style="color:#9cdcfe">'Authorization'</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token template-string template-punctuation" style="color:#ce9178">`</span><span class="token template-string" style="color:#ce9178">Bearer <YOUR TOKEN HERE></span><span class="token template-string template-punctuation" style="color:#ce9178">`</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span> </span><span> </span><span class="token" style="color:#d4d4d4">}</span><span> </span><span></span><span class="token" style="color:#d4d4d4">)</span><span class="token" style="color:#d4d4d4">;</span><span> </span></code></pre></div>
<div class="syntax-highlighter"><pre style="color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:.5em 0;overflow:auto;background:#1b0f27"><code class="language-json" style="white-space:pre;color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;direction:ltr;text-align:left;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none"><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"data"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">[</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"booking"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"id"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"ce9c7525-ec4e-44cd-a400-f2b6c8a5e1a9"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"booking_reference"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"ABC-1234"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"charges"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"amount"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"2013"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"currency"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"GBX"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"rate"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"0.85"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"metadata"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"level"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"PERSONAL"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"card_type"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"DEBIT"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"country_type"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"DOMESTIC"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"payment_brand"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"MASTER"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"transaction"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"id"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"a9832728-0107-11ed-b939-0242ac120002"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"amount"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">130808</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"completed_at"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"2024-03-31T04:01:14.000Z"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"created_at"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"2024-03-31T04:00:10.149Z"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"currency"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"GBX"</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">]</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"errors"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"meta"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"code"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">200</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"reason"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"OK"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"message"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"The request was successful"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"request_id"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">"cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span> </span><span class="token" style="color:#9cdcfe">"count"</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">1</span><span>
</span><span> </span><span class="token" style="color:#d4d4d4">}</span><span>
</span><span></span><span class="token" style="color:#d4d4d4">}</span><span>
</span></code></pre></div>