Authentication and card data

Certification cases for bearer-token and Basic authentication, tokenization, and direct card data.

Part of the Certification guide. Mark your scope on that page before you run these cases. Base payloads and test cards are on the Reference page.


1. Connectivity and authentication

Two authentication methods exist. The bearer-token flow in 1.1 is the default and applies to every integration. Basic Authentication in 1.2 is an alternative that FlexFactor must enable on your account.

1.1 Bearer token

Applies to: CORE. Tokens live for 30 minutes. Cache the token and request a new one only after a 401. One token request for many API calls is the expected pattern; the Solutions engineer can see the token-request rate on the sandbox side.

Reference: Authentication, /health, Workflows §1.

IDScenarioSetup / actionExpected resultEvidence
AUTH-01Health checkGET /v1/health with no authenticationHTTP 200 with an empty bodyHTTP status
AUTH-02Token issuedPOST /v1/oauth2/token with valid appKey and appSecretHTTP 200; accessToken and expires present; expires is a Unix-epoch timestamp in milliseconds 30 minutes after issueResponse without the token value
AUTH-03Invalid credentialsPOST /v1/oauth2/token with a wrong appSecretHTTP 400; errors[""] contains please check your keys; no token issuedHTTP status, traceId
AUTH-04Invalid bearer, then refresh and retryPOST /v1/evaluate with the base CIT payload and a malformed bearer token. Request a new token and resend the same request one timeThe first response is HTTP 401. The resend returns HTTP 200 with status APPROVEDBoth HTTP statuses, orderId

1.2 Basic Authentication

Applies to: BASIC-AUTH. The credential is the API Key and API Secret joined by a single period, Base64-encoded, and sent as Authorization: Basic {credential} on every request. No call to /oauth2/token is made. The credential does not expire, so a 401 is a credential defect; log it and raise an alert rather than retrying. Build the header on the server. The encoding is not encryption, so the header must travel over HTTPS only.

Reference: Basic Authentication.

IDScenarioSetup / actionExpected resultEvidence
BASIC-AUTH-01Request authenticated with the Basic headerPOST /v1/evaluate with the base CIT payload and Authorization: Basic base64({API Key}.{API Secret})HTTP 200; status APPROVED; orderId presentorderId
BASIC-AUTH-02Wrong secretRepeat BASIC-AUTH-01 with an incorrect API SecretHTTP 401; no order createdHTTP status, traceId
BASIC-AUTH-03Basic header on other endpointsGET /v1/orders/{orderId} for the BASIC-AUTH-01 order with the Basic header. When Section 8 is in scope, also run CIT-AUTHORIZE-02, MIT-ASYNC-AUTHORIZE-03, or SYNC-MIT-04 with the Basic headerHTTP 200 on each call; GET returns the BASIC-AUTH-01 order; the capture returns status SUCCESSHTTP statuses

2. Tokenization and card data

2.1 Tokenized path

Applies to: TOKENIZE. /tokenize is authenticated by the mid and environment query parameters, not by a bearer token. The request body is snake_case, and the response returns the token as transaction.payment_method.token. Store it with the BIN, last 4 digits, expiry month and year, and holder name taken from the card data you collected, because the /evaluate payload needs those fields alongside the token.

Reference: /tokenize, Sandbox Test Cards, Appendix B.

IDScenarioSetup / actionExpected resultEvidence
TOKENIZE-01Tokenize a cardPOST /v1/tokenize?mid={mid}&environment={tokenizationKey} with payment_method.credit_card.number 4000002760003184, month and year in the future, and optional first_name and last_nameHTTP 200; success true; transaction.payment_method.token is a GUID (the token)Token GUID
TOKENIZE-02Token used in evaluateBase CIT payload with paymentMethod.cardNumber = the token from TOKENIZE-01 and token: trueHTTP 200; status is APPROVEDorderId

2.2 Direct card data path

Applies to: DIRECT-CARD. Requires a PCI AOC on file and enablement by FlexFactor.

Reference: Workflows §4, Appendix A.1.

IDScenarioSetup / actionExpected resultEvidence
DIRECT-CARD-01Raw PAN acceptedBase CIT payload with paymentMethod.cardNumber = 4000002760003184, token: false, verificationValue omittedHTTP 200; status is APPROVEDorderId
DIRECT-CARD-02CVV sent on CITBase CIT payload with card 4111111111111111, token: false, verificationValue = 999, any name other than Cure TesterHTTP 200; status is APPROVEDorderId


Did this page help you?