PayFacto API - v1.0 - POST /v1/redirect/GetResponse

PayFacto API - v1.0 - POST /v1/redirect/GetResponse

PayFacto API - v1.0 - POST /v1/redirect/GetResponse

Retrieves the result of a hosted payment session after the cardholder has been redirected back to the merchant's success or failure URL. Called immediately following the redirect from /v1/redirect/CreatePurchaseSession. After retrieving the result, the merchant must issue either a /v1/ack to accept the transaction or a /v1/nack to refuse it within 3 minutes of the original transaction response or PayFacto will automatically reverse the transaction.

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 Redirect Get Response 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.

πŸ”„

Hosted Payment Flow β€” Step 2 of 3

This endpoint is the second step in the hosted payment redirect flow:

StepActionEndpoint
1Create a hosted payment session and redirect the cardholder to the returned sessionUrl to enter their payment details/v1/redirect/CreatePurchaseSession
2 ← You are hereAfter the cardholder is redirected back to your URL, call this endpoint to retrieve the payment result and the transactionNumber/v1/redirect/GetResponse
3Accept the transaction or refuse it within the required time window/v1/ack or /v1/nack
⏱️

ACK or NACK Required β€” See Timing on the ACK Page

After calling this endpoint, a /v1/ack or /v1/nack must be sent using the transactionNumber returned in this response. Refer to the ACK documentation for the time window and consequences of missing it.

πŸ”

Read-Only Operation

This endpoint retrieves the payment result only. No transaction is processed and no record is modified by this call. The transaction is not confirmed until a subsequent /v1/ack is accepted.

2

Request

POST https://test.api.payfacto.cloud/v1/redirect/GetResponse
ℹ️

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 returned as a query parameter when the cardholder was redirected back to the merchant URL after completing the hosted payment form. 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. Use the TransactionNumber received as a query parameter on the redirect back to your URL from the hosted payment form.

cURL
# Redirect Get Response -- POST /v1/redirect/GetResponse
# Step 1: Build the cleartext payload
# TransactionNumber comes from the redirect back to your success/failure URL

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
curl -X POST "https://test.api.payfacto.cloud/v1/redirect/GetResponse" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "auth-api-key=YOUR_TEST_API_KEY&payload=$ENCODED"

# Step 4: After inspecting the response, immediately send ACK or NACK
# using the transactionNumber returned below
4

Response

Always returned

FieldTypeDescription
returnCodeAlphanumeric(4)Identifies the result of the session retrieval. 00 = payment result retrieved successfully. All other values indicate a 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: 20240601-10000100

Conditionally returned β€” Payment result

Returned when returnCode is 00 and the cardholder completed the hosted payment form. Store the transactionNumber and authorizationNumber immediately β€” both are required for receipt display and the subsequent ACK or NACK call.

FieldTypeDescription
transactionNumberNumeric(12)β˜… Pass to ACK or NACK. The PayFacto gateway transaction identifier for this payment. Must be passed as TransactionNumber in the subsequent /v1/ack or /v1/nack call. Example: 000111222333
authorizationNumberAlphanumeric(8)Authorization code from the issuing bank. Must be displayed on the customer receipt. Example: APPROV01
amountNumeric(11)Amount charged to the cardholder, left (0) padded. Example: 00000010000 = $100.00
invoiceNumberAlphanumeric(12)Echo of the InvoiceNumber submitted when creating the session via /v1/redirect/CreatePurchaseSession.
cardNumberAlphanumeric(40)Masked card number used for the payment.
cardTypeAlphanumeric(1)Card brand used for the payment. A = Amex, M = Mastercard, V = Visa, I = Diners, O = Discover.
errorDescriptionAlphanumeric(50)Only returned when the request fails (non-00 returnCode). Human-readable description of the failure reason.
5

Response β€” Code Example

JSON β€” 200 Success (cardholder completed hosted payment form)
{
"returnCode": "00",
"serverNumber": "0001",
"timeStamp": "20240601-10000100",
"transactionNumber": "000111222333",
"authorizationNumber": "APPROV01",
"amount": "00000010000",
"invoiceNumber": "PUR000000001",
"cardNumber": "411111XXXXXX1111 ",
"cardType": "V"
}
JSON β€” Error
{
"returnCode": "9006",
"errorDescription": "INVALID COMPANY NUMBER",
"serverNumber": "0001",
"timeStamp": "20240601-10000200"
}
6

Error / Return Codes

The following codes are most relevant to this endpoint. For the complete catalogue see the Return Code Index.

Return CodeMeaningWhen it occursRecommended Action
00Payment result retrievedThe hosted payment session result was retrieved successfully.Store the transactionNumber and authorizationNumber immediately. Send /v1/ack to accept the payment or /v1/nack to refuse it. Refer to the ACK page for timing requirements.
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 ACK/NACK window is 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 ACK/NACK window is running. If the problem persists, contact PayFacto customer service.