Managing Transactions Using the API
This guide walks you through how to retrieve transaction details and manage void operations using the AndDone Transaction Management API. These APIs allow merchants to access detailed payment information using either a transaction ID or payment token and to handle error conditions related to void operations.
Using the Transaction Management API, merchants can:
- Retrieve payment details by Transaction ID using POST Get Payment Details by Transaction ID
- Retrieve payment details by Payment Token using POST Get Payment Details by Payment Token
- Understand void restrictions using the Void Transaction Error Reference
Prerequisites
Before using the API, ensure the following conditions are met:
Enable Supporting Features
In the AndDone Merchant Portal, enable the following features:
- Transaction Management
- API Key and App Key Authentication
- Allowed Origin configuration (IP or URL)
Retrieving Payment Details
The following methods allow you to fetch transaction information for reporting, reconciliation, or support workflows.
Get Payment Details by Transaction ID
To retrieve the full payment object by providing the Transaction id
, call the POST Get Payment Details by Transaction ID method.
Request Body Example
{
"id": "14999ebe-3068-492d-837a-30ad9a2fa406",
"Type": "OpenPayment"
}
Field | Description |
---|---|
id |
The unique transaction ID |
Type |
Transaction type: AnytimePayment, PaymentIntent, PaymentLink, or OpenPayment |
Get Payment Details by Payment Token
To retrieve details for a payment using a PaymentToken
value, call the POST Get Payment Details by Payment Token method.
Request Body Example
{
"PaymentToken": "Kd2z54d6",
"Type": "PaymentIntent"
}
Field | Description |
---|---|
PaymentToken |
Token linked to the payment intent |
Type |
The type of transaction: PaymentIntent. |
Response Example
Both methods return a complete payment object including:
- Billing contact details
- Channel and processor info
- Card or ACH tender info
- Transaction and verification results
- Convenience fees, discounts, and commissions
{
"chargeBackAmount": null,
"transactionId": "14999ebe-3068-492d-837a-30ad9a2fa406",
"transactionCode": "WEB",
"billingContact": {
"name": {
"title": null,
"firstName": "Azhar",
"middleName": null,
"lastName": "Dave"
},
"companyName": null,
"department": null,
"fax": null,
"phone": "8003213388",
"alternatePhone": null,
"mobile": null,
"email": null,
"url": null,
"address": {
"addressLine1": "30",
"addressLine2": "Memorial Drive",
"city": "Avon ",
"state": "NY",
"country": 1,
"postalCode": "12701",
"timeZone": null
}
},
"transactionDate": "05-02-2024 12:29:06",
"merchantId": "ABv9G58a",
"ipAddress": "172.69.64.153",
"channelType": "CreditCard",
"processMethod": "CardNotPresent",
"processorName": "Adyen",
"transactionOrigin": "WebForm",
"refundOrigin": 0,
"achTenderInfo": null,
"ccTenderInfo": {
"cardHolderName": "Dawe",
"cardType": "VISA",
"maskCardNumber": "****0008",
"cardExpiry": "0330",
"captureAmount": 2859,
"amount": 2800,
"convenienceAmount": 0,
"binNumber": "415150",
"taxAmount": 0,
"taxAfterDiscount": false,
"taxPercent": 0,
"adjustmentPercentValue": 2,
"adjustmentFixedValue": 3,
"adjustmentAmount": 59,
"adjustmentDisplayName": "Technology Fee",
"adjustmentDescriptorMessage": "AndDone applies a technology fee on all electronic payments.",
"paymentAdjustmentType": "ConvenienceFee",
"preAuthCode": null,
"maskAccount": null,
"accountToken": null,
"accountTokenMessage": null,
"createAccountToken": false,
"discountType": "Fixed",
"discountPercent": 0,
"discountAmount": 0,
"commissionType": "Fixed",
"commissionValue": 1
},
"debitCardTenderInfo": null,
"referenceCustomerId": null,
"customerAccountId": null,
"invoiceNo": null,
"referenceNo": "REference_116",
"remarks": null,
"terminalId": "VT000368",
"transactionStatus": "Failed",
"transactionResult": {
"success": false,
"processorAuthCode": "Refused",
"traceNumber": "JS6TLKBMKRQWFL65",
"reasonCode": "2",
"reasonMessage": null,
"additionResultData": "Refused",
"additionResultData2": "{\"additionalData\":{\"PaymentMethod\":\"visa\",\"NetworkTxReference\":\"375523876888973\",\"CardBin\":\"415150\",\"CardSummary\":\"0008\",\"CardHolderName\":\"Dawe\",\"ExpiryDate\":\"3/2030\",\"RealtimeAccountUpdaterStatus\":null,\"Recurring.RecurringDetailReference\":null,\"Recurring.ShopperReference\":null},\"PspReference\":\"JS6TLKBMKRQWFL65\",\"RefusalReason\":\"Refused\",\"ResultCode\":\"Refused\",\"RefusalReasonCode\":\"2\",\"amount\":null,\"MerchantReference\":\"REference_116\"}",
"verificationStatus": true,
"verification1Code": null,
"verification2Code": null,
"errorCode": "PD0001",
"errorMessage": "Refused",
"merchantReference": "REference_116"
},
"invoiceId": null,
"paymentLinkId": null,
"additionalFields": null,
"settlementDate": null,
"issuer": "FIRST PEOPLES COMMUNITY FEDERAL CREDIT UNION",
"paymentType": "OpenPayment",
"paymentCategory": "MerchantPayment",
"transactionEntitySplitResponses": [],
"refundTransactions": null,
"chargebackTargetAccount": null
}
Void Transaction Error Reference
If attempting to void a transaction, the following error codes help identify issues related to timing, transaction state, or eligibility. For further details refer to the Void Transaction Error Reference page.
Error Code |
Description |
Key_InvalidRequest |
The request is empty or invalid. |
Key_TransactionIdCannotBeEmptyOrNULL |
Transaction ID is missing. |
Key_InvalidTransactionId |
Provided ID does not match any transaction. |
Key_VoidsNotAllowed |
Voids are not permitted for this transaction. |
Key_OnlyAuthorizedTransactionCanBeVoided |
Only authorized transactions can be voided. |
Key_OnlySaleTransactionCanBeVoided |
Sale-type transactions are eligible only. |
Key_TokenLinkTransactionCanNotBeVoided |
Token link transactions are not voidable. |
Key_TransactionCanNotBeVoidedNachaExecutionTimeIsLessThan15Mins |
Voiding blocked due to imminent NACHA execution. |
Key_TransactionCanNotBeUpdated |
The current transaction state does not allow updates. |