Sync Transactions
curl --request POST \
--url https://development.knotapi.com/transactions/sync \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": 45,
"external_user_id": "abc",
"cursor": "eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"limit": 100
}
'import requests
url = "https://development.knotapi.com/transactions/sync"
payload = {
"merchant_id": 45,
"external_user_id": "abc",
"cursor": "eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"limit": 100
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchant_id: 45,
external_user_id: 'abc',
cursor: 'eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0',
limit: 100
})
};
fetch('https://development.knotapi.com/transactions/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://development.knotapi.com/transactions/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchant_id' => 45,
'external_user_id' => 'abc',
'cursor' => 'eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0',
'limit' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://development.knotapi.com/transactions/sync"
payload := strings.NewReader("{\n \"merchant_id\": 45,\n \"external_user_id\": \"abc\",\n \"cursor\": \"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0\",\n \"limit\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://development.knotapi.com/transactions/sync")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": 45,\n \"external_user_id\": \"abc\",\n \"cursor\": \"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0\",\n \"limit\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://development.knotapi.com/transactions/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_id\": 45,\n \"external_user_id\": \"abc\",\n \"cursor\": \"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0\",\n \"limit\": 100\n}"
response = http.request(request)
puts response.read_body{
"merchant": {
"id": 45,
"name": "Walmart"
},
"transactions": [
{
"id": "13da3c28-a068-4642-9ce2-b730cfda5f5f",
"external_id": "a9x7bq2lmw5p",
"datetime": "2024-11-10T00:00:00+00:00",
"url": "https://www.example.com/orders/123123123",
"order_status": "COMPLETED",
"shipping": {
"location": {
"address": {
"line1": "123 Main St",
"line2": "Floor 4",
"city": "Los Angeles",
"region": "CA",
"postal_code": "94105",
"country": "US"
},
"first_name": "Ada",
"last_name": "Lovelace"
}
},
"payment_methods": [
{
"external_id": "x7q9m2lbw5pazc",
"type": "CARD",
"brand": "VISA",
"last_four": "5690",
"name": "Ada's credit card",
"transaction_amount": "23.20"
},
{
"external_id": "x7q9m2lbw5pazc",
"type": "GIFT_CARD",
"brand": "VISA",
"last_four": "1802",
"name": "",
"transaction_amount": "20.00"
}
],
"price": {
"sub_total": "43.69",
"adjustments": [
{
"type": "TAX",
"label": "NYC local sales tax",
"amount": "3.88"
},
{
"type": "DISCOUNT",
"label": "Summer promo",
"amount": "-4.37"
}
],
"total": "43.20",
"currency": "USD"
},
"products": [
{
"external_id": "10315643",
"gtin": "00381370044536",
"name": "Band-Aid Adhesive Bandages Variety Pack",
"description": "A convenient assortment of durable adhesive bandages designed to protect minor cuts and scrapes. Featuring a range of sizes for everyday first-aid needs, each bandage cushions the wound while helping keep out dirt and germs. Made to stay securely in place with a gentle adhesive, this variety pack is ideal for home, travel, school, or on-the-go care.",
"category": "CATEGORY1",
"url": "https://www.example.com/ip/10315643",
"image_url": "https://storage.googleapis.com/txn-product-images/doordash/33972462636.jpg",
"quantity": 1,
"price": {
"sub_total": "12.56",
"total": "12.56",
"unit_price": "12.56"
},
"seller": null,
"eligibility": [
"FSA/HSA"
]
},
{
"external_id": "1031891",
"gtin": "00078731878120",
"name": "Dixie Ultra 8-12 Paper Plate, 240-count",
"description": "",
"category": "CATEGORY2",
"url": "https://www.example.com/ip/1031891",
"image_url": "https://storage.googleapis.com/txn-product-images/doordash/33972462636.jpg",
"quantity": 1,
"price": {
"sub_total": "8.14",
"total": "8.14",
"unit_price": "8.14"
},
"seller": null,
"eligibility": []
},
{
"external_id": "1038973",
"gtin": "00651277430015",
"name": "4Pairs Men's Elite Sports Socks Athletic Crew Socks Mid-calf Boys for Football, Basketball, Running Soccer",
"description": "High-performance athletic crew socks designed for comfort, support, and durability during intense activity. Made with breathable, moisture-wicking fabric to help keep feet dry, with reinforced heels and toes for added strength.",
"category": "CATEGORY3",
"url": "https://www.example.com/ip/1038973",
"image_url": "https://storage.googleapis.com/txn-product-images/doordash/33972462636.jpg",
"quantity": 1,
"price": {
"sub_total": "22.99",
"total": "22.99",
"unit_price": "22.99"
},
"seller": {
"name": "KingCamp Outdoor Products Co., Ltd.",
"url": "https://www.example.com/browse/kingcamp/YnJhbmQ6S2luZ0NhbXAie"
},
"eligibility": []
}
],
"loyalty_membership": {
"tier": "Walmart+ Assist"
}
}
],
"next_cursor": "<string>",
"limit": 5
}TransactionLink
Sync Transactions
Sync a user’s transactions for a merchant account using cursor-based pagination.
POST
/
transactions
/
sync
Sync Transactions
curl --request POST \
--url https://development.knotapi.com/transactions/sync \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": 45,
"external_user_id": "abc",
"cursor": "eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"limit": 100
}
'import requests
url = "https://development.knotapi.com/transactions/sync"
payload = {
"merchant_id": 45,
"external_user_id": "abc",
"cursor": "eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"limit": 100
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchant_id: 45,
external_user_id: 'abc',
cursor: 'eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0',
limit: 100
})
};
fetch('https://development.knotapi.com/transactions/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://development.knotapi.com/transactions/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchant_id' => 45,
'external_user_id' => 'abc',
'cursor' => 'eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0',
'limit' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://development.knotapi.com/transactions/sync"
payload := strings.NewReader("{\n \"merchant_id\": 45,\n \"external_user_id\": \"abc\",\n \"cursor\": \"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0\",\n \"limit\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://development.knotapi.com/transactions/sync")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": 45,\n \"external_user_id\": \"abc\",\n \"cursor\": \"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0\",\n \"limit\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://development.knotapi.com/transactions/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_id\": 45,\n \"external_user_id\": \"abc\",\n \"cursor\": \"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0\",\n \"limit\": 100\n}"
response = http.request(request)
puts response.read_body{
"merchant": {
"id": 45,
"name": "Walmart"
},
"transactions": [
{
"id": "13da3c28-a068-4642-9ce2-b730cfda5f5f",
"external_id": "a9x7bq2lmw5p",
"datetime": "2024-11-10T00:00:00+00:00",
"url": "https://www.example.com/orders/123123123",
"order_status": "COMPLETED",
"shipping": {
"location": {
"address": {
"line1": "123 Main St",
"line2": "Floor 4",
"city": "Los Angeles",
"region": "CA",
"postal_code": "94105",
"country": "US"
},
"first_name": "Ada",
"last_name": "Lovelace"
}
},
"payment_methods": [
{
"external_id": "x7q9m2lbw5pazc",
"type": "CARD",
"brand": "VISA",
"last_four": "5690",
"name": "Ada's credit card",
"transaction_amount": "23.20"
},
{
"external_id": "x7q9m2lbw5pazc",
"type": "GIFT_CARD",
"brand": "VISA",
"last_four": "1802",
"name": "",
"transaction_amount": "20.00"
}
],
"price": {
"sub_total": "43.69",
"adjustments": [
{
"type": "TAX",
"label": "NYC local sales tax",
"amount": "3.88"
},
{
"type": "DISCOUNT",
"label": "Summer promo",
"amount": "-4.37"
}
],
"total": "43.20",
"currency": "USD"
},
"products": [
{
"external_id": "10315643",
"gtin": "00381370044536",
"name": "Band-Aid Adhesive Bandages Variety Pack",
"description": "A convenient assortment of durable adhesive bandages designed to protect minor cuts and scrapes. Featuring a range of sizes for everyday first-aid needs, each bandage cushions the wound while helping keep out dirt and germs. Made to stay securely in place with a gentle adhesive, this variety pack is ideal for home, travel, school, or on-the-go care.",
"category": "CATEGORY1",
"url": "https://www.example.com/ip/10315643",
"image_url": "https://storage.googleapis.com/txn-product-images/doordash/33972462636.jpg",
"quantity": 1,
"price": {
"sub_total": "12.56",
"total": "12.56",
"unit_price": "12.56"
},
"seller": null,
"eligibility": [
"FSA/HSA"
]
},
{
"external_id": "1031891",
"gtin": "00078731878120",
"name": "Dixie Ultra 8-12 Paper Plate, 240-count",
"description": "",
"category": "CATEGORY2",
"url": "https://www.example.com/ip/1031891",
"image_url": "https://storage.googleapis.com/txn-product-images/doordash/33972462636.jpg",
"quantity": 1,
"price": {
"sub_total": "8.14",
"total": "8.14",
"unit_price": "8.14"
},
"seller": null,
"eligibility": []
},
{
"external_id": "1038973",
"gtin": "00651277430015",
"name": "4Pairs Men's Elite Sports Socks Athletic Crew Socks Mid-calf Boys for Football, Basketball, Running Soccer",
"description": "High-performance athletic crew socks designed for comfort, support, and durability during intense activity. Made with breathable, moisture-wicking fabric to help keep feet dry, with reinforced heels and toes for added strength.",
"category": "CATEGORY3",
"url": "https://www.example.com/ip/1038973",
"image_url": "https://storage.googleapis.com/txn-product-images/doordash/33972462636.jpg",
"quantity": 1,
"price": {
"sub_total": "22.99",
"total": "22.99",
"unit_price": "22.99"
},
"seller": {
"name": "KingCamp Outdoor Products Co., Ltd.",
"url": "https://www.example.com/browse/kingcamp/YnJhbmQ6S2luZ0NhbXAie"
},
"eligibility": []
}
],
"loyalty_membership": {
"tier": "Walmart+ Assist"
}
}
],
"next_cursor": "<string>",
"limit": 5
}Authorizations
Body
application/json
The input parameters required for syncing transactions.
Cursor token pointing to the last transaction retrieved. The /transactions/sync endpoint uses cursor-based pagination to track which transactions have already been seen, minimizing data redundancy.
On the first call, the endpoint returns all transactions paginated. In subsequent calls, only new transactions are provided using the next cursor.
Example:
"eyJpZCI6MjI3ODEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0"
Was this page helpful?