Skip to main content
With a checkout link, you can create a pre-configured cart for a product and send it to your customers. The customer can then go directly to checkout and complete the purchase.
1

Select Product

Select the product in your product catalog, create a price if not already done, and click the “Create Checkout Link” button.
2

Set Up After Order Completion

Under “After Completion”, select one of the options to determine what happens after the purchase.
Set up after order completion
  • Default Confirmation Page: The customer is redirected to the default confirmation page and receives an overview of their order and the associated invoice.
  • Custom Redirect: The customer is redirected to a URL you specify.
  • Custom Confirmation Message: The customer is redirected to the default confirmation page and is shown a confirmation message you specify.
When using a custom redirect, you can add placeholders to the URL that will be replaced with URL parameters. More details can be found under Adding Metadata.
Show Back to Provider Button: Enable this option if you want the customer to see a button to return to your provider on the default confirmation page after the purchase.

Allow Discount Codes

Under “More Options”, you can specify whether the customer can enter a discount code. Enable this option if you want the customer to be able to enter a discount code. Otherwise, the field will be hidden.

Set Trial Period

Under “More Options”, you can specify for recurring products whether a trial period should apply to the product. Enable this option if you want the customer to be able to try the product before purchasing. The amount is not due until the trial period expires.
If the trial period is excluded in the price via Allow Trial Period, this option is ignored.

Set Terms

Under “More Options”, you can specify for recurring products which contract & cancellation periods apply to the product. The terms are then transferred to the subscription. For one-time products, this option is irrelevant.
If you do not set any terms, the billing period is used as the contract term and 1 day as the cancellation period.

Require Company Information

Under “More Options”, you can specify whether the customer is required to provide company information. This way you can ensure that you only sell to companies. To do this, enable the “Require Company Information” option.

Make Quantity Changeable

Under “More Options”, you can specify whether the customer can subsequently change the quantity of the product in the cart. Enable this option by checking the “Quantity Changeable” checkbox. This means a product cannot be removed from the cart, only the quantity can be changed.

Adding Metadata

You can attach metadata to the checkout link to pass additional information. This metadata is:
  • appended as redirect parameters to the custom redirect
  • replaced as placeholders in the custom redirect
  • passed in the webhook as the metadata field

Attaching Metadata

To attach metadata to the checkout link, add it as URL parameters, e.g., https://fynn.coreapi.io/checkout-link/xxxxxxxx?metadata[key]=value&metadata[key2]=value2. It is also possible to pass a multidimensional array by enclosing the key in square brackets, e.g., metadata[key][subkey]=value.

Placeholders in the Custom Redirect

You can use placeholders in the custom redirect that are replaced by metadata. To use a specified metadata in the custom redirect, add it in curly braces, e.g., {{metadataKey}}.
If you operate a multi-tenant application and want to redirect to a custom URL of the tenant upon redirect, you can attach the tenant ID as metadata to the checkout link and use it as a placeholder in the custom redirect.Example URL: https://{{tenantId}}.example.com/checkout-successExample Checkout URL: https://fynn.coreapi.io/checkout-link/xxxxxx?metadata[tenantId]=acmegmbh

Webhooks

The metadata is passed in the webhook as the metadata field.

Create Checkout Session

By default, a new checkout session is created when using the checkout link. However, it may be useful to create only one checkout session if you:
  • want to bundle multiple products in one cart
  • want to use the checkout link multiple times
To create a checkout session, add the parameter session=true, e.g., https://my-tenant.coreapi.io/checkout-link/xxxxxxxx?session=true.
If a checkout session has been created and a checkout link is called without session=true, a one-time independent checkout session is created.
The checkout session is valid for 24 hours. After this time, the cart is cleared.

Retrieve Checkout Session

To retrieve the checkout session without adding another product, call the following API route: https://[tenant-username].coreapi.io/public/checkout/cart/current. Replace [tenant-username] with your tenant name. You will then be redirected to the current checkout session.

Prefill Buyer Data

If the buyer is not yet a customer in Fynn, you can prefill the e-mail address, first name and last name in the checkout form. The e-mail field and the first and last name of the invoice address are prefilled. The buyer can change the values. Address and payment method are requested as usual.
Use prefill when you do not want to create the customer up front. If you create the customer via POST /customers beforehand, the checkout treats the customer’s address as already present.

Via the API

Pass the customerPrefill object when creating the cart. All three fields are optional. The endpoint requires the cart:write permission.
The response contains cartId, customerId and url. Redirect the buyer to the url. Append the values as prefill[...] URL parameters, e.g., https://fynn.coreapi.io/checkout-link/xxxxxxxx?prefill[email]=customer%40example.com&prefill[firstName]=Erika&prefill[lastName]=Mustermann. URL-encode the values. The parameters can be combined with metadata[...] and session=true.

Rules

  • If the prefilled e-mail address already belongs to a customer, the checkout offers the one-time code login as soon as the buyer interacts with the form.
  • If customerId is passed as well, customerPrefill is ignored. The customer’s stored data is used.
  • An invalid e-mail address in the API call returns a 422. In the checkout link, an invalid value is ignored.
  • With session=true, an existing cart that already has a customer, e-mail address, or an already-set prefill keeps its data. If the buyer follows another checkout link in the same session, that prefill is not overwritten.