Use this endpoint for automatic server-side conversion tracking. Affonso will
resolve the referral, match the incentive, calculate the commission, and
create the earning when eligible.
external_event_id must be stable across retries. Reuse the exact same value
if you retry the same billing event, order, invoice, or checkout completion.
Three-letter currency code for the sale amount, such as USD or EUR. If
the sale currency differs from your team currency, Affonso converts the sale
amount and keeps the original values on the conversion.
Provider-side idempotency key for the conversion event. Use a stable unique
identifier from your system, such as an order ID, invoice ID, checkout
session ID, or payment event ID.
Optional commission status override. Valid values: pending,
pending_manual_approval, ready_for_payment, processing_payout, paid,
declined, refunded, dispute. If omitted, Affonso derives the status
from the matched incentive’s approval settings.
Currency or incentive unit for the commission. For non-monetary incentives,
this can be CREDITS, FREE_MONTHS, or POINTS. Returns null when the
transaction was recorded without creating an affiliate earning.
When a conversion is accepted but no affiliate earning is created, the
response still succeeds with commission_amount: 0,
commission_currency: null, earning_id: null,
commission_created: false, and activity_outcome: "sale_recorded".
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Affonso Docs","colors":{"primary":"#881337","light":"#881337","dark":"#881337"},"logo":{"light":"https://mintcdn.com/affonso-20c7dee8/nWO6r2CUpJ-o-z8l/logo/affonso_logo_small.png?fit=max\u0026auto=format\u0026n=nWO6r2CUpJ-o-z8l\u0026q=85\u0026s=4b239574262c42f95697481e8b29adce","dark":"https://mintcdn.com/affonso-20c7dee8/nWO6r2CUpJ-o-z8l/logo/affonso_logo_small.png?fit=max\u0026auto=format\u0026n=nWO6r2CUpJ-o-z8l\u0026q=85\u0026s=4b239574262c42f95697481e8b29adce"},"favicon":"https://mintcdn.com/affonso-20c7dee8/kkGMCXH0kqsXT8_K/favicon.ico?fit=max\u0026auto=format\u0026n=kkGMCXH0kqsXT8_K\u0026q=85\u0026s=fd253ea2af2c3136159ed21ad7b444e3","api":{"playground":{"display":"interactive"},"mdx":{"auth":{"method":"bearer"}}},"navbar":{"links":[{"href":"mailto:hello@affonso.io","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://affonso.io/app"}},"footer":{"socials":{"x":"https://x.com/useAffonso","linkedin":"https://www.linkedin.com/company/affiliate-software"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Home","icon":"home","href":"https://affonso.io"},{"anchor":"Blog","icon":"newspaper","href":"https://affonso.io/blog"},{"anchor":"Help Center","icon":"book-open-cover","href":"https://affonso.io/help"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"affonso-20c7dee8","hasAudioNarration":false,"actualSubdomain":"affonso-20c7dee8","customDomains":["docs.affonso.io"],"gitSource":{"type":"github","owner":"affonso-io","repo":"affonso-developer-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adf30b36c71dd37a9879b40","collectionId":"ec21e47c-a6b6-4523-8e61-f7e9a30dad48","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adf30b36c71dd37a9879b40"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{},"buildId":"6aedd9eaf09614e584b8380c","clientVersion":"0.0.4074","searchFilterCounts":[{"language":"default","tag":"API Reference","count":109},{"language":"default","tag":"Program Management","count":54},{"language":"default","tag":"Core Resources","count":43},{"language":"default","tag":"Program Settings","count":33},{"language":"default","tag":"MCP","count":17},{"language":"default","tag":"Campaigns","count":15},{"language":"default","tag":"Webhooks","count":11},{"language":"default","tag":"Tools","count":9},{"language":"default","tag":"Getting Started","count":8},{"language":"default","tag":"Affiliates","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api/endpoint/conversions/create","slug":"/api/endpoint/conversions/create","pageMetadata":{"title":"Create Conversion","api":"POST https://api.affonso.io/v1/conversions","description":"Create a server-side conversion and let Affonso calculate the commission automatically","href":"/api/endpoint/conversions/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a server-side conversion and let Affonso calculate the commission automatically\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,Info,ParamField,ResponseField,Warning}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsx(_components.p,{children:`Use this endpoint for automatic server-side conversion tracking. Affonso will\nresolve the referral, match the incentive, calculate the commission, and\ncreate the earning when eligible.`})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`external_event_id`}),` must be stable across retries. Reuse the exact same value\nif you retry the same billing event, order, invoice, or checkout completion.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsx(ParamField,{body:`referral_id`,type:`string`,id:`param-referral-id`,children:_jsxs(_components.p,{children:[`Affonso referral ID to credit directly. Optional if you provide\n`,_jsx(_components.code,{children:`customer_id`}),` or `,_jsx(_components.code,{children:`external_user_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`customer_id`,type:`string`,id:`param-customer-id`,children:_jsxs(_components.p,{children:[`The customer ID from your payment provider or billing system, such as a\nStripe customer ID. Optional if you provide `,_jsx(_components.code,{children:`referral_id`}),` or\n`,_jsx(_components.code,{children:`external_user_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`external_user_id`,type:`string`,id:`param-external-user-id`,children:_jsxs(_components.p,{children:[`The user ID from your own product, app, or internal system. Optional if you\nprovide `,_jsx(_components.code,{children:`referral_id`}),` or `,_jsx(_components.code,{children:`customer_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`affonso_id`,type:`string`,id:`param-affonso-id`,children:_jsxs(_components.p,{children:[`Compatibility alias for `,_jsx(_components.code,{children:`referral_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`sale_amount`,type:`number`,required:true,id:`param-sale-amount`,children:_jsx(_components.p,{children:`Total sale amount for the purchase. Must be a positive number.`})}),`\n`,_jsx(ParamField,{body:`sale_amount_currency`,type:`string`,default:`USD`,id:`param-sale-amount-currency`,children:_jsxs(_components.p,{children:[`Three-letter currency code for the sale amount, such as `,_jsx(_components.code,{children:`USD`}),` or `,_jsx(_components.code,{children:`EUR`}),`. If\nthe sale currency differs from your team currency, Affonso converts the sale\namount and keeps the original values on the conversion.`]})}),`\n`,_jsx(ParamField,{body:`product_ids`,type:`string[]`,id:`param-product-ids`,children:_jsx(_components.p,{children:`Optional product identifiers to help match product-specific incentives.`})}),`\n`,_jsx(ParamField,{body:`price_ids`,type:`string[]`,id:`param-price-ids`,children:_jsx(_components.p,{children:`Optional price identifiers to help match price-based incentives.`})}),`\n`,_jsx(ParamField,{body:`interval`,type:`string`,id:`param-interval`,children:_jsxs(_components.p,{children:[`Subscription interval for the conversion. Valid values: `,_jsx(_components.code,{children:`monthly`}),`,\n`,_jsx(_components.code,{children:`yearly`}),`.`]})}),`\n`,_jsx(ParamField,{body:`is_subscription`,type:`boolean`,id:`param-is-subscription`,children:_jsx(_components.p,{children:`Whether the conversion comes from a subscription purchase.`})}),`\n`,_jsx(ParamField,{body:`external_event_id`,type:`string`,required:true,id:`param-external-event-id`,children:_jsx(_components.p,{children:`Provider-side idempotency key for the conversion event. Use a stable unique\nidentifier from your system, such as an order ID, invoice ID, checkout\nsession ID, or payment event ID.`})}),`\n`,_jsx(ParamField,{body:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[`Optional commission status override. Valid values: `,_jsx(_components.code,{children:`pending`}),`,\n`,_jsx(_components.code,{children:`pending_manual_approval`}),`, `,_jsx(_components.code,{children:`ready_for_payment`}),`, `,_jsx(_components.code,{children:`processing_payout`}),`, `,_jsx(_components.code,{children:`paid`}),`,\n`,_jsx(_components.code,{children:`declined`}),`, `,_jsx(_components.code,{children:`refunded`}),`, `,_jsx(_components.code,{children:`dispute`}),`. If omitted, Affonso derives the status\nfrom the matched incentive’s approval settings.`]})}),`\n`,_jsx(ParamField,{body:`sales_status`,type:`string`,default:`complete`,id:`param-sales-status`,children:_jsxs(_components.p,{children:[`Purchase status. Valid values: `,_jsx(_components.code,{children:`open`}),`, `,_jsx(_components.code,{children:`complete`}),`, `,_jsx(_components.code,{children:`trialing`}),`, `,_jsx(_components.code,{children:`failed`}),`,\n`,_jsx(_components.code,{children:`refunded`}),`, `,_jsx(_components.code,{children:`partial_refunded`}),`.`]})}),`\n`,_jsx(ParamField,{body:`created_at`,type:`string`,id:`param-created-at`,children:_jsx(_components.p,{children:`Optional ISO 8601 timestamp for the conversion.`})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsx(_components.p,{children:`Optional metadata object stored on the created affiliate earning when a\ncommission is created.`})}),`\n`,_jsx(Heading,{level:`2`,id:`validation-rules`,children:`Validation Rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`At least one of `,_jsx(_components.code,{children:`referral_id`}),`, `,_jsx(_components.code,{children:`customer_id`}),`, or `,_jsx(_components.code,{children:`external_user_id`}),` is required.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`affonso_id`}),` is also accepted instead of `,_jsx(_components.code,{children:`referral_id`}),` for compatibility.`]}),`\n`,_jsxs(_components.li,{children:[`Older field-name variants continue to work for compatibility, but new integrations should standardize on `,_jsx(_components.code,{children:`referral_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`If you send more than one identifier, Affonso checks `,_jsx(_components.code,{children:`external_user_id`}),` first, then `,_jsx(_components.code,{children:`referral_id`}),`, then `,_jsx(_components.code,{children:`customer_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`interval`}),` should only be sent for subscription conversions.`]}),`\n`,_jsxs(_components.li,{children:[`Reusing the same `,_jsx(_components.code,{children:`external_event_id`}),` returns the existing conversion instead of creating a duplicate.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`The response includes the created conversion object. On a duplicate\n`,_jsx(_components.code,{children:`external_event_id`}),`, the API returns the existing conversion with HTTP `,_jsx(_components.code,{children:`200`}),`.`]}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`true`}),` for successful responses.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`The conversion object.`}),_jsxs(Expandable,{title:`Data Object Properties`,children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Unique identifier for the transaction/commission record.`})}),_jsx(ResponseField,{name:`referral_id`,type:`string`,id:`param-referral-id-1`,children:_jsx(_components.p,{children:`Referral ID credited by the conversion.`})}),_jsx(ResponseField,{name:`affiliate_id`,type:`string | null`,id:`param-affiliate-id`,children:_jsx(_components.p,{children:`Affiliate who received credit for the conversion.`})}),_jsx(ResponseField,{name:`sale_amount`,type:`number`,id:`param-sale-amount-1`,children:_jsx(_components.p,{children:`Sale amount stored on the transaction.`})}),_jsx(ResponseField,{name:`sale_amount_currency`,type:`string`,id:`param-sale-amount-currency-1`,children:_jsx(_components.p,{children:`Stored sale currency. This can be your team currency after conversion.`})}),_jsx(ResponseField,{name:`commission_amount`,type:`number`,id:`param-commission-amount`,children:_jsxs(_components.p,{children:[`Automatically calculated commission amount. Can be `,_jsx(_components.code,{children:`0`}),` if no affiliate\nearning was created.`]})}),_jsx(ResponseField,{name:`commission_currency`,type:`string | null`,id:`param-commission-currency`,children:_jsxs(_components.p,{children:[`Currency or incentive unit for the commission. For non-monetary incentives,\nthis can be `,_jsx(_components.code,{children:`CREDITS`}),`, `,_jsx(_components.code,{children:`FREE_MONTHS`}),`, or `,_jsx(_components.code,{children:`POINTS`}),`. Returns `,_jsx(_components.code,{children:`null`}),` when the\ntransaction was recorded without creating an affiliate earning.`]})}),_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status-1`,children:_jsxs(_components.p,{children:[`Commission status. If no affiliate earning was created, this field falls back\nto `,_jsx(_components.code,{children:`pending`}),`.`]})}),_jsx(ResponseField,{name:`sales_status`,type:`string`,id:`param-sales-status-1`,children:_jsx(_components.p,{children:`Purchase status.`})}),_jsx(ResponseField,{name:`hold_period_days`,type:`integer | null`,id:`param-hold-period-days`,children:_jsx(_components.p,{children:`Hold period applied to the earning, if any.`})}),_jsx(ResponseField,{name:`payment_intent_id`,type:`string | null`,id:`param-payment-intent-id`,children:_jsxs(_components.p,{children:[`Payment intent ID. This flow currently returns `,_jsx(_components.code,{children:`null`}),`.`]})}),_jsx(ResponseField,{name:`invoice_id`,type:`string | null`,id:`param-invoice-id`,children:_jsx(_components.p,{children:`Payout invoice ID if linked later.`})}),_jsx(ResponseField,{name:`earning_id`,type:`string | null`,id:`param-earning-id`,children:_jsx(_components.p,{children:`Affiliate earning ID if a commission was created.`})}),_jsx(ResponseField,{name:`earning_type`,type:`string | null`,id:`param-earning-type`,children:_jsxs(_components.p,{children:[`Earning type. Typically `,_jsx(_components.code,{children:`direct_commission`}),` when an earning exists.`]})}),_jsx(ResponseField,{name:`external_event_id`,type:`string | null`,id:`param-external-event-id-1`,children:_jsx(_components.p,{children:`The idempotency key that was used for this conversion.`})}),_jsx(ResponseField,{name:`calculation_mode`,type:`string`,id:`param-calculation-mode`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`auto`}),` for this endpoint.`]})}),_jsx(ResponseField,{name:`matched_incentive_id`,type:`string | null`,id:`param-matched-incentive-id`,children:_jsx(_components.p,{children:`Incentive ID used during commission calculation, when a match was found.`})}),_jsx(ResponseField,{name:`commission_created`,type:`boolean`,id:`param-commission-created`,children:_jsx(_components.p,{children:`Whether the conversion created an affiliate earning.`})}),_jsx(ResponseField,{name:`activity_outcome`,type:`string`,id:`param-activity-outcome`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`commission_created`}),` when an affiliate earning was created, or `,_jsx(_components.code,{children:`sale_recorded`}),` when the sale was accepted without creating one.`]})}),_jsx(ResponseField,{name:`created_at`,type:`string`,id:`param-created-at-1`,children:_jsx(_components.p,{children:`ISO 8601 timestamp for when the conversion was created.`})}),_jsx(ResponseField,{name:`updated_at`,type:`string`,id:`param-updated-at`,children:_jsx(_components.p,{children:`ISO 8601 timestamp for the last update.`})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example-request`,children:`Example Request`}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`example-response`,children:`Example Response`}),`\n`,`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`When a conversion is accepted but no affiliate earning is created, the\nresponse still succeeds with `,_jsx(_components.code,{children:`commission_amount: 0`}),`,\n`,_jsx(_components.code,{children:`commission_currency: null`}),`, `,_jsx(_components.code,{children:`earning_id: null`}),`,\n`,_jsx(_components.code,{children:`commission_created: false`}),`, and `,_jsx(_components.code,{children:`activity_outcome: \"sale_recorded\"`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Conversion","api":"POST https://api.affonso.io/v1/conversions","description":"Create a server-side conversion and let Affonso calculate the commission automatically","href":"/api/endpoint/conversions/create"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Info,ParamField,RequestExample,ResponseExample,ResponseField,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsx(_components.p,{children:`Use this endpoint for automatic server-side conversion tracking. Affonso will\nresolve the referral, match the incentive, calculate the commission, and\ncreate the earning when eligible.`})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`external_event_id`}),` must be stable across retries. Reuse the exact same value\nif you retry the same billing event, order, invoice, or checkout completion.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsx(ParamField,{body:`referral_id`,type:`string`,id:`param-referral-id`,children:_jsxs(_components.p,{children:[`Affonso referral ID to credit directly. Optional if you provide\n`,_jsx(_components.code,{children:`customer_id`}),` or `,_jsx(_components.code,{children:`external_user_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`customer_id`,type:`string`,id:`param-customer-id`,children:_jsxs(_components.p,{children:[`The customer ID from your payment provider or billing system, such as a\nStripe customer ID. Optional if you provide `,_jsx(_components.code,{children:`referral_id`}),` or\n`,_jsx(_components.code,{children:`external_user_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`external_user_id`,type:`string`,id:`param-external-user-id`,children:_jsxs(_components.p,{children:[`The user ID from your own product, app, or internal system. Optional if you\nprovide `,_jsx(_components.code,{children:`referral_id`}),` or `,_jsx(_components.code,{children:`customer_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`affonso_id`,type:`string`,id:`param-affonso-id`,children:_jsxs(_components.p,{children:[`Compatibility alias for `,_jsx(_components.code,{children:`referral_id`}),`.`]})}),`\n`,_jsx(ParamField,{body:`sale_amount`,type:`number`,required:true,id:`param-sale-amount`,children:_jsx(_components.p,{children:`Total sale amount for the purchase. Must be a positive number.`})}),`\n`,_jsx(ParamField,{body:`sale_amount_currency`,type:`string`,default:`USD`,id:`param-sale-amount-currency`,children:_jsxs(_components.p,{children:[`Three-letter currency code for the sale amount, such as `,_jsx(_components.code,{children:`USD`}),` or `,_jsx(_components.code,{children:`EUR`}),`. If\nthe sale currency differs from your team currency, Affonso converts the sale\namount and keeps the original values on the conversion.`]})}),`\n`,_jsx(ParamField,{body:`product_ids`,type:`string[]`,id:`param-product-ids`,children:_jsx(_components.p,{children:`Optional product identifiers to help match product-specific incentives.`})}),`\n`,_jsx(ParamField,{body:`price_ids`,type:`string[]`,id:`param-price-ids`,children:_jsx(_components.p,{children:`Optional price identifiers to help match price-based incentives.`})}),`\n`,_jsx(ParamField,{body:`interval`,type:`string`,id:`param-interval`,children:_jsxs(_components.p,{children:[`Subscription interval for the conversion. Valid values: `,_jsx(_components.code,{children:`monthly`}),`,\n`,_jsx(_components.code,{children:`yearly`}),`.`]})}),`\n`,_jsx(ParamField,{body:`is_subscription`,type:`boolean`,id:`param-is-subscription`,children:_jsx(_components.p,{children:`Whether the conversion comes from a subscription purchase.`})}),`\n`,_jsx(ParamField,{body:`external_event_id`,type:`string`,required:true,id:`param-external-event-id`,children:_jsx(_components.p,{children:`Provider-side idempotency key for the conversion event. Use a stable unique\nidentifier from your system, such as an order ID, invoice ID, checkout\nsession ID, or payment event ID.`})}),`\n`,_jsx(ParamField,{body:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[`Optional commission status override. Valid values: `,_jsx(_components.code,{children:`pending`}),`,\n`,_jsx(_components.code,{children:`pending_manual_approval`}),`, `,_jsx(_components.code,{children:`ready_for_payment`}),`, `,_jsx(_components.code,{children:`processing_payout`}),`, `,_jsx(_components.code,{children:`paid`}),`,\n`,_jsx(_components.code,{children:`declined`}),`, `,_jsx(_components.code,{children:`refunded`}),`, `,_jsx(_components.code,{children:`dispute`}),`. If omitted, Affonso derives the status\nfrom the matched incentive’s approval settings.`]})}),`\n`,_jsx(ParamField,{body:`sales_status`,type:`string`,default:`complete`,id:`param-sales-status`,children:_jsxs(_components.p,{children:[`Purchase status. Valid values: `,_jsx(_components.code,{children:`open`}),`, `,_jsx(_components.code,{children:`complete`}),`, `,_jsx(_components.code,{children:`trialing`}),`, `,_jsx(_components.code,{children:`failed`}),`,\n`,_jsx(_components.code,{children:`refunded`}),`, `,_jsx(_components.code,{children:`partial_refunded`}),`.`]})}),`\n`,_jsx(ParamField,{body:`created_at`,type:`string`,id:`param-created-at`,children:_jsx(_components.p,{children:`Optional ISO 8601 timestamp for the conversion.`})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsx(_components.p,{children:`Optional metadata object stored on the created affiliate earning when a\ncommission is created.`})}),`\n`,_jsx(Heading,{level:`2`,id:`validation-rules`,children:`Validation Rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`At least one of `,_jsx(_components.code,{children:`referral_id`}),`, `,_jsx(_components.code,{children:`customer_id`}),`, or `,_jsx(_components.code,{children:`external_user_id`}),` is required.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`affonso_id`}),` is also accepted instead of `,_jsx(_components.code,{children:`referral_id`}),` for compatibility.`]}),`\n`,_jsxs(_components.li,{children:[`Older field-name variants continue to work for compatibility, but new integrations should standardize on `,_jsx(_components.code,{children:`referral_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`If you send more than one identifier, Affonso checks `,_jsx(_components.code,{children:`external_user_id`}),` first, then `,_jsx(_components.code,{children:`referral_id`}),`, then `,_jsx(_components.code,{children:`customer_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`interval`}),` should only be sent for subscription conversions.`]}),`\n`,_jsxs(_components.li,{children:[`Reusing the same `,_jsx(_components.code,{children:`external_event_id`}),` returns the existing conversion instead of creating a duplicate.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`The response includes the created conversion object. On a duplicate\n`,_jsx(_components.code,{children:`external_event_id`}),`, the API returns the existing conversion with HTTP `,_jsx(_components.code,{children:`200`}),`.`]}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`true`}),` for successful responses.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`The conversion object.`}),_jsxs(Expandable,{title:`Data Object Properties`,children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Unique identifier for the transaction/commission record.`})}),_jsx(ResponseField,{name:`referral_id`,type:`string`,id:`param-referral-id-1`,children:_jsx(_components.p,{children:`Referral ID credited by the conversion.`})}),_jsx(ResponseField,{name:`affiliate_id`,type:`string | null`,id:`param-affiliate-id`,children:_jsx(_components.p,{children:`Affiliate who received credit for the conversion.`})}),_jsx(ResponseField,{name:`sale_amount`,type:`number`,id:`param-sale-amount-1`,children:_jsx(_components.p,{children:`Sale amount stored on the transaction.`})}),_jsx(ResponseField,{name:`sale_amount_currency`,type:`string`,id:`param-sale-amount-currency-1`,children:_jsx(_components.p,{children:`Stored sale currency. This can be your team currency after conversion.`})}),_jsx(ResponseField,{name:`commission_amount`,type:`number`,id:`param-commission-amount`,children:_jsxs(_components.p,{children:[`Automatically calculated commission amount. Can be `,_jsx(_components.code,{children:`0`}),` if no affiliate\nearning was created.`]})}),_jsx(ResponseField,{name:`commission_currency`,type:`string | null`,id:`param-commission-currency`,children:_jsxs(_components.p,{children:[`Currency or incentive unit for the commission. For non-monetary incentives,\nthis can be `,_jsx(_components.code,{children:`CREDITS`}),`, `,_jsx(_components.code,{children:`FREE_MONTHS`}),`, or `,_jsx(_components.code,{children:`POINTS`}),`. Returns `,_jsx(_components.code,{children:`null`}),` when the\ntransaction was recorded without creating an affiliate earning.`]})}),_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status-1`,children:_jsxs(_components.p,{children:[`Commission status. If no affiliate earning was created, this field falls back\nto `,_jsx(_components.code,{children:`pending`}),`.`]})}),_jsx(ResponseField,{name:`sales_status`,type:`string`,id:`param-sales-status-1`,children:_jsx(_components.p,{children:`Purchase status.`})}),_jsx(ResponseField,{name:`hold_period_days`,type:`integer | null`,id:`param-hold-period-days`,children:_jsx(_components.p,{children:`Hold period applied to the earning, if any.`})}),_jsx(ResponseField,{name:`payment_intent_id`,type:`string | null`,id:`param-payment-intent-id`,children:_jsxs(_components.p,{children:[`Payment intent ID. This flow currently returns `,_jsx(_components.code,{children:`null`}),`.`]})}),_jsx(ResponseField,{name:`invoice_id`,type:`string | null`,id:`param-invoice-id`,children:_jsx(_components.p,{children:`Payout invoice ID if linked later.`})}),_jsx(ResponseField,{name:`earning_id`,type:`string | null`,id:`param-earning-id`,children:_jsx(_components.p,{children:`Affiliate earning ID if a commission was created.`})}),_jsx(ResponseField,{name:`earning_type`,type:`string | null`,id:`param-earning-type`,children:_jsxs(_components.p,{children:[`Earning type. Typically `,_jsx(_components.code,{children:`direct_commission`}),` when an earning exists.`]})}),_jsx(ResponseField,{name:`external_event_id`,type:`string | null`,id:`param-external-event-id-1`,children:_jsx(_components.p,{children:`The idempotency key that was used for this conversion.`})}),_jsx(ResponseField,{name:`calculation_mode`,type:`string`,id:`param-calculation-mode`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`auto`}),` for this endpoint.`]})}),_jsx(ResponseField,{name:`matched_incentive_id`,type:`string | null`,id:`param-matched-incentive-id`,children:_jsx(_components.p,{children:`Incentive ID used during commission calculation, when a match was found.`})}),_jsx(ResponseField,{name:`commission_created`,type:`boolean`,id:`param-commission-created`,children:_jsx(_components.p,{children:`Whether the conversion created an affiliate earning.`})}),_jsx(ResponseField,{name:`activity_outcome`,type:`string`,id:`param-activity-outcome`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`commission_created`}),` when an affiliate earning was created, or `,_jsx(_components.code,{children:`sale_recorded`}),` when the sale was accepted without creating one.`]})}),_jsx(ResponseField,{name:`created_at`,type:`string`,id:`param-created-at-1`,children:_jsx(_components.p,{children:`ISO 8601 timestamp for when the conversion was created.`})}),_jsx(ResponseField,{name:`updated_at`,type:`string`,id:`param-updated-at`,children:_jsx(_components.p,{children:`ISO 8601 timestamp for the last update.`})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example-request`,children:`Example Request`}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.affonso.io/v1/conversions\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk_live_your_api_key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"customer_id\": \"cust_123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sale_amount\": 99.00,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sale_amount_currency\": \"USD\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"external_event_id\": \"inv_2026_000145\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sales_status\": \"complete\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"is_subscription\": true,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"interval\": \"monthly\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price_ids\": [\"price_monthly_usd\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-response`,children:`Example Response`}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`26`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`26`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"com_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"referral_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ref_456def\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"affiliate_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"aff_789ghi\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sale_amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`99`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sale_amount_currency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USD\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"commission_amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`29.7`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"commission_currency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USD\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ready_for_payment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sales_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"complete\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hold_period_days\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"payment_intent_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoice_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"earning_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"earn_123abc\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"earning_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"direct_commission\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"external_event_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"inv_2026_000145\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"calculation_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"matched_incentive_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"inc_monthly_001\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"commission_created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"activity_outcome\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"commission_created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-06-22T12:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updated_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-06-22T12:00:00.000Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`When a conversion is accepted but no affiliate earning is created, the\nresponse still succeeds with `,_jsx(_components.code,{children:`commission_amount: 0`}),`,\n`,_jsx(_components.code,{children:`commission_currency: null`}),`, `,_jsx(_components.code,{children:`earning_id: null`}),`,\n`,_jsx(_components.code,{children:`commission_created: false`}),`, and `,_jsx(_components.code,{children:`activity_outcome: \"sale_recorded\"`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Conversion","api":"POST https://api.affonso.io/v1/conversions","description":"Create a server-side conversion and let Affonso calculate the commission automatically","href":"/api/endpoint/conversions/create"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Body Parameters","slug":"body-parameters","depth":2,"children":[]},{"title":"Validation Rules","slug":"validation-rules","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Example Request","slug":"example-request","depth":2,"children":[]},{"title":"Example Response","slug":"example-response","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"13\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.affonso.io/v1/conversions\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer sk_live_your_api_key\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"customer_id\": \"cust_123\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"sale_amount\": 99.00,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"sale_amount_currency\": \"USD\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"external_event_id\": \"inv_2026_000145\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"sales_status\": \"complete\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"is_subscription\": true,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"interval\": \"monthly\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"price_ids\": [\"price_monthly_usd\"]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"26\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"com_abc123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"referral_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"ref_456def\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"affiliate_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"aff_789ghi\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"sale_amount\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">99\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"sale_amount_currency\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"USD\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"commission_amount\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">29.7\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"commission_currency\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"USD\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"ready_for_payment\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"sales_status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"complete\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hold_period_days\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"payment_intent_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"invoice_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"earning_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"earn_123abc\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"earning_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"direct_commission\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"external_event_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"inv_2026_000145\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"calculation_mode\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"auto\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"matched_incentive_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"inc_monthly_001\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"commission_created\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"activity_outcome\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"commission_created\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-06-22T12:00:00.000Z\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"updated_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-06-22T12:00:00.000Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Create Conversion","path":"/v1/conversions","servers":[{"url":"https://api.affonso.io"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"referral_id":[{"type":"string","description":"Affonso referral ID to credit directly. Optional if you provide `customer_id` or `external_user_id` ."}],"customer_id":[{"type":"string","description":"The customer ID from your payment provider or billing system, such as a Stripe customer ID. Optional if you provide `referral_id` or `external_user_id` ."}],"external_user_id":[{"type":"string","description":"The user ID from your own product, app, or internal system. Optional if you provide `referral_id` or `customer_id` ."}],"affonso_id":[{"type":"string","description":"Compatibility alias for `referral_id` ."}],"sale_amount":[{"type":"number","description":"Total sale amount for the purchase. Must be a positive number.","required":true}],"sale_amount_currency":[{"type":"string","description":"Three-letter currency code for the sale amount, such as `USD` or `EUR` . If the sale currency differs from your team currency, Affonso converts the sale amount and keeps the original values on the conversion."}],"product_ids":[{"type":"array","items":[{"type":"string"}],"description":"Optional product identifiers to help match product-specific incentives."}],"price_ids":[{"type":"array","items":[{"type":"string"}],"description":"Optional price identifiers to help match price-based incentives."}],"interval":[{"type":"string","description":"Subscription interval for the conversion. Valid values: `monthly` , `yearly` ."}],"is_subscription":[{"type":"boolean","description":"Whether the conversion comes from a subscription purchase."}],"external_event_id":[{"type":"string","description":"Provider-side idempotency key for the conversion event. Use a stable unique identifier from your system, such as an order ID, invoice ID, checkout session ID, or payment event ID.","required":true}],"status":[{"type":"string","description":"Optional commission status override. Valid values: `pending` , `pending_manual_approval` , `ready_for_payment` , `processing_payout` , `paid` , `declined` , `refunded` , `dispute` . If omitted, Affonso derives the status from the matched incentive’s approval settings."}],"sales_status":[{"type":"string","description":"Purchase status. Valid values: `open` , `complete` , `trialing` , `failed` , `refunded` , `partial_refunded` ."}],"created_at":[{"type":"string","description":"Optional ISO 8601 timestamp for the conversion."}],"metadata":[{"type":"object","properties":{},"description":"Optional metadata object stored on the created affiliate earning when a commission is created."}]}}],"examples":{"example":{"value":{"referral_id":"\u003cstring>","customer_id":"\u003cstring>","external_user_id":"\u003cstring>","affonso_id":"\u003cstring>","sale_amount":123,"sale_amount_currency":"\u003cstring>","product_ids":["\u003cstring>"],"price_ids":["\u003cstring>"],"interval":"\u003cstring>","is_subscription":true,"external_event_id":"\u003cstring>","status":"\u003cstring>","sales_status":"\u003cstring>","created_at":"\u003cstring>","metadata":{}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"Always `true` for successful responses."}],"data":[{"type":"object","properties":{"id":[{"type":"string","description":"Unique identifier for the transaction/commission record."}],"referral_id":[{"type":"string","description":"Referral ID credited by the conversion."}],"affiliate_id":[{"type":"object","properties":{},"description":"Affiliate who received credit for the conversion."}],"sale_amount":[{"type":"number","description":"Sale amount stored on the transaction."}],"sale_amount_currency":[{"type":"string","description":"Stored sale currency. This can be your team currency after conversion."}],"commission_amount":[{"type":"number","description":"Automatically calculated commission amount. Can be `0` if no affiliate earning was created."}],"commission_currency":[{"type":"object","properties":{},"description":"Currency or incentive unit for the commission. For non-monetary incentives, this can be `CREDITS` , `FREE_MONTHS` , or `POINTS` . Returns `null` when the transaction was recorded without creating an affiliate earning."}],"status":[{"type":"string","description":"Commission status. If no affiliate earning was created, this field falls back to `pending` ."}],"sales_status":[{"type":"string","description":"Purchase status."}],"hold_period_days":[{"type":"object","properties":{},"description":"Hold period applied to the earning, if any."}],"payment_intent_id":[{"type":"object","properties":{},"description":"Payment intent ID. This flow currently returns `null` ."}],"invoice_id":[{"type":"object","properties":{},"description":"Payout invoice ID if linked later."}],"earning_id":[{"type":"object","properties":{},"description":"Affiliate earning ID if a commission was created."}],"earning_type":[{"type":"object","properties":{},"description":"Earning type. Typically `direct_commission` when an earning exists."}],"external_event_id":[{"type":"object","properties":{},"description":"The idempotency key that was used for this conversion."}],"calculation_mode":[{"type":"string","description":"Always `auto` for this endpoint."}],"matched_incentive_id":[{"type":"object","properties":{},"description":"Incentive ID used during commission calculation, when a match was found."}],"commission_created":[{"type":"boolean","description":"Whether the conversion created an affiliate earning."}],"activity_outcome":[{"type":"string","description":"`commission_created` when an affiliate earning was created, or `sale_recorded` when the sale was accepted without creating one."}],"created_at":[{"type":"string","description":"ISO 8601 timestamp for when the conversion was created."}],"updated_at":[{"type":"string","description":"ISO 8601 timestamp for the last update."}]},"description":"The conversion object."}]}}],"examples":{"example":{"value":{"success":true,"data":{"id":"\u003cstring>","referral_id":"\u003cstring>","affiliate_id":{},"sale_amount":123,"sale_amount_currency":"\u003cstring>","commission_amount":123,"commission_currency":{},"status":"\u003cstring>","sales_status":"\u003cstring>","hold_period_days":{},"payment_intent_id":{},"invoice_id":{},"earning_id":{},"earning_type":{},"external_event_id":{},"calculation_mode":"\u003cstring>","matched_incentive_id":{},"commission_created":true,"activity_outcome":"\u003cstring>","created_at":"\u003cstring>","updated_at":"\u003cstring>"}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"affonso-20c7dee8","siteName":"Affonso Docs","title":"Create Conversion - Affonso Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-22T18:49:29.168Z","originalFileLocation":"api/endpoint/conversions/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a server-side conversion and let Affonso calculate the commission automatically\">\u003cmeta data-mint-head name=\"application-name\" content=\"Affonso Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Conversion - Affonso Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a server-side conversion and let Affonso calculate the commission automatically\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Affonso Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.affonso.io/api/endpoint/conversions/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://affonso-20c7dee8.mintlify.site/_mintlify/api/og/v2?division=Conversions\u0026amp;title=Create+Conversion\u0026amp;description=Create+a+server-side+conversion+and+let+Affonso+calculate+the+commission+automatically\u0026amp;theme=bbdaa51877c05a503c14f1e9\u0026amp;signature=d9a9eee646b972f181c55bb0ca356ddffb7aebd34b0ba943a3fcdb02c9bd954f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Conversion - Affonso Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a server-side conversion and let Affonso calculate the commission automatically\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://affonso-20c7dee8.mintlify.site/_mintlify/api/og/v2?division=Conversions\u0026amp;title=Create+Conversion\u0026amp;description=Create+a+server-side+conversion+and+let+Affonso+calculate+the+commission+automatically\u0026amp;theme=bbdaa51877c05a503c14f1e9\u0026amp;signature=d9a9eee646b972f181c55bb0ca356ddffb7aebd34b0ba943a3fcdb02c9bd954f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/affonso-20c7dee8/o8Zy3ftrGGF8u7vC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Affonso Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#881337\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.affonso.io/api/endpoint/conversions/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/endpoint/conversions/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.affonso.io/#organization\",\"name\":\"Affonso Docs\",\"url\":\"https://docs.affonso.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/affonso-20c7dee8/nWO6r2CUpJ-o-z8l/logo/affonso_logo_small.png?fit=max\u0026auto=format\u0026n=nWO6r2CUpJ-o-z8l\u0026q=85\u0026s=4b239574262c42f95697481e8b29adce\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.affonso.io#website\",\"name\":\"Affonso Docs\",\"url\":\"https://docs.affonso.io\",\"publisher\":{\"@id\":\"https://docs.affonso.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.affonso.io/api/endpoint/conversions/create#webpage\",\"url\":\"https://docs.affonso.io/api/endpoint/conversions/create\",\"name\":\"Create Conversion\",\"description\":\"Create a server-side conversion and let Affonso calculate the commission automatically\",\"dateModified\":\"2026-09-22T18:49:29.168Z\",\"isPartOf\":{\"@id\":\"https://docs.affonso.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.affonso.io/api/endpoint/conversions/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.affonso.io/api/endpoint/conversions/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Core Resources\",\"item\":\"https://docs.affonso.io/api/endpoint/clicks/create\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Conversion\",\"item\":\"https://docs.affonso.io/api/endpoint/conversions/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.affonso.io/api/endpoint/conversions/create#apireference\",\"headline\":\"Create Conversion\",\"name\":\"Create Conversion\",\"description\":\"Create a server-side conversion and let Affonso calculate the commission automatically\",\"url\":\"https://docs.affonso.io/api/endpoint/conversions/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.affonso.io/api/endpoint/conversions/create#webpage\"},\"dateModified\":\"2026-09-22T18:49:29.168Z\",\"publisher\":{\"@id\":\"https://docs.affonso.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.affonso.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Affonso Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Affonso Docs","nav":{"global":{"anchors":[{"anchor":"Home","icon":"home","href":"https://affonso.io"},{"anchor":"Blog","icon":"newspaper","href":"https://affonso.io/blog"},{"anchor":"Help Center","icon":"book-open-cover","href":"https://affonso.io/help"}]},"tabs":[{"tab":"API Reference","groups":[{"group":"Getting Started","pages":[{"title":"API Introduction","href":"/api/introduction"},{"title":"Authentication","href":"/api/authentication"},{"title":"Rate Limits","href":"/api/rate-limits"},{"title":"TypeScript SDK","href":"/api/sdk/typescript"}]},{"group":"Guide","pages":[{"title":"Track With Tracking Pixel","href":"/api/with-tracking-pixel"},{"title":"Track Without Tracking Pixel","href":"/api/without-tracking-pixel"},{"title":"Proxy Setup (Optional)","href":"/api/proxy-setup"},{"title":"Server-Side Tracking","href":"/api/server-side-tracking"},{"title":"Embedded Referral Dashboard","href":"/api/embedded-dashboard"},{"title":"Segment Track Events","href":"/api/segment-track-events"}]},{"group":"Core Resources","pages":[{"group":"Clicks","pages":[{"title":"Track Click","api":"POST https://api.affonso.io/v1/clicks","href":"/api/endpoint/clicks/create"}]},{"group":"Signups","pages":[{"title":"Record Lead Signup","api":"POST /v1/signups","description":"Convert a previously tracked click into a lead. Server-side equivalent of the pixel.js `Affonso.signup()` call.","href":"/api/endpoint/signups/create"}]},{"group":"Conversions","pages":[{"title":"Create Conversion","api":"POST https://api.affonso.io/v1/conversions","href":"/api/endpoint/conversions/create"},{"title":"Refund Conversion","api":"POST https://api.affonso.io/v1/conversions/{id}/refund","description":"Apply a full or partial refund to an existing server-side conversion","href":"/api/endpoint/conversions/refund"}]},{"group":"Events","pages":[{"title":"Create Event","api":"POST https://api.affonso.io/v1/events","href":"/api/endpoint/events/create"}]},{"group":"Affiliates","pages":[{"title":"List Affiliates","api":"GET https://api.affonso.io/v1/affiliates","href":"/api/endpoint/affiliates/list"},{"title":"Get Affiliate","api":"GET https://api.affonso.io/v1/affiliates/{id}","href":"/api/endpoint/affiliates/get"},{"title":"Get Affiliate Analytics","api":"GET https://api.affonso.io/v1/affiliates/{id}/analytics","href":"/api/endpoint/affiliates/analytics"},{"title":"Create Affiliate","api":"POST https://api.affonso.io/v1/affiliates","href":"/api/endpoint/affiliates/create"},{"title":"Update Affiliate","api":"PUT https://api.affonso.io/v1/affiliates/{id}","href":"/api/endpoint/affiliates/update"},{"title":"Delete Affiliate","api":"DELETE https://api.affonso.io/v1/affiliates/{id}","href":"/api/endpoint/affiliates/delete"},{"title":"Generate Portal Login Token","api":"POST https://api.affonso.io/v1/affiliates/{id}/portal-token","href":"/api/endpoint/affiliates/portal-token"}]},{"group":"Fraud Events","pages":[{"title":"List Fraud Events","api":"GET https://api.affonso.io/v1/fraud-events","href":"/api/endpoint/fraud-events/list"},{"title":"Confirm Fraud Events","api":"POST https://api.affonso.io/v1/fraud-events/confirm","href":"/api/endpoint/fraud-events/confirm"},{"title":"Resolve Fraud Events","api":"POST https://api.affonso.io/v1/fraud-events/resolve","href":"/api/endpoint/fraud-events/resolve"}]},{"group":"Referrals","pages":[{"title":"List Referrals","api":"GET https://api.affonso.io/v1/referrals","href":"/api/endpoint/referrals/list"},{"title":"Get Referral","api":"GET https://api.affonso.io/v1/referrals/{id}","href":"/api/endpoint/referrals/get"},{"title":"Create Referral","api":"POST https://api.affonso.io/v1/referrals","href":"/api/endpoint/referrals/create"},{"title":"Update Referral","api":"PUT https://api.affonso.io/v1/referrals/{id}","href":"/api/endpoint/referrals/update"},{"title":"Delete Referral","api":"DELETE https://api.affonso.io/v1/referrals/{id}","href":"/api/endpoint/referrals/delete"}]},{"group":"Commissions","pages":[{"title":"List Commissions","api":"GET https://api.affonso.io/v1/commissions","href":"/api/endpoint/commissions/list"},{"title":"Get Commission","api":"GET https://api.affonso.io/v1/commissions/{id}","href":"/api/endpoint/commissions/get"},{"title":"Create Commission","api":"POST https://api.affonso.io/v1/commissions","href":"/api/endpoint/commissions/create"},{"title":"Create Bonus","api":"POST https://api.affonso.io/v1/commissions/bonus","href":"/api/endpoint/commissions/bonus"},{"title":"Update Commission","api":"PUT https://api.affonso.io/v1/commissions/{id}","href":"/api/endpoint/commissions/update"},{"title":"Delete Commission","api":"DELETE https://api.affonso.io/v1/commissions/{id}","href":"/api/endpoint/commissions/delete"}]},{"group":"Payouts","pages":[{"title":"List Payouts","api":"GET https://api.affonso.io/v1/payouts","href":"/api/endpoint/payouts/list"},{"title":"Get Payout","api":"GET https://api.affonso.io/v1/payouts/{id}","href":"/api/endpoint/payouts/get"},{"title":"Update Payout","api":"PUT https://api.affonso.io/v1/payouts/{id}","href":"/api/endpoint/payouts/update"}]},{"group":"Coupons","pages":[{"title":"List Coupons","api":"GET https://api.affonso.io/v1/coupons","href":"/api/endpoint/coupons/list"},{"title":"Get Coupon","api":"GET https://api.affonso.io/v1/coupons/{id}","href":"/api/endpoint/coupons/get"},{"title":"Create Coupon","api":"POST https://api.affonso.io/v1/coupons","href":"/api/endpoint/coupons/create"},{"title":"Delete Coupon","api":"DELETE https://api.affonso.io/v1/coupons/{id}","href":"/api/endpoint/coupons/delete"}]},{"group":"Embed","pages":[{"title":"Create Embed Token","api":"POST https://api.affonso.io/v1/embed/token","href":"/api/endpoint/embed/create-token"},{"title":"Get Embed Data","api":"GET https://api.affonso.io/v1/embed/data","href":"/api/endpoint/embed/get-data"},{"title":"Create Self-Service Coupon","api":"POST https://api.affonso.io/v1/embed/coupon","href":"/api/endpoint/embed/create-coupon"}]},{"group":"Affiliate Finder","pages":[{"title":"Start Finder Search","api":"POST https://api.affonso.io/v1/finder/searches","href":"/api/endpoint/finder/start-search"},{"title":"List Finder Searches","api":"GET https://api.affonso.io/v1/finder/searches","href":"/api/endpoint/finder/list-searches"},{"title":"List Finder Results","api":"GET https://api.affonso.io/v1/finder/searches/{id}/results","href":"/api/endpoint/finder/list-results"},{"title":"List Finder Shortlist","api":"GET https://api.affonso.io/v1/finder/shortlist","href":"/api/endpoint/finder/list-shortlist"},{"title":"Add Finder Result to Shortlist","api":"POST https://api.affonso.io/v1/finder/shortlist","href":"/api/endpoint/finder/add-shortlist"},{"title":"Update Finder Shortlist Item","api":"PATCH https://api.affonso.io/v1/finder/shortlist/{id}","href":"/api/endpoint/finder/update-shortlist"},{"title":"Delete Finder Shortlist Item","api":"DELETE https://api.affonso.io/v1/finder/shortlist/{id}","href":"/api/endpoint/finder/delete-shortlist"}]}]},{"group":"Program Management","pages":[{"group":"Program Settings","pages":[{"group":"Info","pages":[{"title":"Get Program Info","api":"GET https://api.affonso.io/v1/program","href":"/api/endpoint/program/get-info"},{"title":"Update Program Info","api":"PATCH https://api.affonso.io/v1/program","href":"/api/endpoint/program/update-info"}]},{"group":"Brand Profile","pages":[{"title":"Get Brand Profile","api":"GET https://api.affonso.io/v1/program/brand","href":"/api/endpoint/program/get-brand-profile"},{"title":"Update Brand Profile","api":"PATCH https://api.affonso.io/v1/program/brand","href":"/api/endpoint/program/update-brand-profile"}]},{"group":"Payment Terms","pages":[{"title":"Get Payment Terms","api":"GET https://api.affonso.io/v1/program/payment-terms","href":"/api/endpoint/program/get-payment-terms"},{"title":"Update Payment Terms","api":"PATCH https://api.affonso.io/v1/program/payment-terms","href":"/api/endpoint/program/update-payment-terms"}]},{"group":"Tracking","pages":[{"title":"Get Tracking Settings","api":"GET https://api.affonso.io/v1/program/tracking","href":"/api/endpoint/program/get-tracking"},{"title":"Update Tracking Settings","api":"PATCH https://api.affonso.io/v1/program/tracking","href":"/api/endpoint/program/update-tracking"}]},{"group":"Restrictions","pages":[{"title":"Get Restrictions","api":"GET https://api.affonso.io/v1/program/restrictions","href":"/api/endpoint/program/get-restrictions"},{"title":"Update Restrictions","api":"PATCH https://api.affonso.io/v1/program/restrictions","href":"/api/endpoint/program/update-restrictions"}]},{"group":"Portal","pages":[{"title":"Get Portal Settings","api":"GET https://api.affonso.io/v1/program/portal","href":"/api/endpoint/program/get-portal"},{"title":"Update Portal Settings","api":"PATCH https://api.affonso.io/v1/program/portal","href":"/api/endpoint/program/update-portal"}]},{"group":"Fraud Rules","pages":[{"title":"Get Fraud Rules","api":"GET https://api.affonso.io/v1/program/fraud-rules","href":"/api/endpoint/program/get-fraud-rules"},{"title":"Update Fraud Rules","api":"PATCH https://api.affonso.io/v1/program/fraud-rules","href":"/api/endpoint/program/update-fraud-rules"}]},{"group":"Notifications","pages":[{"title":"List Notification Settings","api":"GET https://api.affonso.io/v1/program/notifications","href":"/api/endpoint/program/list-notifications"},{"title":"Update Notification Setting","api":"PATCH https://api.affonso.io/v1/program/notifications/{emailTypeId}","href":"/api/endpoint/program/update-notification"}]},{"group":"Affiliate Groups","pages":[{"title":"List Groups","api":"GET https://api.affonso.io/v1/program/groups","href":"/api/endpoint/program/list-groups"},{"title":"Get Group","api":"GET https://api.affonso.io/v1/program/groups/{id}","href":"/api/endpoint/program/get-group"},{"title":"Create Group","api":"POST https://api.affonso.io/v1/program/groups","href":"/api/endpoint/program/create-group"},{"title":"Update Group","api":"PATCH https://api.affonso.io/v1/program/groups/{id}","href":"/api/endpoint/program/update-group"},{"title":"Delete Group","api":"DELETE https://api.affonso.io/v1/program/groups/{id}","href":"/api/endpoint/program/delete-group"}]},{"group":"Promotion URLs","pages":[{"title":"List Promotion URLs","api":"GET https://api.affonso.io/v1/program/promotion-urls","href":"/api/endpoint/program/list-promotion-urls"},{"title":"Create Promotion URL","api":"POST https://api.affonso.io/v1/program/promotion-urls","href":"/api/endpoint/program/create-promotion-url"},{"title":"Get Promotion URL","api":"GET https://api.affonso.io/v1/program/promotion-urls/{id}","href":"/api/endpoint/program/get-promotion-url"},{"title":"Update Promotion URL","api":"PATCH https://api.affonso.io/v1/program/promotion-urls/{id}","href":"/api/endpoint/program/update-promotion-url"},{"title":"Delete Promotion URL","api":"DELETE https://api.affonso.io/v1/program/promotion-urls/{id}","href":"/api/endpoint/program/delete-promotion-url"},{"title":"Set Program Default Promotion URL","api":"PUT https://api.affonso.io/v1/program/promotion-urls/default","href":"/api/endpoint/program/set-promotion-url-default"},{"title":"Set Group Default Promotion URL","api":"PUT https://api.affonso.io/v1/program/groups/{groupId}/promotion-url-default","href":"/api/endpoint/program/set-group-promotion-url-default"}]},{"group":"Creatives","pages":[{"title":"List Creatives","api":"GET https://api.affonso.io/v1/program/creatives","href":"/api/endpoint/program/list-creatives"},{"title":"Get Creative","api":"GET https://api.affonso.io/v1/program/creatives/{id}","href":"/api/endpoint/program/get-creative"},{"title":"Create Creative","api":"POST https://api.affonso.io/v1/program/creatives","href":"/api/endpoint/program/create-creative"},{"title":"Update Creative","api":"PATCH https://api.affonso.io/v1/program/creatives/{id}","href":"/api/endpoint/program/update-creative"},{"title":"Delete Creative","api":"DELETE https://api.affonso.io/v1/program/creatives/{id}","href":"/api/endpoint/program/delete-creative"}]}]},{"group":"Campaigns","pages":[{"title":"List Campaigns","api":"GET https://api.affonso.io/v1/program/campaigns","href":"/api/endpoint/campaigns/list"},{"title":"Get Campaign","api":"GET https://api.affonso.io/v1/program/campaigns/{id}","href":"/api/endpoint/campaigns/get"},{"title":"Create Campaign","api":"POST https://api.affonso.io/v1/program/campaigns","href":"/api/endpoint/campaigns/create"},{"title":"Update Campaign","api":"PATCH https://api.affonso.io/v1/program/campaigns/{id}","href":"/api/endpoint/campaigns/update"},{"title":"List Campaign Applications","api":"GET https://api.affonso.io/v1/program/campaigns/{id}/applications","href":"/api/endpoint/campaigns/list-applications"},{"title":"Apply to Campaign","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/applications","href":"/api/endpoint/campaigns/apply"},{"title":"Accept Campaign Application","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/applications/{applicationId}/accept","href":"/api/endpoint/campaigns/accept-application"},{"title":"Reject Campaign Application","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/applications/{applicationId}/reject","href":"/api/endpoint/campaigns/reject-application"},{"title":"Approve Campaign Submission","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/submissions/{submissionId}/approve","href":"/api/endpoint/campaigns/approve-submission"},{"title":"Update Retainer Condition","api":"PATCH https://api.affonso.io/v1/program/campaigns/{id}/applications/{applicationId}/condition","href":"/api/endpoint/campaigns/update-retainer-condition"},{"title":"End Partner Retainer","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/applications/{applicationId}/end-retainer","href":"/api/endpoint/campaigns/end-retainer"},{"title":"Resume Partner Retainer","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/applications/{applicationId}/resume-retainer","href":"/api/endpoint/campaigns/resume-retainer"},{"title":"List Retainer Periods","api":"GET https://api.affonso.io/v1/program/campaigns/{id}/retainer-periods","href":"/api/endpoint/campaigns/list-retainer-periods"},{"title":"Approve Retainer Period","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/retainer-periods/{periodId}/approve","href":"/api/endpoint/campaigns/approve-retainer-period"},{"title":"Reject Retainer Period","api":"POST https://api.affonso.io/v1/program/campaigns/{id}/retainer-periods/{periodId}/reject","href":"/api/endpoint/campaigns/reject-retainer-period"}]},{"group":"Affiliate Onboarding","pages":[{"title":"Get Onboarding Form","api":"GET https://api.affonso.io/v1/onboarding-form","href":"/api/endpoint/onboarding/get-form"},{"title":"Create Onboarding Form","api":"POST https://api.affonso.io/v1/onboarding-form","href":"/api/endpoint/onboarding/create-form"},{"title":"Update Onboarding Form","api":"PATCH https://api.affonso.io/v1/onboarding-form","href":"/api/endpoint/onboarding/update-form"},{"title":"Delete Onboarding Form","api":"DELETE https://api.affonso.io/v1/onboarding-form","href":"/api/endpoint/onboarding/delete-form"},{"title":"Get Affiliate Onboarding Responses","api":"GET https://api.affonso.io/v1/affiliates/{id}/onboarding-responses","href":"/api/endpoint/onboarding/get-responses"},{"title":"Submit Onboarding Responses","api":"POST https://api.affonso.io/v1/affiliates/{id}/onboarding-responses","href":"/api/endpoint/onboarding/submit-responses"}]}]},{"group":"Marketplace","pages":[{"title":"List Marketplace Programs","api":"GET https://api.affonso.io/v1/marketplace","href":"/api/endpoint/marketplace/list"},{"title":"Get Marketplace Program","api":"GET https://api.affonso.io/v1/marketplace/{id}","href":"/api/endpoint/marketplace/get"},{"title":"List Marketplace Campaigns","api":"GET https://api.affonso.io/v1/marketplace/campaigns","href":"/api/endpoint/marketplace/list-campaigns"},{"title":"Get Marketplace Campaign","api":"GET https://api.affonso.io/v1/marketplace/campaigns/{id}","href":"/api/endpoint/marketplace/get-campaign"}]}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/mcp/introduction"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/introduction"}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/webhooks/introduction"}]}]},"basePath":"","title":"Create Conversion - Affonso Docs","buildId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","deploymentId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-Myd8dsju.js","utils-C2HkQgW0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-8rSppmTv.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B6MjiCFm.js","snippetPresets-DwrSAONL.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-1-a5UQKQ.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C541m7wZ.js","shallow-CWELCZ77.js","getApiPlaygroundDisplay-CTo5Zn03.js","CodeSnippet-D--dzvnl.js","CodeSnippets-DM3cXEDh.js","Page-CxAy5y67.js","getPastedJson-C-VECgcL.js","icon-BPq2-Mg3.js","MethodPill-D9J5cUHd.js","DuplicateIcon-BqHaxUnD.js","createIcon-CIbcZHp9.js","DynamicMarkdown-BKiHAm_d.js","SectionHeading-DstQXt3H.js","axios-vUo_bRtp.js"]}