MCP tools reference

This article describes the tools of the Post Affiliate Pro MCP server, including the parameters each tool accepts and the fields it returns. For connecting an AI tool to your account, see MCP integration for merchants.

You do not have to call the tools yourself — your AI tool chooses them based on your questions and requests. This reference helps you understand what an AI tool can and cannot do in your account, and why it asks for certain information.

An AI tool sees only the tools allowed by the access you granted. With read-only access, tools that make changes are not offered. Each tool below lists the access it requires: read tools need the …:read access and write tools the …:write access of the respective area. Your merchant role's privileges apply as well.

Every tool returns a JSON object. When a call fails or is not allowed, the tool returns an error message instead, e.g. Tool 'create_affiliate' requires scope(s) affiliates:write which the used credentials do not grant.

Note: Amounts are in the account currency and dates use the YYYY-MM-DD format.

Paging through results

Tools that return lists return one page of results at a time, 30 rows by default and at most 100 rows with the per_page parameter.

  • search_affiliates, search_transactions, search_clicks and top_affiliates_report return the rows in items and a next_cursor. To get the next page, pass the next_cursor as cursor. The last page is followed by a page with no items.
  • list_campaigns and list_banners return the rows in data and the paging information in pagination. To get the next page, pass pagination.last_id and pagination.last_value as last_id and last_value.

Read-only tools

These tools look up data in your account without changing anything.

Who am I (whoami)

Returns the account and the merchant the connection acts as, the account currency and time zone, and whether the connection may make changes. AI tools usually call it first. It is always available, regardless of the granted access.

Parameters

None.

Returns

FieldDescription
accountname, account_id, currency, timezone and date_format of the account.
userid, username, email, first_name, last_name and role of the merchant.
accesscan_read, can_write and the list of granted scopes.

Describe signup fields (describe_signup_fields)

Lists the fields of the affiliate signup and profile form, including the custom data1–data25 fields with their meaning. AI tools call it before creating or updating affiliates, or before working with custom fields. Disabled fields are not listed.

Required access: affiliates:read

Parameters

None.

Returns

FieldDescription
fieldsList of form fields. Each has a code (e.g. refid, data1), label, type, required flag, description and the allowed choices of list, radio and checkbox group fields. The refid entry also contains the referral ID rules (format, numeric_only, min_length, max_length) when they are enforced.

Get account settings (get_account_settings)

Returns the account settings: currency and number and date formatting, program name and version, server time and time zone, logos and the names of tracking URL parameters.

Required access: settings:read

Parameters

None.

Returns

FieldDescription
applicationProgram name, version, currency, currency symbol and formatting, date and time format and default language.
serverCurrent time, time zone and maintenance mode flag.
designLogo URLs.
trackingTracking script settings and the names of the URL parameters used for affiliate, banner, campaign, data1, data2 and destination URL.
generated_atTime the response was generated.

Search affiliates (search_affiliates)

Lists or searches affiliates. All filters are optional and are combined.

Required access: affiliates:read

Parameters

ParameterRequiredDescription
searchNoFree-text search over affiliate name, email and username.
statusNoReturn only affiliates in the selected statuses: approved, pending or declined. Several statuses can be combined.
sortNoField to sort by, e.g. created_at, last_name or approved_at. Prefix it with - for descending order, e.g. -created_at. By default, the oldest affiliates come first.
per_pageNoNumber of results per page, 1–100. Default is 30.
cursorNoFetch the next page: pass the next_cursor returned by the previous call. Omit for the first page.

Returns

FieldDescription
itemsThe rows of the current page, with the fields listed below.
next_cursorPass it as cursor to get the next page. A page with no items means there are no more results.
totalTotal number of matching rows. Returned on the first page only.

Each row contains id, referral_id, first_name, last_name, username, status, created_at, approved_at, parent_id, parent_first_name, parent_last_name, parent_status, notification_email, starred and the custom data fields defined in the signup form.

Get affiliate (get_affiliate)

Returns the profile of one affiliate.

Required access: affiliates:read

Parameters

ParameterRequiredDescription
affiliate_idYesID of the affiliate, as returned by search_affiliates.

Returns

