Zum Hauptinhalt springen

Payments


Overview

When a user clicks the "Pay with Fliz Pay" button on your website, your system should initiate an API call to the Fliz endpoint https://api.flizpay.de/transactions. This call generates a redirect URL that leads to the Fliz checkout page. The contents of this URL will vary depending on the user's device:

  • For desktop users, the URL will contain a QR code. This QR code will encode the order information, which our app will then use to process the transaction.
  • For mobile users, the URL will include a deep link containing all the necessary information to redirect the user to the Fliz app.

Your website should display this URL within an iframe, allowing Fliz to handle the transaction process. Once the payment is complete on our end, the user will be redirected back to your specified success or failure page, depending on the outcome of the transaction.

Additionally, your server will receive a notification through our webhook, indicating whether the transaction succeeded or failed.

Making the API Call

Assuming you have the necessary API key, you can proceed to make the API call. Here's an example using curl:

curl --request POST \
--url https://api.flizpay.de/transactions \
--header 'X-API-key: YOUR_API_KEY' \
--header 'X-Client-Type: YOUR_CLIENT_TYPE' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"amount": 10000,
"currency": "EUR",
"externalId": "order101",
"successUrl": "https://shop.com/success",
"failureUrl": "https://shop.com/failure",
"metadata": { "internalCustomerId": "customer_10456" }
}'

Headers

HeaderDescriptionExample
X-API-KEYThe API key to authenticate935b978d2ye195459dmba139053e38e0k096ef729e14326796e293412f69ab05

Body params

ParameterTypeRequiredDescriptionExample
amountintegerYesThe cart total10000
currencystringYesThe currency of the amount fieldEUR
externalIdstringYesYour unique reference for the current cartorder101
successUrluriNoYour store URL for fliz to redirect to if payment is successfullyourshop․com/success?transactionReference=abcderfkrke
failureUrluriNoYour store URL for fliz to redirect to if payment is failsyourshop.com/failure
metadataobjectNoAny key-value pair you wish to store with a Fliz transaction"internalCustomerId": "customer_10456"

Response

FieldDescriptionExample
redirectUrlThe Fliz checkout Url, it contains query parameter reference which points to your transactioncheckout.flizpay.de/reference=2aeea37eba1d127b1c03bdce7f8fecaf

Response and Redirect

After successfully submitting a payment request to Fliz, the following steps occur:

  1. Fliz creates a new transaction object in our database. This object contains all the details of your transaction and is assigned a status of "pending". The transaction is linked to your unique internal accountId for reference.
  2. Fliz generates a redirect URL associated with this newly created pending transaction. This URL is our checkout page with the transaction reference as query parameter.
  3. You should open the provided redirect URL within an iframe on your website. This allows your customer to view and complete the payment process securely through Fliz's interface, without leaving your site.

Completing the payment

Once the customer reaches the Fliz checkout page, they will be asked to authorize the payment with their bank on our app. After the payment process is completed, the user will be redirected to one of two possible URLs provided by your store depending on the outcome:

  • successUrl: If the payment is successfully processed.
  • failuerUrl: If the payment fails for any reason.

Both the success and failure URLs will include the following data as query parameters:

FieldTypeDescription
externalIdstringThe id that you provided when creating the transaction.

Regardless of the payment outcome, Fliz will also send a POST request to the callback URL specified in your Fliz Dashboard. This request will inform your server about the payment status.

You should update the state of your order based on this request. For more detailed information on this process, please refer to the Webhooks section on the next page.