Processes a credit card refund without the physical card being present. PayFacto looks up the original approved transaction using OriginalTransactionNumber and routes the refund to the same card on file.
API Key
Generate your API key from the Payments Manager: Administrator Client β API Key β Add New Key. Pass it as auth-api-key in every request.
Company & Merchant Numbers
Your CompanyNumber (5-digit) and MerchantNumber (8-digit) are issued by PayFacto during onboarding. Both are required on every Refund Without Card request.
Environment Base URL
Test: https://test.api.payfacto.cloud/v1 | Production: Provided by the PayFacto Integration team upon certification.
Request Format β Base64-Encoded Payload
Requests use HTTP POST with an application/x-www-form-urlencoded body. Assemble all parameters as a cleartext query string, Base64-encode it, then send: auth-api-key={key}&payload={base64}. E-Commerce transactions send 5 blank spaces for MerchantTerminalNumber.
Original Transaction Values Required
Three values from the original approved transaction response must be stored and supplied to this endpoint:
| Original Transaction Response | Pass to This Endpoint as |
|---|---|
| transactionNumber | OriginalTransactionNumber |
| invoiceNumber | OriginalInvoiceNumber |
| amount | OriginalAmount |
All parameters are passed inside the Base64-encoded payload form field. Raw body format: auth-api-key=<key>&payload=<base64>. No card data is required. E-Commerce transactions send 5 blank spaces for MerchantTerminalNumber.
Required fields
| Field | Type | Description |
|---|---|---|
| CompanyNumber | Numeric(5) | Identifies the merchant on PayFacto's network. Provided by PayFacto during onboarding. Example: 12345 |
| MerchantNumber | Numeric(8) | Identifies the merchant to PayFacto's network. Provided by the integration team. Example: 53400000 |
| CustomerNumber | Alphanumeric(8) | Merchant-assigned customer identifier. Associates the refund with a client record. Example: CLIENT12 |
| Amount | Numeric(11) | Amount to refund, including the decimal portion, left (0) padded. May be less than or equal to OriginalAmount for partial refunds. Example: 00000005000 = $50.00 |
| InvoiceNumber | Alphanumeric(12) | Merchant-generated invoice number for this refund transaction. Example: REF000000001 |
| InputType | Alphanumeric(1) | How the transaction is initiated. N = terminal/pinpad (Semi-Integrated), I = Internet/E-Commerce, M = MOTO, U = Unattended. |
| MerchantTerminalNumber | Numeric(5) | Identifies the terminal on PayFacto's network. For E-Commerce transactions, send 5 blank spaces. Example: 12345 |
| LanguageCode | Alphanumeric(1) | Language for PayFacto responses and terminal display. F = French, E = English. |
| CurrencyCode | Alphanumeric(3) | Currency of the refund (indicative only). CAD = Canadian dollars, USD = US dollars (requires a US merchant number). |
| OperatorID | Alphanumeric(8) | Identifies the cashier, agent, or system that initiated the refund. Example: USER0001 |
| OriginalTransactionNumber | Numeric(12) | The transactionNumber from the original approved transaction response. Used by PayFacto to locate the original transaction and route the refund to the correct card. Example: 000111222333 |
| OriginalInvoiceNumber | Alphanumeric(12) | The invoiceNumber from the original approved transaction response. Example: PUR000000001 |
| OriginalAmount | Numeric(11) | The amount from the original approved transaction response, left (0) padded. Example: 00000010000 |
Optional fields
| Field | Type | Description |
|---|---|---|
| taxAmount | Numeric(11) | Total tax amount included in Amount, left (0) padded. Example: 00000000650 = $6.50 |
| TrxOption | Alpha(50) | Adds transaction-level options. Accepted values: isCredentialOnFile, isRecurring, isInstallment (mutually exclusive). |
| UserEchoData | Alphanumeric(256) | Custom data printed on the terminal receipt (Semi-Integrated only). Pipe-delimited line segments. Contact PayFacto integration before use. |
The example below uses the test endpoint and a sandbox API key, and shows an E-Commerce (InputType=I) partial refund. Replace credentials and base URL before going live.
# Refund Without Card -- POST /v1/refundWithoutCard
# Step 1: Build the cleartext payload (InputType=I, E-Commerce, partial refund of $50.00
# on an original transaction of $100.00)
PAYLOAD="CompanyNumber=12345&MerchantNumber=53400000&CustomerNumber=CLIENT12&Amount=00000005000&InvoiceNumber=REF000000001&InputType=I&MerchantTerminalNumber= &LanguageCode=E&CurrencyCode=CAD&OperatorID=USER0001&OriginalTransactionNumber=000111222333&OriginalInvoiceNumber=PUR000000001&OriginalAmount=00000010000"
# Step 2: Base64-encode the payload
ENCODED=$(echo -n "$PAYLOAD" | base64)
# Step 3: Submit the request
curl -X POST "https://test.api.payfacto.cloud/v1/refundWithoutCard" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "auth-api-key=YOUR_TEST_API_KEY&payload=$ENCODED"
Always returned
| Field | Type | Description |
|---|---|---|
| returnCode | Alphanumeric(4) | Identifies the exact status of the transaction result. 00 = approved. All other values indicate a failure. Refer to Section 6 for endpoint-specific codes. |
| authorizationNumber | Alphanumeric(8) | Authorization code for the refund from the issuing bank. Must be displayed on all customer receipts. Example: REFUND01 |
| transactionNumber | Numeric(12) | Unique PayFacto gateway transaction identifier for this refund. Example: 000111222444 |
| amount | Numeric(11) | Echo of the refund amount, left (0) padded. |
| bankTerminalNumber | Alphanumeric(8) | Terminal identifier at the banking acquirer that processed the refund. |
| batchNumber | Numeric(4) | Batch number at the time the refund was processed. Example: 0001 |
| cardNumber | Alphanumeric(40) | Masked card number from the original transaction that received the refund. |
| cardType | Alphanumeric(1) | Card brand from the original transaction. A = Amex, M = Mastercard, V = Visa, I = Diners, O = Discover. |
| companyNumber | Numeric(5) | Echo of the request CompanyNumber. |
| expirationDate | Numeric(4) | Expiration date from the original transaction card, in MMYY format. |
| invoiceNumber | Alphanumeric(12) | Echo of the request InvoiceNumber for this refund. |
| languageCode | Alphanumeric(1) | Echo of the request LanguageCode. |
| merchantNumber | Numeric(8) | Echo of the request MerchantNumber. |
| operatorId | Alphanumeric(8) | Echo of the request OperatorID. |
| receiptDisp | Alphanumeric(32) | PayFacto-generated receipt message. Example: APPROVED-THANK-YOU |
| referenceNumber | Alphanumeric(10) | Reference number obtained following successful approval. |
| sequenceNumber | Alphanumeric(12) | Sequence number generated by the banking acquirer. |
| serverNumber | Alphanumeric(4) | Identifies the PayFacto Network server that processed the transaction. |
| terminalDisp | Alphanumeric(24) | Transaction message displayed on the terminal or payment page. Example: APPROVED |
| terminalNumber | Numeric(5) | Identifies the terminal in the PayFacto Network used to process the transaction. |
| timeStamp | Alphanumeric(17) | Date and time the refund was processed. Format: YYYYMMDD-HHMMSSCC. Example: 20240516-10000100 |
| trxCode | Alphanumeric(2) | Transaction type code. For a Refund Without Card this is always 03. |
| trxDate | Numeric(8) | Refund date at the banking acquirer. Format: MMDDYYYY. May differ from timeStamp. |
| trxMethod | Alphanumeric(3) | Summarizes how the transaction was processed. First character: D = swiped/inserted, T = manual entry. Third character: 1 = authorized. Example: T@1 |
| trxTime | Numeric(6) | Refund time at the banking acquirer. Format: HHMMSS. May differ from timeStamp. |
| trxType | Alphanumeric(1) | Type of card. For a credit card refund this is always C = Credit. |
Conditionally returned
| Field | Type | Description |
|---|---|---|
| accountType | Alphanumeric(1) | Only returned for debit transactions. C = Chequing, S = Savings. |
| customerNumber | Alphanumeric(8) | Only returned when provided in the request. Echo of the request CustomerNumber. |
| cvmResults | Alphanumeric(6) | Only returned for chip (EMV) transactions. Cardholder Verification Method result. Print a signature line on the receipt if the first 2 digits are 03, 05, 43, 45, 1E, or 5E. |
| demoMode | Alphanumeric(4) | Only returned when the terminal is in demo mode. Value will be true. |
| emvAID | Alphanumeric(32) | Only returned for chip (EMV) transactions. EMV Application Identifier. Example: AID: A000000003 |
| emvLabel | Alphanumeric(16) | Only returned for chip (EMV) transactions. Human-readable application label. Example: VISA CREDIT |
| emvTC | Alphanumeric(40) | Only returned for chip (EMV) transactions. EMV Transaction Cryptogram. |
| emvTSI | Alphanumeric(4) | Only returned for chip (EMV) transactions. EMV Transaction Status Information. |
| emvTVR | Alphanumeric(10) | Only returned for chip (EMV) transactions. EMV Terminal Verification Result. |
| errorDescription | Alphanumeric(50) | Only returned when the transaction is not approved. Human-readable description of the failure reason. |
| surchargeAmount | Numeric(11) | Only returned when a surcharge was applied. Left (0) padded. |
| taxAmount | Numeric(11) | Only returned when taxAmount was included in the request. Echo of the submitted tax amount. |
| terminalInvoiceNumber | Numeric(12) | Only returned for terminal transactions. Terminal-assigned invoice number. |
| tipAmount | Numeric(11) | Only returned when a tip was included. Left (0) padded. |
| token | Alphanumeric(35) | Only returned when tokenization is enabled. Token linked to the cardholder. |
{
"returnCode": "00",
"authorizationNumber": "REFUND01",
"transactionNumber": "000111222444",
"referenceNumber": "0000000002",
"amount": "00000005000",
"cardNumber": "411111XXXXXX1111 ",
"cardType": "V",
"trxType": "C",
"trxCode": "03",
"trxDate": "05162024",
"trxTime": "100000",
"trxMethod": "T@1",
"timeStamp": "20240516-10000100",
"batchNumber": "0001",
"sequenceNumber": "000011112223",
"serverNumber": "0001",
"terminalNumber": "00000",
"bankTerminalNumber": "00000001",
"companyNumber": "12345",
"merchantNumber": "53400000",
"invoiceNumber": "REF000000001",
"expirationDate": "1226",
"languageCode": "E",
"operatorId": "USER0001",
"receiptDisp": "APPROVED-THANK-YOU ",
"terminalDisp": "APPROVED "
}{
"returnCode": "05",
"errorDescription": "TRANSACTION DECLINED",
"terminalDisp": "DECLINED ",
"receiptDisp": "DECLINED ",
"transactionNumber": "000111222445",
"timeStamp": "20240516-10000200"
}The following codes are most relevant to this endpoint. For the complete catalogue see the Return Code Index.
| Return Code | Meaning | When it occurs | Recommended Action |
|---|---|---|---|
| 00 | Transaction approved | The refund was approved and will be credited to the cardholder's original card. | Display the authorizationNumber on the customer receipt. |
| 05 | Transaction declined | The refund was declined by the issuing bank. | Retry the transaction. If the problem persists, contact PayFacto customer service. |
| 9004 | "Null" value: company number | CompanyNumber is null or blank in the payload. | Check your application. The field must correspond to the specification in the documentation. |
| 9005 / 9006 | Invalid / rejected: company number | CompanyNumber does not match the required 5-digit length or is not configured in the payment solution. | Make sure the application uses the correct company number provided by PayFacto. If it does, contact PayFacto customer service. |
| 9007 | "Null" value: merchant number | MerchantNumber is null or blank in the payload. | Check your application. The field must correspond to the specification in the documentation. |
| 9008 / 9009 | Invalid / rejected: merchant number | MerchantNumber does not match the required 8-digit length or is not configured in the payment solution. | Make sure the application uses the merchant number provided by PayFacto. If it does, contact PayFacto customer service. |
| 9013 / 9014 / 9015 | Null / invalid / rejected: amount | Amount is null, does not match the required 11-digit length, or does not follow the specification. | Confirm the amount is left (0) padded to 11 digits and includes the decimal portion. If the problem persists, contact PayFacto customer service. |
| 9016 / 9017 / 9018 | Null / invalid / rejected: invoice number | InvoiceNumber is null, exceeds 12 characters, or does not follow the specification. | Check your application. The field must correspond to the specification in the documentation. |
| 9019 / 9020 / 9021 | Null / invalid / rejected: input type | InputType is null, not a single character, not in the list of accepted values, or not associated with the merchant. | Check your application. The field must correspond to the specification in the documentation. |
| 9031 | "Null" value: POS terminal number | MerchantTerminalNumber is null or blank when a terminal transaction is being attempted. | For terminal transactions provide a valid terminal number; for E-Commerce send 5 blank spaces. |
| 9032 / 9033 | Invalid / rejected: POS terminal number | MerchantTerminalNumber does not follow the specification, or the merchant is not configured as a POS terminal merchant. | Check your application. The field must correspond to the specification in the documentation. If the problem persists, contact PayFacto customer service. |
| 9062 / 9063 | Null / invalid: original transaction number | OriginalTransactionNumber is null, blank, or does not match the required 12-digit format. | Ensure you are using the exact transactionNumber from the original approved transaction response. |
| 9064 / 9065 | Null / invalid: original invoice number | OriginalInvoiceNumber is null, blank, exceeds 12 characters, or does not match the original transaction record. | Ensure you are using the exact invoiceNumber from the original approved transaction response. |
| 9066 / 9067 | Null / invalid: original amount | OriginalAmount is null, blank, does not match the required 11-digit format, or does not match the original transaction record. | Ensure you are using the exact amount from the original approved transaction response, left (0) padded to 11 digits. |
| 9068 / 9069 | Cross-validation failure | The combination of OriginalTransactionNumber, OriginalInvoiceNumber, and OriginalAmount does not match a transaction on record, or the original transaction is not eligible for refund. | Verify all three Original* values match exactly what was returned in the original transaction response. If the problem persists, contact PayFacto customer service. |
| 3666 | One or more terminals are busy | All of the merchant's terminals are currently processing transactions. | Wait and retry. If the problem persists, contact PayFacto customer service. |
| 3667 | Semi-integrated terminal is busy | The target terminal is currently processing another transaction or a recovery is in progress. | Wait 15 seconds and retry. If the problem persists, contact PayFacto customer service. |
| 3668 | Waiting for a recovery | An error occurred with the semi-integrated terminal. A recovery must be completed before another operation can be processed. | Make sure everything is plugged in correctly. If needed, restart the driver and unplug then replug the terminal power. Wait 35 seconds and retry. If the problem persists, contact PayFacto customer service. |
| 3777 | Inexistent terminal and/or merchant | The merchant or terminal has not been configured in the Dispatcher module. | If the problem persists, contact PayFacto customer service. |
| 9051 | Time out | Transaction processing timed out. Often caused by an inactive Dispatcher module. | Retry the transaction. If the problem persists, contact PayFacto customer service. |
| 9049 / 9050 | Fatal error | A critical error occurred while processing the transaction. | Retry the transaction. If the problem persists, contact PayFacto customer service. |