FieldDescription
id, referral_id, first_name, last_name, usernameIdentification of the affiliate.
created_at, approved_atSignup and approval time.
parent_idID of the parent affiliate.
minimum_payout, payout_option_idPayout settings, when set.
last_login_at, login_count, language_code, agreed_to_termsLogin and profile details, when set.
data1 – data25Custom data fields defined in the signup form.

Search transactions (search_transactions)

Lists or searches transactions (commissions). All filters are optional and are combined. Without a period or dates, transactions from all time are searched. Refunds and chargebacks are separate transactions with negative amounts.

Required access: transactions:read

Parameters

ParameterRequiredDescription
statusNoReturn only transactions in the selected statuses: approved, pending or declined. Several statuses can be combined.
payout_statusNopaid or unpaid.
typeNoReturn only the selected transaction types: sale, action, click, recurring, cpm, cpm-click, signup, referral, refund, chargeback, extra-bonus.
affiliate_idNoOnly transactions of this affiliate, as returned by search_affiliates.
campaign_idNoOnly transactions of this campaign, as returned by list_campaigns.
banner_idNoOnly transactions of this banner, as returned by list_banners.
visitor_idNoOnly transactions of this visitor, as returned by get_transaction.
order_idNoOnly transactions with this order ID. Separate several order IDs with commas.
product_idNoOnly transactions with this product ID.
ipNoOnly transactions tracked from this IPv4 or IPv6 address.
tierNoCommission tier: 1 for direct commissions, 2 and higher for parent affiliates' commissions.
action_codeNoOnly action commissions with this action code.
min_commission, max_commissionNoCommission range in the account currency, inclusive.
min_total_cost, max_total_costNoOrder amount range in the account currency, inclusive.
periodNoPredefined creation period: today, yesterday, this_week, last_week, last_working_week, this_month, last_month, this_year, last_year, this_quarter, last_quarter, last_7_days, last_30_days, last_60_days, last_90_days. Overrides date_from and date_to.
date_from, date_toNoCreated on or after / on or before this date, in YYYY-MM-DD format. When both dates are set, the range can be at most 366 days.
approved_from, approved_toNoApproved on or after / on or before this date, in YYYY-MM-DD format.
starredNotrue returns only transactions starred in the merchant panel.
sortNoField to sort by, e.g. created_at, commission or total_cost. Prefix it with - for descending order, e.g. -created_at. By default, the oldest transactions come first.
per_pageNoNumber of results per page, 1–100. Default is 30.
cursorNoFetch the next page: pass the next_cursor returned by the previous call. Omit for the first page.

Returns

FieldDescription
itemsThe rows of the current page, with the fields listed below.
next_cursorPass it as cursor to get the next page. A page with no items means there are no more results.
totalTotal number of matching rows. Returned on the first page only.

Each row contains id, commission, total_cost, order_id, product_id, created_at, campaign_id, campaign_name, type, tier, commission_type, action_code, status, payout_status, affiliate_id, affiliate_first_name, affiliate_last_name, affiliate_status, data1–data5 and starred. Use get_transaction for the approval time, visitor, IP address and notes.

Get transaction (get_transaction)

Returns the full detail of one transaction.

Required access: transactions:read

Parameters

ParameterRequiredDescription
transaction_idYesID of the transaction, as returned by search_transactions.

Returns

FieldDescription
id, order_id, product_idIdentification of the transaction.
affiliate_id, campaign_id, banner_id, account_idRelated affiliate, campaign, banner and account.
type, status, tier, action_codeType, status, commission tier and action code.
total_cost, commissionOrder amount and commission in the account currency.
created_at, approved_atCreation and approval time.
payout_status, payout_history_idunpaid, paid or to_pay, and the payout the transaction belongs to.
visitor_id, ip, referer_url, browser, country_code, track_methodTracking details.
first_click_*, last_click_*, click_countTime, referrer, IP address and data1/data2 of the first and the last click, and the number of clicks.
parent_transaction_id, recurring_comm_idRelated original transaction and recurring commission.
data1 – data5Custom transaction fields.
merchant_noteNote visible to the affiliate.
system_noteInternal note visible to merchants only.

Diagnose order (diagnose_order)

Explains what happened to one order ID: whether the sale request was received, how it was processed, whether a commission was created, and how the affiliate, campaign and banner were recognized. If the logs do not explain it, it also checks whether the visitor was referred by an affiliate and whether the cookie had expired. Use it to answer questions like Why is there no commission for order 1234?

