Maison / Developers

Transa · Developer docs

Accept Transa on any website or app

This is the same checkout Petiht uses. Create a merchant, then either paste a Pay button or call the Express API. Your customer pays on Transa and returns to your success or cancel page.

Choose how you want to integrate

Pick one path. You can add the other later. Both need an approved merchant on TransaCash.

No code

Standard

You set the amount in the dashboard, generate an HTML form, and paste it on your site. Best for a simple Pay button, invoice page, or QR code.

Standard guide
Recommended for apps

Express API

Your server sets the amount. You verify Client ID and Secret, create a checkout, then redirect the customer. This is how petiht.com talks to Transa.

Express guide

Before you start

  1. Create a TransaCash account Register at https://pay.petiht.com, then sign in.
  2. Add a merchant Open Merchants in the dashboard. Choose Standard for an HTML button, or Express for API keys.
  3. Wait for approval An admin must approve the merchant. Until then, the gear icon and keys stay hidden.
  4. Copy your credentials Standard: Merchant ID. Express: Client ID and Client Secret. Keep secrets on the server — never in browser JavaScript.

How checkout works

The customer never stays on your server while they pay. Transa hosts the payment page.

1

Your site

Customer clicks Pay. You already know the amount and order.

2

Transa checkout

They sign in to Transa and pay with wallet or an available method.

3

Money moves

The payment is recorded on the merchant wallet in the chosen currency.

4

Back to you

We send them to your success URL, or cancel URL if they stop.

Standard — HTML Pay button

Use this when the price is fixed and you do not want to run a backend. The form posts to Transa and opens checkout.

  1. Open Merchants In the left sidebar, open Merchants and find your Standard merchant.
  2. Open the gear Click the gear next to Standard. If it is missing, the merchant is still waiting for approval.
  3. Fill the form Item name, amount, currency, and an optional order or note.
  4. Generate and copy Click Generate Form, then Copy. Paste the HTML on your page.

What the form looks like

<form method="POST" action="https://pay.petiht.com/payment/form">
  <input type="hidden" name="merchant" value="YOUR_MERCHANT_UUID">
  <input type="hidden" name="merchant_id" value="YOUR_MERCHANT_ID">
  <input type="hidden" name="item_name" value="Order #1042">
  <input type="hidden" name="amount" value="25.00">
  <input type="hidden" name="order" value="1042">
  <input type="hidden" name="custom" value="Optional note">
  <button type="submit">Pay with Transa</button>
</form>
Copy the generated form from the dashboard when you can. It already includes your real merchant IDs. You can also print the QR code from the same screen for in-person payments.

Express — REST API

Use this from PHP, Node, Python, or any server. Two POST calls, then a redirect. Petiht.com uses this exact flow for wallet top-ups.

Base URL: https://pay.petiht.com

Step Endpoint What you send What you get
1 POST /merchant/api/verify client_id, client_secret data.access_token
2 POST /merchant/api/transaction-info Bearer token + amount, currency, URLs data.approvedUrl
3 Redirect the customer — Hosted Transa checkout

1. Verify your merchant

Send JSON. A token is valid for about one hour. Create a new one if it expires.

POST https://pay.petiht.com/merchant/api/verify
Content-Type: application/json

{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}

// Success
{
  "status": "success",
  "data": { "access_token": "..." }
}

2. Create the checkout

The currency code must exist on that merchant wallet (for example HTG or USD). successUrl and cancelUrl must be https pages you control.

POST https://pay.petiht.com/merchant/api/transaction-info
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
  "payer": "Transa",
  "amount": 25.00,
  "currency": "USD",
  "successUrl": "https://yoursite.com/pay/success",
  "cancelUrl": "https://yoursite.com/pay/cancel"
}

// Success
{
  "status": "success",
  "data": { "approvedUrl": "https://pay.petiht.com/merchant/payment?grant_id=...&token=..." }
}

3. PHP example (same pattern as petiht.com)

<?php
$base = 'https://pay.petiht.com';
$clientId = getenv('TRANSA_CLIENT_ID');
$clientSecret = getenv('TRANSA_CLIENT_SECRET');

$verify = curl_init($base . '/merchant/api/verify');
curl_setopt_array($verify, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'client_id' => $clientId,
    'client_secret' => $clientSecret,
  ]),
]);
$auth = json_decode(curl_exec($verify), true);
curl_close($verify);

$token = $auth['data']['access_token'] ?? '';
if (($auth['status'] ?? '') !== 'success' || $token === '') {
  throw new Exception($auth['message'] ?? 'Transa rejected the merchant credentials');
}

$info = curl_init($base . '/merchant/api/transaction-info');
curl_setopt_array($info, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Content-Type: application/json',
    'Authorization: Bearer ' . $token,
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'payer' => 'Transa',
    'amount' => 25.00,
    'currency' => 'USD',
    'successUrl' => 'https://yoursite.com/pay/success',
    'cancelUrl' => 'https://yoursite.com/pay/cancel',
  ]),
]);
$checkout = json_decode(curl_exec($info), true);
curl_close($info);

$url = $checkout['data']['approvedUrl'] ?? '';
if (($checkout['status'] ?? '') !== 'success' || $url === '') {
  throw new Exception($checkout['message'] ?? 'Transa could not start checkout');
}

header('Location: ' . $url);
exit;
Store Client ID and Secret as environment variables. Never ship them in a mobile app binary or a public frontend. Call these endpoints from your server.

Success and cancel URLs

After checkout, Transa sends the customer back to the URLs you passed. Treat success as “customer finished checkout”. Confirm the payment on your side before you unlock the order.

  • successUrl — customer completed payment. On Petiht this is a webhook-style return that credits the wallet once.
  • cancelUrl — customer cancelled. Show a message. Do not mark the order paid.

The return query can include a status payload. If status is not success, do not fulfill the order.

Test checklist

  1. Merchant is Approved Keys and the gear icon only appear after approval.
  2. Currency matches a wallet Express amount currency must exist on that merchant.
  3. Try a small live payment Pay from another Transa user, then confirm the merchant wallet and your success URL.
  4. Cancel once Confirm cancelUrl loads and you do not fulfill the order.

Ready

Create your Transa merchant

Sign in, add Standard or Express, and start accepting payments the same day you are approved.

Get started