Create API access in Magento 2

  1. Log in to the admin environment of your Magento 2 webshop.
  2. Go to Stores → Configuration → Services → OAuth → Consumer Settings and set Allow OAuth Access Tokens to be used as standalone Bearer tokens to Yes. This is required from Magento 2.4.4 onwards. Clear the cache afterwards.
  3. Go to System → Extensions → Integrations and click Add New Integration. Name the integration Xendy and enter your admin password.
  4. Select API on the left, set Resource Access to Custom and check Customers, Sales and Catalog. Click Save.
  5. Click Activate on the integration and then click Allow. Copy the Access Token.

Connect Magento 2 in Xendy

  1. In Xendy, go to Settings → Webshop and select Magento 2 under Choose your platform.
  2. Enter the Webshop URL and paste the Access token.
  3. If Xendy finds multiple stores, select the store you want to use under Choose a store.
  4. Click Link Magento 2. Xendy immediately starts the first import. You can track the progress in the bottom left of the dashboard.

How often is data fetched?

Xendy fetches your Magento data once a day at night, along with the abandoned carts from the past 24 hours. Don't want to wait? Go to Settings → Web shop, click the three dots next to your connection, and select Sync now. If this fails, you will automatically receive a notification by email.

Send extra fields from Magento 2 to Xendy

In addition to the standard synchronization, you can also send custom fields, such as a VIP status, loyalty points, or a training date.

How does it work?

  • For customers: fields in the extension_attributes of a customer with a name that starts with xendy_, for example xendy_vip_status, are saved by Xendy in the contact profile. Custom customer attributes (custom_attributes) are also adopted by Xendy, except for attributes containing payment details.
  • For orders: xendy_ attributes from an order line are added to the order, not to the contact.

Where can you use the fields?

  • In the filter rules of dynamic segments, so you can create lists based on this data.
  • In the email editor: type @ and select the field, for example xendy_vip_status. In your email it will appear as {xendy_vip_status}.

Examples:

  • Segment customers based on loyalty points.
  • Send reminder emails based on a training date.
  • Personalize emails with: "Thank you for your order, {xendy_bedrijfsnaam}!"

Frequently asked questions

Yep! With Magento 2 data you can create dynamic segments in Xendy. You can filter on:

  • The number of purchases a customer has made.
  • The total order value.
  • How long ago someone last placed an order.
  • Specific products or product categories that have or haven't been purchased.

This makes it easy to target recent buyers, loyal customers with a high order value, or customers who haven't been active in a while.

Check these points:

  • Is Allow OAuth Access Tokens to be used as standalone Bearer tokens set to Yes? If so, clear the cache in Magento.
  • Is the integration activated? If not, click Activate or Reauthorize.
  • Is the URL of your webshop correct?
Joeri Ras

Written by

Joeri Ras

Founder & co-owner @ Xendy

Prefer to talk directly?

Related articles