Required access: transactions:read

Note: Sale requests are kept for about 60 days, clicks for about 185 days by default, and the detailed event log only for a few days. Each part of the result requires the corresponding privilege of your merchant role; parts you cannot see are skipped and listed in permissions.

Parameters

ParameterRequiredDescription
order_idYesOrder ID passed to the tracking.
search_clicks_by_ipNotrue also looks up clicks by the IP address of the sale, not only by the visitor ID. Useful when the tracking cookie was lost. A shared IP address can return clicks of unrelated visitors. Default is false.

Returns

FieldDescription
foundWhether any sale request or commission exists for the order.
commission_createdWhether a commission was created.
sale_requestsUp to 20 sale requests with the time received, processing status and reason, recognition method, visitor ID, IP address and referrer.
commissionsUp to 20 commissions with the affiliate, campaign, banner, type, status, reason, recognition method and amount.
visitor_attributionAffiliates bound to the visitor, with the click time and cookie expiration.
visitor_clicksClicks of the visitor.
processing_traceUp to 200 lines of the event log describing how the sale was processed.
permissionsWhich parts of the result your role is allowed to see.

List campaigns (list_campaigns)

Lists campaigns. All filters are optional and are combined.

Required access: campaigns:read

Parameters

ParameterRequiredDescription
searchNoCampaign name contains this text (at least 3 characters).
aliasNoCampaign alias shown to affiliates contains this text (at least 3 characters).
statusNoReturn only campaigns in the selected statuses: active, paused (stopped but visible to affiliates) or stopped (invisible).
typeNoReturn only the selected campaign types: public, public_manual (joining needs approval) or private (invitation only).
is_defaultNotrue returns only the default campaign, false all others.
account_idNoOnly campaigns of this merchant account (Post Affiliate Network only).
starredNotrue returns only campaigns starred in the merchant panel.
per_pageNoNumber of results per page, 1–100. Default is 30.
last_idNoFetch the next page: pass pagination.last_id returned by the previous call.
last_valueNoFetch the next page: pass pagination.last_value returned by the previous call.

Returns

FieldDescription
dataThe rows of the current page, with the fields listed below.
paginationper_page, last_id and last_value for the next page. The first page also contains total_count, the total number of matching rows.

Each row contains id, name, alias, type, status, description, created_at, order, is_default, logo_url, product_ids, overwrite_cookie, cookie_lifetime, account_id, account_name, account_status, has_commissions, commissions_details and starred.

Get campaign (get_campaign)

Returns the detail of one campaign.

Required access: campaigns:read

Parameters

ParameterRequiredDescription
campaign_idYesID of the campaign, as returned by list_campaigns.

Returns

FieldDescription
id, name, alias, descriptionIdentification of the campaign.
type, status, is_default, orderCampaign type, status, default flag and display order.
created_atCreation time.
logo_url, product_idsLogo and product IDs, when set.
overwrite_cookie, cookie_lifetimeCookie settings.
account_id, account_statusMerchant account of the campaign.
has_commissionsWhether the campaign has commissions defined.

List banners (list_banners)

Lists banners. All filters are optional and are combined. For example, use it to find all banners that point to a given landing page.

Required access: banners:read

Parameters

ParameterRequiredDescription
campaign_idNoOnly banners of this campaign, as returned by list_campaigns.
statusNoReturn only banners in the selected statuses: active or hidden.
typeNoReturn only the selected banner types: image, text, link, html, email, coupon, pdf, site, rotator, popup, page_peel, page_peel_html, lightbox.
is_confirmedNotrue returns only confirmed banners, false only unconfirmed ones.
searchNoBanner name contains this text (at least 3 characters).
destination_urlNoLanding page URL, or its part (at least 3 characters), the banner points to.
destination_url_matchNoHow destination_url is matched: contains (default) or starts_with.
starredNotrue returns only banners starred in the merchant panel.
per_pageNoNumber of results per page, 1–100. Default is 30.
last_idNoFetch the next page: pass pagination.last_id returned by the previous call.
last_valueNoFetch the next page: pass pagination.last_value returned by the previous call.

Returns

