> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.epaygames.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.epaygames.io/_mcp/server.

# Calculate Total w/ Fee

GET https://api-stg.epaygames.io/v1/biller/channels/calculate

### Calculate Total with Fee

The **Calculate Total with Fee** endpoint lets you pre-calculate the payment channel's fee before generating a transaction. This is useful if you want to display a UI confirmation showing the total amount including fees on your platform.

This endpoint is optional and depends on how you design your payment flow. It is recommended if your credentials apply an additional fee on top of the original amount.

Reference: https://docs.epaygames.io/payments-api/calculate-total-w-fee

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payments
  version: 1.0.0
paths:
  /v1/biller/channels/calculate:
    get:
      operationId: ' Fee'
      summary: Calculate Total w/ Fee
      description: >-
        ### Calculate Total with Fee


        The **Calculate Total with Fee** endpoint lets you pre-calculate the
        payment channel's fee before generating a transaction. This is useful if
        you want to display a UI confirmation showing the total amount including
        fees on your platform.


        This endpoint is optional and depends on how you design your payment
        flow. It is recommended if your credentials apply an additional fee on
        top of the original amount.
      tags:
        - ''
      parameters:
        - name: channel_code
          in: query
          description: >-
            Values are available via the Get Channels endpoint. Refer to the
            code parameter in the response.
          required: true
          schema:
            type: string
        - name: amount
          in: query
          description: Must be between 0.01 and 50,000.
          required: true
          schema:
            type: number
            format: double
        - name: Authorization
          in: header
          description: >-
            Bearer token obtained from the Create Token endpoint. Tokens are
            valid for ~60 minutes — cache and reuse a token for its full
            lifetime instead of re-authenticating per request.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Calculate Total w/ Fee_Response_200'
        '401':
          description: Unauthorized — missing, invalid, or expired bearer token.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetV1BillerChannelsCalculateRequestUnauthorizedError
        '422':
          description: >-
            Unprocessable Entity — validation failed on the request payload.
            `errors` is keyed by field name, each holding an array of messages.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetV1BillerChannelsCalculateRequestUnprocessableEntityError
servers:
  - url: https://api.epaygames.io
    description: Production
  - url: https://api-stg.epaygames.io
    description: Staging/Sandbox
components:
  schemas:
    V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataCurrency:
      type: object
      properties:
        name:
          type: string
        code:
          description: Any type
        symbol:
          description: Any type
      required:
        - name
      title: >-
        V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataCurrency
    V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataChannelCategory:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        slug:
          type: string
      required:
        - name
        - description
        - slug
      title: >-
        V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataChannelCategory
    V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataChannel:
      type: object
      properties:
        name:
          type: string
        desciption:
          description: Any type
        slug:
          type: string
        code:
          type: string
        logo:
          type: string
          format: uri
        category:
          $ref: >-
            #/components/schemas/V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataChannelCategory
      required:
        - name
        - slug
        - code
        - logo
        - category
      title: >-
        V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataChannel
    V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        subtotal_amount:
          type: integer
        service_fee:
          type: integer
        total_amount:
          type: integer
        is_web_payment:
          type: boolean
        items:
          type: array
          items:
            description: Any type
        currency:
          $ref: >-
            #/components/schemas/V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataCurrency
        channel:
          $ref: >-
            #/components/schemas/V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaDataChannel
      required:
        - subtotal_amount
        - service_fee
        - total_amount
        - is_web_payment
        - items
        - currency
        - channel
      title: V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaData
    Calculate Total w/ Fee_Response_200:
      type: object
      properties:
        message:
          type: string
        data:
          $ref: >-
            #/components/schemas/V1BillerChannelsCalculateGetResponsesContentApplicationJsonSchemaData
      required:
        - message
        - data
      title: Calculate Total w/ Fee_Response_200
    GetV1BillerChannelsCalculateRequestUnauthorizedError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetV1BillerChannelsCalculateRequestUnauthorizedError
    GetV1BillerChannelsCalculateRequestUnprocessableEntityError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - errors
      title: GetV1BillerChannelsCalculateRequestUnprocessableEntityError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token obtained from the Create Token endpoint. Tokens are valid
        for ~60 minutes — cache and reuse a token for its full lifetime instead
        of re-authenticating per request.

```

## Examples



**Response**

```json
{
  "message": "",
  "data": {
    "subtotal_amount": 1000,
    "service_fee": 0,
    "total_amount": 1000,
    "is_web_payment": true,
    "items": [],
    "currency": {
      "name": "Philippine Peso"
    },
    "channel": {
      "name": "GCash",
      "slug": "gcash-qrph",
      "code": "GCASH_QRPH",
      "logo": "https://cdn.eplayment.co/payment-channels/gcash.png",
      "category": {
        "name": "E-Wallet",
        "description": "E-Wallet payment channels.",
        "slug": "e-wallet"
      }
    }
  }
}
```

**SDK Code**

```python Calculate Total w/ Fee_example
import requests

url = "https://api-stg.epaygames.io/v1/biller/channels/calculate"

querystring = {"amount":"1000","channel_code":"GCASH_QRPH"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Calculate Total w/ Fee_example
const url = 'https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Calculate Total w/ Fee_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Calculate Total w/ Fee_example
require 'uri'
require 'net/http'

url = URI("https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Calculate Total w/ Fee_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Calculate Total w/ Fee_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Calculate Total w/ Fee_example
using RestSharp;

var client = new RestClient("https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Calculate Total w/ Fee_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-stg.epaygames.io/v1/biller/channels/calculate?amount=1000&channel_code=GCASH_QRPH")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```