flitt-payments
Flitt payment API implementation guidance for auth, SHA1 request/callback signatures, sandbox testing, hosted checkout, Payment (redirect), Payment (direct), saved-card /api/recurring charges, card to
SKILL.mdskills/flitt-payments/SKILL.md
GitHubFlitt Payments
Core Workflow
Use this skill for Flitt payment API work, starting with authentication and testing.
- Read
references/testing-auth.mdwhen the task involves sandbox credentials, test cards, request shape, response interpretation, or signature troubleshooting. - Read
references/sending-request.mdwhen the task involves checkout flow design, redirect endpoints, request/response envelopes, callback handling, or choosing between browser form POST and host-to-host checkout URL creation. - Read
references/payment-redirect.mdwhen the task involves Payment (redirect) parameters, checkout URL creation, HTML form redirect creation, embedded checkout token creation, or/api/status/order_idpolling. - Read
references/payment-direct.mdwhen the task involves Payment (direct), raw card parameters, PCI DSS merchant flows, or/api/3dsecure_step1and/api/3dsecure_step2. - Read
references/payment-saved-card.mdwhen the task involves Payment with saved card,rectoken, recurring/tokenized charges, or/api/recurring. - Read
references/saving-cards.mdwhen the task involves obtainingrectoken,required_rectoken=Y, verification-based tokenization, or the first-purchase card-save flow. - Read
references/reversal.mdwhen the task involves refunds, reversals, partial/full reverse,reverse_id,/api/reverse/order_id, or reversal status. - Read
references/capture.mdwhen the task involves capture, preauth hold completion, partial capture,/api/capture/order_id, or capture status. - Read
references/subscriptions.mdwhen the task involves scheduled subscriptions,subscription=Y,recurring_data,/api/subscription, or starting/stopping subscriptions. - Read
references/additional-data.mdwhen the task involvesreservation_data, checkout custom fields, fiscalisation products, payer metadata, or forcing/relaxing 3DS behavior through additional data. - Read
references/currencies.mdwhen the task involves validating thecurrencyfield, merchant-country currency support, or payment currency selection. - Read
references/callbacks.mdwhen the task involvesserver_callback_url, webhook endpoints, retries, firewall/IP allowlists, or verifying asynchronous payment notifications. - Read
references/signature.mdwhen the task is specifically about Flitt signature generation, verification failures, lowercasing, empty parameters,/api/recurringsigning, or callback/redirect signature mismatches. - Read
references/response-codes.mdwhen the task involvesresponse_code, API failures, embedded-checkout JavaScript error codes, decline interpretation, or deciding whether merchant, issuer, or Flitt must solve the problem. - Use
scripts/flitt_signature.pyinstead of hand-writing SHA1 signature code for flat request/response parameters. - Keep public Flitt test credentials out of production code. Use environment variables or the app's secret manager for real merchant credentials.
- Treat
response_statusas the HTTP/API processing status, not the payment result. Inspect payment-specific fields such asorder_status,reverse_status,reversal_amount,capture_status, subscriptionstatus, andresponse_codefor operation outcome.
Authentication
Flitt API requests are HTTPS POST requests. Every signed request includes a signature parameter inside the root request object.
Generate the signature from:
- The merchant payment secret key.
- All non-empty request or response parameters except
signatureandresponse_signature_string. - Parameters sorted alphabetically by key.
- Values joined with
|, encoded as UTF-8, then hashed with SHA1.
Use the helper:
python3 ~/.codex/skills/flitt-payments/scripts/flitt_signature.py \
--secret test \
--params '{"merchant_id":1549901,"amount":1000,"currency":"GEL","order_desc":"Test payment","order_id":"TestOrder2","server_callback_url":"http://myshop/callback/"}'
To verify a received signature:
python3 ~/.codex/skills/flitt-payments/scripts/flitt_signature.py \
--secret "$FLITT_PAYMENT_KEY" \
--params-file response.json \
--verify "$FLITT_RESPONSE_SIGNATURE"
If response.json has a root response or request object, the helper signs that inner object automatically.
Testing
Use Flitt test merchant data only for sandbox work:
- Purchase merchant:
merchant_id=1549901, secret keytest - Payout secret key:
testcredit - Test card data: load
references/testing-auth.md
For manual test flows, choose cards deliberately:
- Use an approve card for happy-path checkout.
- Use a decline card when verifying failure UI and webhook handling.
- Use 3DS challenge/frictionless cards when validating redirect and callback handling.
- Use Open Banking
payment_method=xonly for Demo Bank testing.
Sending Requests
Use the hosted checkout flow unless the user explicitly needs direct card entry or another specialized Flitt API.
- Scheme A: create an HTML form and submit the customer browser to
https://pay.flitt.com/api/checkout/redirect/with HTTPSPOST. - Scheme B: send a server-to-server JSON request to
https://pay.flitt.com/api/checkout/url/, readcheckout_urlfrom the response, then redirect the customer there. - Always include Flitt parameters under a root
requestobject for JSON requests. - Always handle both customer return (
response_url) and server-to-server callback (server_callback_url) when available; use the callback as the reliable status update.
For Payment (redirect) details, load references/payment-redirect.md.
Direct Payments
Use Payment (direct) only when the merchant is intentionally PCI DSS compliant and the app is allowed to collect/process card data directly.
- Direct card requests include raw
card_number,cvv2, andexpiry_datevalues; never log or persist those values unless the project has explicit compliant storage controls. - Start direct 3DS authentication with
POST /api/3dsecure_step1. - If 3DS is required, submit the customer to
acs_urlwithPaReq,MD, andTermUrl. - Complete the transaction with
POST /api/3dsecure_step2using returnedparesandmd. - For details, load
references/payment-direct.md.
Saved Card Payments
Use Payment with saved card when charging a previously issued Flitt rectoken.
- Create saved-card charges with
POST /api/recurring. - Send JSON with root
request; the endpoint is always host-to-host. - Redirect and 3DS flows are not available on
/api/recurring; use Payment (direct) if 3DS is required. - Treat
rectokenas sensitive payment data and avoid logging it. - For details, load
references/payment-saved-card.md.
Saving Cards
Use the saving-cards reference when the task is about obtaining a new rectoken, not charging an existing one.
- Request token issuance with
required_rectoken=Yduring create-order flow. - Option 1: save card during verification with
verification=Yand a small amount that is held then reversed. - Option 2: save card during the first real purchase and return the token alongside the purchase result.
rectokenis returned toresponse_urlandserver_callback_url.- For details, load
references/saving-cards.md.
Reversals
Use reversals to refund or reverse an approved payment fully or partially.
- Create a reversal with
POST /api/reverse/order_id. - For a full reversal, send
amountequal to the original orderactual_amount. - Multiple partial reversals are allowed while their sum is less than or equal to
actual_amount. - Use
reverse_idas an idempotency key for safe retry of partial reversals. - Check reversal status through
POST /api/status/order_id; compare accumulatedreversal_amountwithactual_amount. - For details, load
references/reversal.md.
Captures
Use capture to charge funds previously held by a card preauthorization.
- Create the original payment with
preauth=Y. - Capture with
POST /api/capture/order_id. - Card payments support preauth/capture; other payment methods use one-stage charge behavior.
- Multiple captures are not allowed. A single full or partial capture is available.
- Check capture status through
POST /api/status/order_id; parseadditional_info.capture_statusandadditional_info.capture_amount. - For details, load
references/capture.md.
Subscriptions
Use subscriptions for fixed scheduled charges such as daily, weekly, monthly, or yearly billing.
- Create subscription checkout by adding
subscription=Yandrecurring_datato/api/checkout/redirect,/api/checkout/token, or/api/checkout/url. - Do not use subscriptions with Payment (direct) integration or Open Banking.
- Supported methods are Visa/MasterCard/Amex cards, Apple Pay, and Google Pay.
- Start or stop an existing subscription with
POST /api/subscriptionandaction=startoraction=stop. - For details, load
references/subscriptions.md.
Additional Data
Use reservation_data when the merchant needs to attach extra payer, device, checkout-field, or product/fiscalisation metadata to a purchase request.
reservation_datais BASE64-encoded JSON attached to create-purchase requests.- Keep keys and values ASCII/Latin-alphanumeric plus separator symbols as documented.
- Use it for customer metadata,
fields_custom[],products[],settlement_id, and risk/fiscalisation-related extras. - Be careful with
3ds_mandatory: the docs say it can be used only after approval from the Flitt risk team. - For details, load
references/additional-data.md.
Currencies
Use the currency matrix before wiring or validating the Flitt currency field.
- Supported bank-card processing currencies depend on merchant country.
- Do not assume
USDorEURare available for every merchant geography. - For details, load
references/currencies.md.
Callbacks
Use Flitt callbacks as the reliable asynchronous status source for payments and follow-up operations.
- Flitt sends JSON
POSTcallbacks toserver_callback_url. - Treat the callback as successfully processed only when your endpoint returns HTTP
200 OK. - Flitt does not follow redirects, so callback endpoints must respond directly.
- Verify callback signatures before trusting payment state, and process callbacks idempotently by
order_idand/orpayment_id. - For details, load
references/callbacks.md.
Signatures
Use the dedicated signature reference when implementing or debugging request, response, callback, or redirect signature handling.
- Flitt signs request and response data with SHA1 over
secret|sorted-nonempty-values. - Exclude
signatureand, for verification,response_signature_string. - Keep SHA1 hex lowercase.
- Be especially careful with zero values, empty values, UTF-8 encoding, and endpoint-specific parameter sets such as
/api/recurring. - For details, load
references/signature.md.
Response Codes
Use the response-code reference when deciding whether a failure is caused by merchant input, issuer decline, or Flitt/platform configuration.
- API
response_codevalues and embedded-checkout JavaScript codes have different ranges and meanings. - Many codes are operationally actionable only after you classify ownership: merchant, issuer bank, or Flitt.
- For details, load
references/response-codes.md.
Troubleshooting
When Flitt returns Invalid signature:
- Confirm the secret key belongs to the same merchant and environment.
- Log the exact pre-hash signature string locally, redacting the secret in shared logs.
- Ensure empty values are omitted completely, including their
|separator. - Ensure numeric zero is preserved as
0, not converted to empty or null. - Ensure
signatureandresponse_signature_stringare excluded. - Ensure non-Latin text is sent and hashed as UTF-8.
- Ensure the final SHA1 hex digest is lowercase.
When testing callbacks or redirects in test mode, Flitt may return response_signature_string; use it only as a diagnostic hint and never include it in verification.