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).
π
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.
π¦
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.
βΉοΈ
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
| 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 |
| LanguageCode | Alphanumeric(1) | Language for PayFacto responses. F = French, E = English. |
| OperatorID | Alphanumeric(8) | Identifies the cashier, agent, or system that initiated the request. Example: USER0001 |
| TransactionNumber | Numeric(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"
Always returned
| Field | Type | Description |
|---|
| returnCode | Alphanumeric(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. |
| serverNumber | Alphanumeric(4) | Identifies the PayFacto Network server that processed the request. |
| timeStamp | Alphanumeric(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.
| Field | Type | Description |
|---|
| result | Alphanumeric | β
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. |
| errorDescription | Alphanumeric(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"
}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 Code | Meaning | When it occurs | Recommended Action |
|---|
| 00 | Request processed | The 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 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. |
| 9051 | Time out | Request 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 / 9050 | Fatal error | A 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.
|