FieldDescription
dataThe rows of the current page, with the fields listed below.
paginationper_page, last_id and last_value for the next page. The first page also contains total_count, the total number of matching rows.

Each row contains id, name, campaign_id, campaign_name, type, created_at, is_confirmed, destination_url, status, order and starred.

Get banner (get_banner)

Returns the detail of one banner.

Required access: banners:read

Parameters

ParameterRequiredDescription
banner_idYesID of the banner, as returned by list_banners.

Returns

FieldDescription
id, name, descriptionIdentification of the banner.
type, status, is_confirmed, orderBanner type, status, confirmation flag and display order.
campaign_id, campaign_nameCampaign of the banner.
destination_url, targetLanding page URL and link target.
sizeSize preset code.
created_atCreation time.
data1 – data9Banner content. The meaning depends on the banner type, e.g. image URL of an image banner or HTML code of an HTML banner.

Search clicks (search_clicks)

Lists individual clicks. All filters are optional and are combined. Without a period or dates, clicks from all time are searched. To find the clicks behind a commission, filter by the visitor_id returned by get_transaction.

Required access: transactions:read

Note: Raw clicks are kept for about 185 days by default, on some accounts for a shorter time.

Parameters

ParameterRequiredDescription
affiliate_idNoOnly clicks of this affiliate.
campaign_idNoOnly clicks in this campaign.
banner_idNoOnly clicks on this banner.
visitor_idNoOnly clicks of this visitor.
country_codeNoTwo-letter country code, e.g. US.
ipNoOnly clicks from this IPv4 or IPv6 address.
typeNoReturn only the selected click types: unique, repeated or declined.
periodNoPredefined period: today, yesterday, this_week, last_week, last_working_week, this_month, last_month, this_year, last_year, this_quarter, last_quarter, last_7_days, last_30_days, last_60_days, last_90_days. Overrides date_from and date_to.
date_from, date_toNoClicked on or after / on or before this date, in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format. When both dates are set, the range can be at most 366 days.
sortNoField to sort by, e.g. created_at. Prefix it with - for descending order. By default, the newest clicks come first.
per_pageNoNumber of results per page, 1–100. Default is 30.
cursorNoFetch the next page: pass the next_cursor returned by the previous call. Omit for the first page.

Returns

FieldDescription
itemsThe rows of the current page, with the fields listed below.
next_cursorPass it as cursor to get the next page. A page with no items means there are no more results.
totalTotal number of matching rows. Returned on the first page only.

Each row contains id, affiliate_id, campaign_id, banner_id, country_code, type, created_at, visitor_id, ip, channel_id, data1 and data2.

Traffic overview (traffic_overview)

Returns summary statistics for a period: clicks, transactions and sales by status with commission totals, affiliate count and conversion rate. Useful for questions like How are we doing this month?

Required access: stats:read

Parameters

ParameterRequiredDescription
periodNoPredefined period: today, yesterday, this_week, last_week, last_working_week, this_month, last_month, this_year, last_year, this_quarter, last_quarter, last_7_days, last_30_days, last_60_days, last_90_days. When neither a period nor dates are set, this_month is used.
period_from, period_toNoCustom period, in YYYY-MM-DD format. Ignored when period is set. When both dates are set, the range can be at most 366 days.

Returns

FieldDescription
periodThe period the statistics cover.
clicksall, unique, raw and declined clicks.
transactionsOrder amounts (totalcost), commissions and counts of all transactions, split into all, approved, pending, declined and paid.
salesThe same as transactions, for sales only.
affiliatesNumber of affiliates.
conversion_rateTransactions per 100 clicks, split by status.
generated_atTime the response was generated.

Top affiliates report (top_affiliates_report)

Returns the performance of each affiliate in a period, one row per affiliate. Transactions of every status, including declined ones, are counted unless you narrow them.

Required access: stats:read

Parameters

