Make API call via MCP
curl --request POST \
--url https://api.interchange.io/mcp/v2/storefront/api-call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'mcp-session-id: <mcp-session-id>' \
--data '
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api_call",
"arguments": {
"method": "GET",
"path": "/inventory-sources",
"query": {
"take": 10
}
}
}
}
'import requests
url = "https://api.interchange.io/mcp/v2/storefront/api-call"
payload = {
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api_call",
"arguments": {
"method": "GET",
"path": "/inventory-sources",
"query": { "take": 10 }
}
}
}
headers = {
"mcp-session-id": "<mcp-session-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'mcp-session-id': '<mcp-session-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 2,
method: 'tools/call',
params: {
name: 'api_call',
arguments: {method: 'GET', path: '/inventory-sources', query: {take: 10}}
}
})
};
fetch('https://api.interchange.io/mcp/v2/storefront/api-call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
}MCP
Make API call via MCP
Make REST API calls to any Storefront API endpoint through MCP.
Parameters
method: HTTP method (GET, POST, PUT, DELETE)path: API path (e.g., “/inventory-sources”, “/campaigns/”)body: Request body for POST/PUT requests (optional)query: Query parameters (optional)
Example: List Storefronts
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api_call",
"arguments": {
"method": "GET",
"path": "/inventory-sources",
"query": { "take": 10 }
}
}
}
Example Response
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{
"type": "text",
"text": "{ \"inventory-sources\": [...], \"total\": 5 }"
}
]
}
}
POST
/
api-call
Make API call via MCP
curl --request POST \
--url https://api.interchange.io/mcp/v2/storefront/api-call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'mcp-session-id: <mcp-session-id>' \
--data '
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api_call",
"arguments": {
"method": "GET",
"path": "/inventory-sources",
"query": {
"take": 10
}
}
}
}
'import requests
url = "https://api.interchange.io/mcp/v2/storefront/api-call"
payload = {
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api_call",
"arguments": {
"method": "GET",
"path": "/inventory-sources",
"query": { "take": 10 }
}
}
}
headers = {
"mcp-session-id": "<mcp-session-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'mcp-session-id': '<mcp-session-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 2,
method: 'tools/call',
params: {
name: 'api_call',
arguments: {method: 'GET', path: '/inventory-sources', query: {take: 10}}
}
})
};
fetch('https://api.interchange.io/mcp/v2/storefront/api-call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
}Authorizations
API key or access token
Headers
MCP session identifier from the initialize call.
Body
application/json