PayFacto API - v1.0 - Overview & Endpoints

PayFacto API - v1.0 - Overview & Endpoints

PayFacto API - v1.0 - Overview & Endpoints

The PayFacto Payment API v1.0 communicates over HTTP POST. All requests use Base64-encoded form parameters; all responses are JSON. This page covers the request format, authentication, payload encoding, and the complete list of available endpoints.

πŸ“‹

  Request Format

All requests are HTTP POST with a application/x-www-form-urlencoded body containing two fields:

πŸ”‘

auth-api-key

Your API key. Passed as a plain string β€” not Base64-encoded. Generated from the Payments Manager (see API Key section below).

πŸ“¦

payload

All transaction parameters assembled as a cleartext query string, then Base64-encoded (see Payload & Encoding section below).

Final request body format:

Body
auth-api-key={your_api_key}&payload={base64_encoded_parameters}
πŸ”‘

  API Key

Each merchant has a unique API key that authenticates all requests. To generate a key:

Payments Manager β†’ Administrator Client β†’ API Key β†’ "Add New Key"
⚠️

Keep your API key confidential. Never expose it in client-side code, browser requests, or public repositories. All API calls must be made server-to-server.

πŸ“¦

  Payload & Base64 Encoding

All transaction parameters are assembled into a single cleartext query string, then Base64-encoded before submission. The three steps are:

1

  Build the cleartext parameter string

Assemble all required parameters as a URL-encoded query string:

Cleartext
CompanyNumber=66666&MerchantNumber=00005666&CustomerNumber=00000000&Amount=00000001000&InvoiceNumber=505836912354&OriginalInvoiceNumber=505836912354&InputType=I&CardType= &CardNumber=450228XXXXXX0007&ExpirationDate=0726&Cvv2Cvc2Number=123&MerchantTerminalNumber=12345&LanguageCode=F&CurrencyCode=CAD&OperatorID=CTPSIMUL
2

  Base64-encode the entire string

Base64-encoded payload
Q29tcGFueU51bWJlcj02NjY2NiZNZXJjaGFudE51bWJlcj0wMDAwNTY2NiZDdXN0b21lck51bWJlcj0wMDAwMDAwMCZBbW91bnQ9MDAwMDAwMDEwMDAmSW52b2ljZU51bWJlcj01MDU4MzY5MTIzNTQmT3JpZ2luYWxJbnZvaWNlTnVtYmVyPTUwNTgzNjkxMjM1NCZJbnB1dFR5cGU9SSZjYXJkVHlwZT0gJkNhcmROdW1iZXI9NDUwMjI4WFhYWFhYMDAwNyZFeHBpcmF0aW9uRGF0ZT0wNzI2JkN2djJDdmMyTnVtYmVyPTEyMyZNZXJjaGFudFRlcm1pbmFsTnVtYmVyPTEyMzQ1NiZMYW5ndWFnZUNvZGU9RiZDdXJyZW5jeUNvZGU9Q0FEJk9wZXJhdG9ySUQ9Q1RQU0lNVUw=
3

  Submit the full request body

Final POST body (auth-api-key + payload)
auth-api-key=0000000000000000000000000000000000&payload=Q29tcGFueU51bWJlcj02NjY2NiZNZXJjaGFudE51bWJlcj0wMDAwNTY2NiZDdXN0b21lck51bWJlcj0wMDAwMDAwMCZBbW91bnQ9MDAwMDAwMDEwMDAmSW52b2ljZU51bWJlcj01MDU4MzY5MTIzNTQmT3JpZ2luYWxJbnZvaWNlTnVtYmVyPTUwNTgzNjkxMjM1NCZJbnB1dFR5cGU9SSZjYXJkVHlwZT0gJkNhcmROdW1iZXI9NDUwMjI4WFhYWFhYMDAwNyZFeHBpcmF0aW9uRGF0ZT0wNzI2JkN2djJDdmMyTnVtYmVyPTEyMyZNZXJjaGFudFRlcm1pbmFsTnVtYmVyPTEyMzQ1NiZMYW5ndWFnZUNvZGU9RiZDdXJyZW5jeUNvZGU9Q0FEJk9wZXJhdG9ySUQ9Q1RQU0lNVUw=

cURL example:

cURL
# Step 1: Build and encode the payload
PAYLOAD="CompanyNumber=66666&MerchantNumber=00005666&Amount=00000001000&..."
ENCODED=$(echo -n "$PAYLOAD" | base64)

# Step 2: POST to the endpoint
curl -X POST "https://test.api.payfacto.cloud/v1/purchase" -H "Content-Type: application/x-www-form-urlencoded" -d "auth-api-key=YOUR_API_KEY&payload=$ENCODED"
πŸ“€

  Response Format

All responses are returned as JSON key-value pairs. Always check returnCode (or recurReturnCode for recurring endpoints) first β€” a value of 00 indicates success.

JSON β€” Example Response (Purchase approved)
{
"returnCode": "00",
"authorizationNumber": "APPROV99",
"transactionNumber": "000111222333",
"amount": "00000001000",
"cardType": "V",
"trxCode": "00",
"timeStamp": "20240515-14300100",
"receiptDisp": "APPROVED-THANK-YOU ",
"terminalDisp": "APPROVED "
}
ℹ️