ParameterRequiredDescription
periodNoPredefined period: today, yesterday, this_week, last_week, last_working_week, this_month, last_month, this_year, last_year, this_quarter, last_quarter, last_7_days, last_30_days, last_60_days, last_90_days. When neither a period nor dates are set, this_month is used.
date_from, date_toNoCustom period, in YYYY-MM-DD format. When both dates are set, the range can be at most 366 days.
campaign_idNoCount only transactions and clicks of this campaign.
banner_idNoCount only transactions and clicks of this banner.
transaction_statusNoCount only transactions in the selected statuses: approved, pending or declined, e.g. approved for what is actually payable.
payout_statusNoCount only paid or only unpaid transactions.
affiliate_statusNoList only affiliates in the selected statuses: approved, pending or declined.
min_count, min_totalcost, min_commission, min_profit, min_sales_count, min_sales_commission, min_clicks_allNoList only affiliates whose value is at least this number.
sortNoColumn to rank by: affiliate_first_name, affiliate_last_name, count, totalcost, commission, profit, sales_count, sales_commission or clicks_all. Prefix it with - for descending order, e.g. -commission. By default, rows are sorted by affiliate name.
per_pageNoNumber of results per page, 1–100. Default is 30.
cursorNoFetch the next page: pass the next_cursor returned by the previous call. Omit for the first page.

Returns

FieldDescription
itemsThe rows of the current page, with the fields listed below.
next_cursorPass it as cursor to get the next page. A page with no items means there are no more results.
totalTotal number of matching rows. Returned on the first page only.

Each row contains id, affiliate_first_name, affiliate_last_name, count (number of transactions), totalcost (sum of order amounts), commission (sum of commissions), profit (order amounts minus commissions), sales_count, sales_commission and clicks_all.

Write tools

These tools change data in your account. They are available only when you grant write access, and every change is recorded in Tools > Event logs.

Create affiliate (create_affiliate)

Creates a new affiliate. The affiliate is approved or pending according to your affiliate approval settings. Signup and referral bonuses are created when your commission settings define them. Calling it again with the same username fails.

Required access: affiliates:write

Parameters

ParameterRequiredDescription
usernameYesLogin email of the affiliate.
full_nameYesFirst and last name, separated by a space, e.g. John Doe.
referral_idDependsReferral ID used in the affiliate's links. Must be unique. Required when describe_signup_fields reports it as required (default setup), and must match the format reported there.
passwordNoPassword. Generated when omitted.
notification_emailNoNotification email. Defaults to the username.
parent_idNoID of the parent affiliate.
send_notification_emailNoSend the welcome email. Default is false.
custom_fieldsNoCustom data fields, e.g. {"data3": "My Company"}. Only data1–data25 are accepted.

Returns

FieldDescription
Affiliate profileThe created affiliate, in the same format as get_affiliate.

Update affiliate (update_affiliate)

Updates the details of an affiliate. Only the parameters you pass are changed, and at least one of them must be passed. Use set_affiliate_status to change the status.

Required access: affiliates:write

Parameters

ParameterRequiredDescription
affiliate_idYesID of the affiliate, as returned by search_affiliates.
full_nameNoFirst and last name, separated by a space, e.g. John Doe.
notification_emailNoNotification email.
referral_idNoReferral ID.
parent_idNoID of the new parent affiliate.
custom_fieldsNoCustom data fields to change, e.g. {"data3": "My Company"}. An empty value clears the field.

Returns

FieldDescription
Affiliate profileThe updated affiliate, in the same format as get_affiliate.

Set affiliate status (set_affiliate_status)

Changes the status of an affiliate, e.g. approves a pending signup. It works the same way as changing the status in the merchant panel.

Required access: affiliates:write

Parameters

ParameterRequiredDescription
affiliate_idYesID of the affiliate, as returned by search_affiliates.
statusYesNew status: approved, pending or declined.
send_notification_emailNoNotify the affiliate about the status change. Default is true.

Returns

FieldDescription
idID of the affiliate.
statusNew status.
updated_atTime of the change.

Delete affiliate (delete_affiliate)

Permanently deletes an affiliate. If your account requires deletions to be confirmed by email, the deletion waits for that confirmation.

Required access: affiliates:write

Important: Deleting an affiliate cannot be undone. To stop an affiliate, set its status to declined with set_affiliate_status instead.

Parameters

ParameterRequiredDescription
affiliate_idYesID of the affiliate, as returned by search_affiliates.

Returns

FieldDescription
idID of the affiliate.
deletedtrue when the affiliate was deleted.
statuspending_confirmation when the deletion waits for email confirmation.

Create commission (create_commission)

