> 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.

# Generate Transaction

POST https://v1/biller/transactions/generate
Content-Type: application/json

### Generate Transaction

The **Generate Transaction** endpoint creates a web payment link for a specific payment channel. You can redirect your customer to this link so they can complete the payment.

After the payment is processed, the user will be **automatically redirected** to either the `success_redirect_url` or the `failure_redirect_url`, depending on whether the payment was successful.

To receive real-time payment updates, you may use the `callback_webhook_url`, which will notify your system once the payment status is confirmed.

**Response Fields:**

- `status` — starts as `pending`; final values are `completed` or `cancelled`.
- `provider_reference_no` — the upstream provider reference number; may be `null` or a string.
- `other_reference_no` — an additional reference number; may be `null` or a string.

Reference: https://docs.epaygames.io/epaygames-payments-disbursement-api/payments-api/generate-transaction

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /v1/biller/transactions/generate:
    post:
      operationId: Generate Transaction
      summary: Generate Transaction
      description: >-
        ### Generate Transaction


        The **Generate Transaction** endpoint creates a web payment link for a
        specific payment channel. You can redirect your customer to this link so
        they can complete the payment.


        After the payment is processed, the user will be **automatically
        redirected** to either the `success_redirect_url` or the
        `failure_redirect_url`, depending on whether the payment was successful.


        To receive real-time payment updates, you may use the
        `callback_webhook_url`, which will notify your system once the payment
        status is confirmed.


        **Response Fields:**


        - `status` — starts as `pending`; final values are `completed` or
        `cancelled`.

        - `provider_reference_no` — the upstream provider reference number; may
        be `null` or a string.

        - `other_reference_no` — an additional reference number; may be `null`
        or a string.
      tags:
        - paymentsApi
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties: {}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                channel_code:
                  type: string
                amount:
                  type: integer
                reference_no:
                  type: string
                success_redirect_url:
                  type: string
                  format: uri
                failure_redirect_url:
                  type: string
                  format: uri
                callback_webhook_url:
                  type: string
                  format: uri
              required:
                - channel_code
                - amount
                - reference_no
                - success_redirect_url
                - failure_redirect_url
                - callback_webhook_url
servers:
  - url: https:/
    description: https://{payments_api_host}

```

## Examples



**Request**

```json
{
  "channel_code": "GCASH_QRPH",
  "amount": 1,
  "reference_no": "{{randomString}}",
  "success_redirect_url": "https://epaygames.io/success",
  "failure_redirect_url": "https://epaygames.io/failure",
  "callback_webhook_url": "https://webhook.site/c5170b54-132f-408d-b998-519668c829f9"
}
```

**Response**

```json
"{\n    \"message\": \"Transaction has been successfully generated.\",\n    \"data\": {\n        \"subtotal_amount\": 0.01,\n        \"service_fee\": 0,\n        \"total_amount\": 0.01,\n        \"reference_no\": \"TESTQRTVFSXPG2OG\",\n        \"provider_reference_no\": null,\n        \"other_reference_no\": null,\n        \"status\": \"pending\",\n        \"barcode_url\": null,\n        \"qrcode_url\": null,\n        \"link_url\": null,\n        \"is_web_payment\": true,\n        \"web_payment_url\": \"https://l-stg.epayg.link/ard6laadxqjqz74\",\n        \"qrcode\": null,\n        \"is_expired\": false,\n        \"expires_at\": \"2025-09-02T10:00:06+08:00\",\n        \"date\": \"2025-09-01T10:00:06+08:00\",\n        \"items\": [],\n        \"currency\": {\n            \"name\": \"Philippine Peso\",\n            \"code\": \"PHP\",\n            \"symbol\": \"₱\"\n        },\n        \"channel\": {\n            \"name\": \"PayMaya\",\n            \"desciption\": null,\n            \"instruction\": \"To complete the transaction, kindly follow these steps:\\n 1. Open [PayMaya Web Payment Link](https://l-stg.epayg.link/ard6laadxqjqz74).\\n 2. Complete the **PayMaya** web payment process.\\n 3. Payments are processed once paid.\\nNote: You do not need to follow those steps if you already complete the **PayMaya** web payment process.\",\n            \"slug\": \"paymaya\",\n            \"code\": \"PAYMAYA_QR\",\n            \"logo\": \"https://cdn.eplayment.co/payment-channels/paymaya.jpg\",\n            \"category\": {\n                \"name\": \"E-Wallet\",\n                \"description\": \"E-Wallet payment channels.\",\n                \"slug\": \"e-wallet\"\n            }\n        }\n    }\n}"
```

**SDK Code**

```python Payments API_Generate Transaction_example
import requests

