1. Payment Api backend
BasGate Document v2
  • BAS SDK Payment
    • Payment Flow
    • Payment Api backend
      • Introduction
      • Authentication
        POST
      • Initiate Transaction
        POST
      • Check Transaction Status
        POST
    • Frontend Bas Payment SDK
      • Flutter SDK
      • Android SDK
      • IOS SDK
    • Signature
      • Signature (Checksum) Documentation
    • Tools
      • Laravel Payment Gateway SDK
  1. Payment Api backend

Initiate Transaction

POST
https://mock.apidog.com/m1/1286474-0-1260791/api/v1/merchant/sdk-payment/initiate-transaction
The primary endpoint to initialize a payment session. It validates merchant authenticity and generates a secure 'trxToken' required for the client-side SDK flow.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Examples

Responses

🟢200
application/json
Pass the returned trxToken to the BasGate client SDK to open the secure payment UI. Never expose client_secret or the raw signature key to the client.
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://mock.apidog.com/m1/1286474-0-1260791/api/v1/merchant/sdk-payment/initiate-transaction' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "head": {
        "signature": "",
        "forceVerifySignature":false,
        "requestTimestamp": ""
    },
    "body": {
        "amount": {
            "value": 600,
            "currency": "YER"
        },
        "customerInfo": {
            "id": "690553"
        },
        "ordertype": "PayBill",
        "orderId": "",
        "requestTimestamp": "",
        "appId": "ec05d8a6-db74-4a3f-ba6f-46e6a5609fa4",
        "description": "Payment for order ",
        "orderDetails": {
            "itemId": "ITEM-001",
            "quantity": 2
        },
        "extraFields": {
            "key_0": 1528.5740571338313,
            "key_1": "string",
            "key_2": 8898,
            "key_3": 6371.164357684307
        },
        "callBackUrl": "https://your_site.com/callBack/",
        "redirectUrl": "https://your_site.com/success/",
        "cancelUrl": "https://your_site.com/cancel/"
    }
}'
Response Response Example
{
    "status": 1,
    "code": "1111",
    "messages": [
        "Success"
    ],
    "head": {
        "signature": "TrCEAStORlbTEZAlpAXUWCTXsmEYaLOJRl6zlglDTN9jo5jHlNh1eKQErO36Ii0ytK0wEZsz1HyvfZgVSPDDJGXQzguwyc1CS6/8tWSf2bE=",
        "requestTimestamp": "1778517061102"
    },
    "body": {
        "appId": "ec05d8a6-db74-4a3f-ba6f-46e6a5609fa4",
        "trxStatus": "received",
        "trxId": "df5441a6-0166-4605-8472-da5c30f71ce2",
        "trxToken": "PtQesHqv3kgkZWMwNWQ4YTYtZGI3NC00YTNmLWJhNmYtNDZlNmE1NjA5ZmE0UFkkNTNmMjkwNGItMWY4YS00YTdjLWI2ODEtNjc5MGY4M2ZiNDA1",
        "authenticated": true,
        "timestamp": 0,
        "trxStatusId": 1001,
        "isTokenExpired": false,
        "order": {
            "appId": "ec05d8a6-db74-4a3f-ba6f-46e6a5609fa4",
            "orderId": "53f2904b-1f8a-4a7c-b681-6790f83fb405",
            "orderType": "PayBill",
            "amount": {
                "value": 600,
                "currency": "YER"
            },
            "localCurrencyAmount": {
                "value": 600,
                "currency": "YER"
            },
            "description": "دفع فاتورة, رقم المرجع NBBO100033163 لدى ",
            "callBackUrl": "https://www.google.com/223324233",
            "creationDate": "2026-05-11T19:31:00.888084+03:00",
            "orderDetails": {
                "itemId": "ITEM-001",
                "quantity": 2
            }
        }
    }
}
Modified at 2026-07-27 14:20:54
Previous
Authentication
Next
Check Transaction Status
Built with