For the complete list of response fields and their meanings, see Response Parameters. For return code definitions, see Return Codes.

🌐

  Base URLs

πŸ’§

  Test

Use this environment during development and certification. No real card charges are processed.

🟒

  Production

Provided by the PayFacto Integration team upon successful certification of your solution. Contact PayFacto Support to begin the certification process.

πŸ“±

  Semi-Integrated Utilities

Endpoint Method Test URL
Ack POST https://test.api.payfacto.cloud/v1/ack
Nack POST https://test.api.payfacto.cloud/v1/nack
Recover POST https://test.api.payfacto.cloud/v1/recover
Signature Capture POST https://test.api.payfacto.cloud/v1/signature/get
πŸ—ƒ

  Batch Management

Endpoint Method Test URL
Close Batch POST https://test.api.payfacto.cloud/v1/closeBatch
Total Batch POST https://test.api.payfacto.cloud/v1/totalBatch
🌐

  Redirect β€” Hosted Payment

The Redirect flow sends cardholders to a PayFacto-hosted payment page. Create a session server-side, redirect the browser, then retrieve the result once the cardholder returns.

Endpoint Method Test URL
Redirect - Create Preauth Session POST https://test.api.payfacto.cloud/v1/redirect/CreatePreAuthSession
Redirect - Create Purchase Session POST https://test.api.payfacto.cloud/v1/redirect/CreatePurchaseSession
Redirect - Get Response POST https://test.api.payfacto.cloud/v1/redirect/GetResponse
πŸ”’

  Secure Fields (PayFacto Objects)

PayFacto Objects (Secure Fields) allows card data to be collected directly in your page via iFrame-hosted input fields, keeping your front end out of PCI scope.

Endpoint Method Test URL
Secure Fields - Session Creation POST https://test.api.payfacto.cloud/v1/securefields/session/new
🏠

  IAP

Interac Authorized Push (IAP) endpoints for real-time Interac payment flows.

Endpoint Method Test URL
IAP Purchase POST https://test.api.payfacto.cloud/v1/iapPurchase
IAP Pre-Authorization POST https://test.api.payfacto.cloud/v1/iapPreAuthorization
IAP Completion POST https://test.api.payfacto.cloud/v1/iapCompletion
IAP Refund POST https://test.api.payfacto.cloud/v1/iapRefund
IAP Purchase Correction POST https://test.api.payfacto.cloud/v1/iapPurchaseCorrection
IAP Refund Correction POST https://test.api.payfacto.cloud/v1/iapRefundCorrection
πŸ”„

  Recurring Billing

The recurring billing module manages subscribers (users), subscriptions, and invoices. Recurring endpoints use recurReturnCode in responses instead of returnCode.

Endpoint Method Test URL
Recurring - Add User POST https://test.api.payfacto.cloud/v1/recur/AddUser
Recurring - Modify User POST https://test.api.payfacto.cloud/v1/recur/ModUser
Recurring - Delete User POST https://test.api.payfacto.cloud/v1/recur/DelUser
Recurring - Info User POST https://test.api.payfacto.cloud/v1/recur/InfoUser
Recurring - Verify User POST https://test.api.payfacto.cloud/v1/recur/VerifyUser
Recurring - Add Subscription POST https://test.api.payfacto.cloud/v1/recur/AddSubscription
Recurring - Modify Subscription POST https://test.api.payfacto.cloud/v1/recur/ModSubscription
Recurring - Delete Subscription POST https://test.api.payfacto.cloud/v1/recur/DelSubscription
Recurring - Info Subscription POST https://test.api.payfacto.cloud/v1/recur/InfoSubscription
Recurring - Modify Invoice POST https://test.api.payfacto.cloud/v1/recur/ModInvoice
Recurring - Info Invoice POST https://test.api.payfacto.cloud/v1/recur/InfoInvoice
Recurring - Create Session POST https://test.api.payfacto.cloud/v1/recur/CreateSession
Recurring - Get Response POST https://test.api.payfacto.cloud/v1/recur/GetResponse
Recurring - Ack POST https://test.api.payfacto.cloud/v1/recur/ack
Recurring - Nack POST https://test.api.payfacto.cloud/v1/recur/nack
🎁

  DataCandy (Gift / Loyalty)

DataCandy endpoints manage gift and loyalty card transactions. Store transactionConfirmationNumber from every DataCandy response β€” it is required for commit and cancel operations.

Endpoint Method Test URL
DataCandy - Activate POST https://test.api.payfacto.cloud/v1/datacandy/activate
DataCandy - Balance POST https://test.api.payfacto.cloud/v1/datacandy/balance
DataCandy - Purchase POST https://test.api.payfacto.cloud/v1/datacandy/redemption
DataCandy - Increment POST https://test.api.payfacto.cloud/v1/datacandy/increment
DataCandy - Partial Cancel POST https://test.api.payfacto.cloud/v1/datacandy/partialCancel
DataCandy - Complete Cancel POST https://test.api.payfacto.cloud/v1/datacandy/completeCancel
DataCandy - Empty Card POST https://test.api.payfacto.cloud/v1/datacandy/emptyCard