url = "https://https/v1/biller/transactions/generate"

payload = {
    "channel_code": "GCASH_QRPH",
    "amount": 1,
    "reference_no": "{{randomString}}",
    "success_redirect_url": "https://epaygames.io/success",
    "failure_redirect_url": "https://epaygames.io/failure",
    "callback_webhook_url": "https://webhook.site/c5170b54-132f-408d-b998-519668c829f9"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Payments API_Generate Transaction_example
const url = 'https://https/v1/biller/transactions/generate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"channel_code":"GCASH_QRPH","amount":1,"reference_no":"{{randomString}}","success_redirect_url":"https://epaygames.io/success","failure_redirect_url":"https://epaygames.io/failure","callback_webhook_url":"https://webhook.site/c5170b54-132f-408d-b998-519668c829f9"}'
};

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

```go Payments API_Generate Transaction_example
package main

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

func main() {

	url := "https://https/v1/biller/transactions/generate"

	payload := strings.NewReader("{\n  \"channel_code\": \"GCASH_QRPH\",\n  \"amount\": 1,\n  \"reference_no\": \"{{randomString}}\",\n  \"success_redirect_url\": \"https://epaygames.io/success\",\n  \"failure_redirect_url\": \"https://epaygames.io/failure\",\n  \"callback_webhook_url\": \"https://webhook.site/c5170b54-132f-408d-b998-519668c829f9\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Payments API_Generate Transaction_example
require 'uri'
require 'net/http'

url = URI("https://https/v1/biller/transactions/generate")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"channel_code\": \"GCASH_QRPH\",\n  \"amount\": 1,\n  \"reference_no\": \"{{randomString}}\",\n  \"success_redirect_url\": \"https://epaygames.io/success\",\n  \"failure_redirect_url\": \"https://epaygames.io/failure\",\n  \"callback_webhook_url\": \"https://webhook.site/c5170b54-132f-408d-b998-519668c829f9\"\n}"

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

```java Payments API_Generate Transaction_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/v1/biller/transactions/generate")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel_code\": \"GCASH_QRPH\",\n  \"amount\": 1,\n  \"reference_no\": \"{{randomString}}\",\n  \"success_redirect_url\": \"https://epaygames.io/success\",\n  \"failure_redirect_url\": \"https://epaygames.io/failure\",\n  \"callback_webhook_url\": \"https://webhook.site/c5170b54-132f-408d-b998-519668c829f9\"\n}")
  .asString();
```

```php Payments API_Generate Transaction_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/v1/biller/transactions/generate', [
  'body' => '{
  "channel_code": "GCASH_QRPH",
  "amount": 1,
  "reference_no": "{{randomString}}",
  "success_redirect_url": "https://epaygames.io/success",
  "failure_redirect_url": "https://epaygames.io/failure",
  "callback_webhook_url": "https://webhook.site/c5170b54-132f-408d-b998-519668c829f9"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Payments API_Generate Transaction_example
using RestSharp;

var client = new RestClient("https://https/v1/biller/transactions/generate");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"channel_code\": \"GCASH_QRPH\",\n  \"amount\": 1,\n  \"reference_no\": \"{{randomString}}\",\n  \"success_redirect_url\": \"https://epaygames.io/success\",\n  \"failure_redirect_url\": \"https://epaygames.io/failure\",\n  \"callback_webhook_url\": \"https://webhook.site/c5170b54-132f-408d-b998-519668c829f9\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Payments API_Generate Transaction_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "channel_code": "GCASH_QRPH",
  "amount": 1,
  "reference_no": "{{randomString}}",
  "success_redirect_url": "https://epaygames.io/success",
  "failure_redirect_url": "https://epaygames.io/failure",
  "callback_webhook_url": "https://webhook.site/c5170b54-132f-408d-b998-519668c829f9"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/v1/biller/transactions/generate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```