Creates a transaction (commission) for an affiliate, like adding a transaction manually in the merchant panel. When you do not pass the commission amount, it is calculated from the campaign and commissions for the parent affiliates are created as well. When you pass the amount, only one commission with exactly that amount is created. Each call creates new transactions.

Required access: transactions:write

Parameters

ParameterRequiredDescription
affiliate_idYesID of the affiliate to credit.
typeYesTransaction type: sale, action, click, referral, signup or extra-bonus.
campaign_idDependsID of the campaign. Required together with action_code.
order_idDependsOrder ID. Required for sales and actions.
total_costDependsOrder amount in the account currency. Required for sales. Must not be negative.
commissionNoFixed commission amount. Calculated from the campaign when omitted.
action_codeNoWith type action only: code of the action commission type of the campaign. Required when the campaign has several action commission types.
product_idNoProduct ID.
statusNoInitial status: approved, pending or declined.
data1 – data5NoCustom transaction fields.

Returns

FieldDescription
TransactionThe created direct (tier 1) transaction: id, order_id, affiliate_id, campaign_id, type, status, commission, total_cost, merchant_note, data1–data5, created_at and approved_at.

Set transaction status (set_transaction_status)

Changes the status of one transaction, e.g. approves a pending commission, optionally with notes. Only the given transaction is changed; commissions of parent affiliates for the same sale keep their status. Notes are saved only when the status actually changes.

Required access: transactions:write

Parameters

ParameterRequiredDescription
transaction_idYesID of the transaction, as returned by search_transactions.
statusYesNew status: approved, pending or declined.
note_publicNoReplaces the merchant note of the transaction. The affiliate can see it.
note_internalNoAppended to the system note of the transaction. Visible to merchants only.
send_notification_emailNoNotify the affiliate about the status change. Default is false.

Returns

FieldDescription
idID of the transaction.
statusNew status.
updated_atTime of the change.

Refund order (refund_order)

Refunds all commissions of an order, including the commissions of parent affiliates. A refund transaction with negative amounts is created for each of them; the original transactions are kept. Pass the refunded amount for a partial refund — the commissions are then reduced in the same proportion. An order that is already refunded is not refunded again.

Required access: transactions:write

Important: A refund cannot be undone.

Parameters

ParameterRequiredDescription
order_idYesOrder ID of the commissions to refund.
total_costNoPartial refund: the refunded order amount in the account currency, greater than 0. Omit to refund the whole order.
product_idDependsRefund only the commissions of this product. Required together with total_cost when the order contains several products.
note_publicNoReason or reference for the refund, saved as the merchant note. The affiliate can see it.
note_internalNoAppended to the system note of the refund transaction. Visible to merchants only.
send_notification_emailNoNotify the affiliate. Default is true.

Returns

FieldDescription
messageConfirmation of the refund.
order_idOrder ID.

Chargeback order (chargeback_order)

Works the same way as refund_order, but creates chargeback transactions instead of refunds.

Required access: transactions:write

Important: A chargeback cannot be undone.

Parameters

ParameterRequiredDescription
order_idYesOrder ID of the commissions to charge back.
total_costNoPartial chargeback: the charged-back order amount in the account currency, greater than 0. Omit to charge back the whole order.
product_idDependsCharge back only the commissions of this product. Required together with total_cost when the order contains several products.
note_publicNoReason or reference for the chargeback, saved as the merchant note. The affiliate can see it.
note_internalNoAppended to the system note of the chargeback transaction. Visible to merchants only.
send_notification_emailNoNotify the affiliate. Default is true.

Returns

FieldDescription
messageConfirmation of the chargeback.
order_idOrder ID.

Create recurring commission (create_recurring_commission)

Creates a recurring commission for an existing order, e.g. for a subscription renewal. The affiliate is taken from the recurring commission of the original order. Requires the Recurring commissions feature to be enabled. Each call creates a new commission.

Required access: transactions:write

Parameters

ParameterRequiredDescription
order_idYesOrder ID of the original sale with the recurring commission.
total_costNoAmount of this recurring payment, used to calculate the commission.
currencyNoISO currency code of the payment.
new_order_idNoOrder ID of the new commission. Defaults to the original order ID.

Returns

FieldDescription
messageConfirmation that the recurring commission was created.
order_idOrder ID.

×