With Connectif, you can record purchases your customers make in your physical stores to register them in their contact profile and have a unified history of their online and offline actions. This way, you can use that information to personalize your strategies using the complete purchase history of each customer, regardless of the channel where the purchases were made.
In this article, you will learn how to integrate in-store purchases via the Connectif API so they are recorded in each contact's profile.
Before You Start
To perform this integration, you should have the following aspects covered:
- Email as primary key: The contact must exist in your Connectif Contacts database with an associated email as the primary key. Although the API supports other identifiers (such as ID number or phone), using them as the main identifier would cause duplicate contacts to be created.
- Catalog and products synchronized: All products included in the offline purchase must exist in your Connectif catalog. If an item is sold exclusively in physical stores and is not part of the website, you must create it in Connectif with the status Discontinued to be able to link the offline sale.
- Product information: It is recommended to send complete information about the products included in the purchase, especially the categories attribute. This will allow you to create product segments and use that information in your automated strategies.
- Strict request structure: The request can only include attributes supported by the API model. It is not possible to send custom fields or additional attributes within the JSON.
STEP 1. Preparing Contacts in Connectif
(This section explains how to prepare your contacts in Connectif so they can be properly linked to the offline purchase).
When registering an offline purchase via the API, Connectif will associate the sent information with existing contacts and products. The API will not create them during the process, so you must verify beforehand that they exist in Connectif.
1. Verify that the contact already exists in Connectif with their email registered. If it does not exist, create it beforehand to properly link the activity.
2. In the search bar, enter the contact's email to check its existence. If the contact does not exist, you will need to create it to associate the purchase with their history.
STEP 2. Preparing Products in Connectif
(This section explains how to prepare your products in Connectif so they can be properly linked to the offline purchase).
3. Go to "E-commerce > Catalog" and click on the options button .
4. If any of the items associated with the offline purchase do not exist in Connectif, create them before importing the purchase by doing the following:
-
Click on Create product.
-
Fill in at least the required product fields (name, ID, Detail URL, and price).
- If the product is sold only in physical stores, assign it the status Discontinued so the offline purchase can be recorded but the product does not appear in the online store.
STEP 3. Creating the API Key
5. Go to Store Settings in the left sidebar menu of Connectif.
6. In the tab selector, go to "API & IP Access" and click on API Keys.
7. Click the button Create new API Key.
8. In the Purchases section of the creation panel, enable permissions for Read, Write, and Delete in bulk.
9. Save the API key and copy it to use later in your automation script.
STEP 4. Registering the Purchase via API
(This section explains how to prepare sending the purchase information to Connectif via API).
10. Create the automation script from your system and include the API Key generated in the previous step.
11. Configure in the script an HTTP POST request to register the purchase in Connectif: https://api.connectif.cloud/purchases/
In the request, specify:
- The API Key to authenticate the call.
- The content type application/json.
- The purchase information in the request body.
12. Create the purchase information to send and verify that it meets the following conditions:
- Include the required purchase attributes: cartId, products, purchaseDate, purchaseId, totalPrice, and totalQuantity.
- Identify the contact using contactEmail.
- For each product included in products, complete the required attributes: name, price, productDetailUrl, productId, quantity, and unitPrice.
- To register the purchase as coming from a physical store, set sourceType with the value point-of-sale and indicate the store or branch in sourceName.
- Make sure purchaseId is the unique identifier for the purchase.
Example
Once created, the request will look similar to this:
const apiKey = "YOUR_API_KEY";
const url = "https://api.connectif.cloud/purchases/";
const purchase = {
contactEmail: "customer@example.com",
purchaseId: "POS-20260804-001",
cartId: "POS-20260804-001",
purchaseDate: "2026-08-04T15:30:00Z",
sourceType: "point-of-sale",
sourceName: "Downtown Store",
products: [
{
productId: "SKU-12345",
name: "Running Shoe",
categories: ["Footwear/Running"],
quantity: 2,
unitPrice: 39.95,
price: 79.90,
productDetailUrl: "https://www.mydomain.com/products/SKU-12345"
}
],
totalQuantity: 2,
totalPrice: 79.90
};
async function main() {
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `apiKey ${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify(purchase)
});
const result = await response.json();
console.log(result);
}
main();
Keep Learning!
To take full advantage of your Connectif account, we recommend continuing with the following articles:
- API Integrations, to manage events such as purchase registrations or contact sign-ups.
- Custom Integration to Send Data from Connectif, to send real-time information via Webhooks.
- Contact Import, to manually import contacts into Connectif.
- Export Contacts and Activities, to export contacts and events from Connectif.