📚 Veritrans Payment API Guide
A complete step-by-step guide for the recurring payment workflow.
1
Create Member Account
Endpoint: POST /Payment/paywithtype
Purpose: To create a new member account in the Veritrans system. This account will be used to store card information and manage recurring payments.
CURL Request
curl --request POST \
--url https://localhost:7259/Payment/paywithtype \
--header 'authorization: Basic YOUR_AUTH_TOKEN' \
--header 'content-type: application/json' \
--data '{
"Type": 12,
"AccountId": "USER_003",
"CreateDate": "20251204",
"IsDummy": true
}'
Success Response
{
"data": {
"serviceType": "account",
"mstatus": "success",
"vResultCode": "X001000000000000",
"payNowIdResponse": {
"processId": "5813220370",
"status": "success",
"account": {
"accountId": "USER_003"
}
}
}
}
2
Generate Card Token
Endpoint: POST /Token/Generate
Purpose: To securely convert raw card details into a single-use token. This is a crucial step for PCI-DSS compliance as it avoids handling sensitive card data on your server.
CURL Request
curl --request POST \
--url https://localhost:7259/Token/Generate \
--header 'content-type: application/json' \
--data '{
"cardNumber": "5555555555554444",
"cardExpire": "12/25",
"securityCode": "123",
"cardholderName": "TARO YAMADA",
"tokenApiKey": "cd76ca65-7f54-4dec-8ba3-11c12e36a548",
"isDummy": true
}'
Success Response
{
"success": true,
"token": "ce3e388e-13e4-404c-9018-e542e34a4829",
"message": "Token generated successfully"
}
3
Add Card to Account
Endpoint: POST /Payment/paywithtype
Purpose: To link the secure token from Step 2 to the member account created in Step 1. This creates a saved payment method for the user.
CURL Request
curl --request POST \
--url https://localhost:7259/Payment/paywithtype \
--header 'authorization: Basic YOUR_AUTH_TOKEN' \
--header 'content-type: application/json' \
--data '{
"Type": 13,
"AccountId": "USER_003",
"Token": "5a3e85e1-77b3-4875-87ed-3544c020794b",
"IsDummy": true
}'
Success Response
{
"data": {
"serviceType": "cardinfo",
"mstatus": "success",
"payNowIdResponse": {
"status": "success",
"account": {
"accountId": "USER_003",
"cardInfo": [
{
"cardId": "A8M9S9UBRAAUTP1PCVY1V2AEZ",
"cardNumber": "555555********44",
"cardExpire": "12/25",
"defaultCard": "1"
}
]
}
}
}
}
4
Authorize & Setup Recurring
Endpoint: POST /Payment/paywithtype
Purpose: To perform an initial payment authorization and simultaneously set up the recurring billing schedule using the saved card token.
CURL Request
curl --request POST \
--url https://localhost:7259/Payment/paywithtype \
--header 'authorization: Basic YOUR_AUTH_TOKEN' \
--header 'content-type: application/json' \
--data '{
"Type": 15,
"OrderId": "daotest123457",
"Amount": "100",
"Token": "ce3e388e-13e4-404c-9018-e542e34a4829",
"Jpo": "10",
"IsWithCapture": "true",
"AccountId": "USER_003",
"GroupId": "thanhtoantruoc1",
"StartDate": "20251204",
"EndDate": "20261204",
"OneTimeAmount": "100",
"RecurringAmount": "100",
"IsDummy": true
}'
Success Response
{
"data": {
"serviceType": "card",
"mstatus": "success",
"vResultCode": "A001X00100000000",
"orderId": "daotest123457",
"payNowIdResponse": {
"processId": "5813333925",
"status": "success",
"account": {
"accountId": "USER_003"
}
}
}
}
5
Search Transaction
Endpoint: POST /Payment/paywithtype
Purpose: To retrieve the details of a past transaction using its `OrderId` and a date range.
CURL Request
curl --request POST \
--url https://localhost:7259/Payment/paywithtype \
--header 'authorization: Basic YOUR_AUTH_TOKEN' \
--header 'content-type: application/json' \
--data '{
"Type": 8,
"StartDate": "20251203",
"EndDate": "20251205",
"OrderID": "daotest123457"
}'
Success Response
{
"data": {
"mstatus": "success",
"searchCount": "1",
"orderInfos": {
"orderInfo": [
{
"accountId": "USER_003",
"orderId": "daotest123457",
"orderStatus": "end",
"lastSuccessTxnType": "Authorize",
"transactionInfos": {
"transactionInfo": [
{
"txnId": "134273066",
"command": "Authorize",
"mstatus": "success",
"vResultCode": "A001X00100000000",
"txnDatetime": "2025-12-04 16:31:09.0",
"amount": "100"
}
]
}
}
]
}
}
}