PayFacto API - v1.0 - POST /v1/nack

PayFacto API - v1.0 - POST /v1/nack

PayFacto API - v1.0 - POST /v1/nack

Instructs the PayFacto host to reverse a previously approved card-not-present transaction. The NACK must be sent within 3 minutes of the original approval β€” after that window, PayFacto's automatic reversal process takes over. The response indicates whether the reversal was accepted (true) or not (false).

1

Prerequisites

πŸ”‘

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 NACK 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}. This endpoint does not require card data, amounts, or invoice numbers.

πŸ“΅

Card-Not-Present / E-Commerce Only

This endpoint applies to card-not-present transactions only. It is not applicable to semi-integrated terminal transactions. No MerchantTerminalNumber is required.

⏱️

3-Minute Window

The NACK must be sent within 3 minutes of the original transaction approval. After this window, the PayFacto host will automatically initiate its own reversal process and the NACK will no longer be accepted.

βœ”οΈ

Boolean Result β€” Not a Standard Return Code

Unlike other endpoints, the outcome of the reversal instruction is returned in the result field as true (reversal accepted by the host) or false (reversal not accepted). A returnCode of 00 confirms only that the request was processed β€” always inspect result to determine whether the reversal was accepted.

2

Request

ℹ️

All parameters are passed inside the Base64-encoded payload form field. Raw body format: auth-api-key=<key>&payload=<base64>. This endpoint does not require card data, amounts, or invoice numbers.

Required fields

FieldTypeDescription
CompanyNumberNumeric(5)Identifies the merchant on PayFacto's network. Provided by PayFacto during onboarding. Example: 12345
MerchantNumberNumeric(8)Identifies the merchant to PayFacto's network. Provided by the integration team. Example: 53400000
LanguageCodeAlphanumeric(1)Language for PayFacto responses. F = French, E = English.
OperatorIDAlphanumeric(8)Identifies the cashier, agent, or system that initiated the request. Example: USER0001
TransactionNumberNumeric(12)The PayFacto gateway transaction identifier of the previously approved transaction to reverse. This is the transactionNumber returned in the original approved transaction response. Must be sent within 3 minutes of the original approval. Example: 000111222333
3

Request β€” Code Example

⚠️

The example below uses the test endpoint and a sandbox API key. Replace credentials and base URL before going live. The NACK must be sent within 3 minutes of the original transaction approval.

cURL
# NACK -- POST /v1/nack
# Step 1: Build the cleartext payload

PAYLOAD="CompanyNumber=12345&MerchantNumber=53400000&LanguageCode=E&OperatorID=USER0001&TransactionNumber=000111222333"

# Step 2: Base64-encode the payload
ENCODED=$(echo -n "$PAYLOAD" | base64)

# Step 3: Submit the request (within 3 minutes of original approval)
curl -X POST "https://test.api.payfacto.cloud/v1/nack" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "auth-api-key=YOUR_TEST_API_KEY&payload=$ENCODED"
4

Response

Always returned

FieldTypeDescription
returnCodeAlphanumeric(4)Identifies the result of the request processing. 00 = request was processed β€” check result for the reversal outcome. All other values indicate a request-level failure. Refer to Section 6 for endpoint-specific codes.
serverNumberAlphanumeric(4)Identifies the PayFacto Network server that processed the request.
timeStampAlphanumeric(17)Date and time the request was processed. Format: YYYYMMDD-HHMMSSCC. Example: 20240515-14320100

Conditionally returned

Returned when returnCode is 00. The result field is the definitive indicator of whether the reversal was accepted by the PayFacto host.

FieldTypeDescription
resultAlphanumericβ˜… Always inspect this field. The outcome of the reversal instruction. true = the reversal was accepted by the PayFacto host and the original transaction will be reversed. false = the reversal was not accepted, typically because the 3-minute window has elapsed or the transaction is not eligible for reversal.
errorDescriptionAlphanumeric(50)Only returned when the request fails (non-00 returnCode). Human-readable description of the failure reason.
5

Response β€” Code Example

JSON β€” Reversal accepted
{
"returnCode": "00",
"serverNumber": "0001",
"timeStamp": "20240515-14320100",
"result": "true"
}
JSON β€” Reversal not accepted (window elapsed or not eligible)
{
"returnCode": "00",
"serverNumber": "0001",
"timeStamp": "20240515-14350100",
"result": "false"
}
JSON β€” Request-level error
{
"returnCode": "9006",
"errorDescription": "INVALID COMPANY NUMBER",
"serverNumber": "0001",
"timeStamp": "20240515-14320200"
}
6

Error / Return Codes

The following codes apply to the request processing result in returnCode. A returnCode of 00 does not guarantee the reversal was accepted β€” always read the result field. For the complete catalogue see the Return Code Index.

Return CodeMeaningWhen it occursRecommended Action
00Request processedThe NACK request reached the PayFacto host successfully. The reversal outcome is in the result field.Read result. If true, the reversal was accepted. If false, the 3-minute window may have elapsed or the transaction is not eligible β€” the original transaction stands and the cardholder will be charged.
9004"Null" value: company numberCompanyNumber is null or blank in the payload.Check your application. The field must correspond to the specification in the documentation.
9005 / 9006Invalid / rejected: company numberCompanyNumber 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 numberMerchantNumber is null or blank in the payload.Check your application. The field must correspond to the specification in the documentation.
9008 / 9009Invalid / rejected: merchant numberMerchantNumber 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.
9051Time outRequest processing timed out.Retry the request immediately. Be aware the 3-minute reversal window is still running. If the problem persists, contact PayFacto customer service.
9049 / 9050Fatal errorA critical error occurred while processing the request.Retry the request immediately. Be aware the 3-minute reversal window is still running. If the problem persists, contact PayFacto customer service.