Last active
June 9, 2025 17:39
-
-
Save mysticaltech/d64f0879fc82509ab590dfec6bbcea5f to your computer and use it in GitHub Desktop.
Tapfiliate openapi.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "openapi": "3.0.0", | |
| "info": { | |
| "title": "Tapfiliate REST API", | |
| "version": "1.6", | |
| "description": "A comprehensive reference guide to the Tapfiliate REST API. The API is based around REST, has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. JSON is returned by all API responses, including errors. All API requests must be made over HTTPS." | |
| }, | |
| "servers": [ | |
| { | |
| "url": "https://api.tapfiliate.com/1.6", | |
| "description": "Tapfiliate API Server V1.6" | |
| } | |
| ], | |
| "components": { | |
| "securitySchemes": { | |
| "ApiKeyAuth": { | |
| "type": "apiKey", | |
| "in": "header", | |
| "name": "X-Api-Key", | |
| "description": "Your secret API key. Manage your API Key in your account settings." | |
| } | |
| }, | |
| "schemas": { | |
| "MetaData": { | |
| "type": "object", | |
| "additionalProperties": {}, | |
| "description": "Arbitrary key-value data.", | |
| "nullable": true, | |
| "example": { | |
| "foo": "bar", | |
| "another_key": 123 | |
| } | |
| }, | |
| "Warnings": { | |
| "type": "object", | |
| "nullable": true, | |
| "description": "Any warnings related to the operation." | |
| }, | |
| "ClickInfo": { | |
| "type": "object", | |
| "properties": { | |
| "created_at": { | |
| "type": "string", | |
| "format": "date-time", | |
| "nullable": true, | |
| "example": "2021-03-03T12:39:19+0000" | |
| }, | |
| "referrer": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "https://example-blog.inc/check-out-johns-product/" | |
| }, | |
| "landing_page": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "https://tapper.inc/johns-cool-product/" | |
| } | |
| }, | |
| "nullable": true | |
| }, | |
| "ProgramInfoBasic": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "example": "johns-affiliate-program" | |
| }, | |
| "title": { | |
| "type": "string", | |
| "example": "John's affiliate program" | |
| }, | |
| "currency": { | |
| "type": "string", | |
| "example": "USD" | |
| } | |
| } | |
| }, | |
| "AffiliateInfoBasic": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "example": "janejameson" | |
| }, | |
| "firstname": { | |
| "type": "string", | |
| "example": "Jane" | |
| }, | |
| "lastname": { | |
| "type": "string", | |
| "example": "Jameson" | |
| } | |
| } | |
| }, | |
| "CountryInfo": { | |
| "type": "object", | |
| "properties": { | |
| "code": { | |
| "type": "string", | |
| "description": "The country's ISO_3166-1 code.", | |
| "example": "NL" | |
| }, | |
| "name": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "Netherlands" | |
| } | |
| } | |
| }, | |
| "AddressInfo": { | |
| "type": "object", | |
| "nullable": true, | |
| "properties": { | |
| "address": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "Rapenburgerstraat 173" | |
| }, | |
| "address_two": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "postal_code": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "1011 VM" | |
| }, | |
| "city": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "Amsterdam" | |
| }, | |
| "state": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "Noord-Holland" | |
| }, | |
| "country": { | |
| "$ref": "#/components/schemas/CountryInfo" | |
| } | |
| } | |
| }, | |
| "CompanyInfo": { | |
| "type": "object", | |
| "nullable": true, | |
| "properties": { | |
| "name": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "Example blog Inc." | |
| }, | |
| "description": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "Best blog ever" | |
| } | |
| } | |
| }, | |
| "ReferralLinkInfo": { | |
| "type": "object", | |
| "nullable": true, | |
| "properties": { | |
| "asset_id": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "1-aaaaaa" | |
| }, | |
| "link": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "https://tapper.inc/johns-cool-product/?ref=nwjinmy" | |
| }, | |
| "source_id": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "1-ssssss" | |
| } | |
| } | |
| }, | |
| "Customer": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "example": "cu_eXampl3" | |
| }, | |
| "customer_id": { | |
| "type": "string", | |
| "example": "USER123" | |
| }, | |
| "status": { | |
| "type": "string", | |
| "example": "trial" | |
| }, | |
| "created_at": { | |
| "type": "string", | |
| "format": "date-time", | |
| "example": "2021-07-02T09:55:20+00:00" | |
| }, | |
| "click": { | |
| "$ref": "#/components/schemas/ClickInfo" | |
| }, | |
| "program": { | |
| "$ref": "#/components/schemas/ProgramInfoBasic" | |
| }, | |
| "affiliate": { | |
| "$ref": "#/components/schemas/AffiliateInfoBasic" | |
| }, | |
| "affiliate_meta_data": { | |
| "$ref": "#/components/schemas/MetaData" | |
| }, | |
| "meta_data": { | |
| "$ref": "#/components/schemas/MetaData" | |
| }, | |
| "warnings": { | |
| "$ref": "#/components/schemas/Warnings" | |
| } | |
| } | |
| }, | |
| "CustomerList": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/components/schemas/Customer" | |
| } | |
| }, | |
| "CreateCustomerRequest": { | |
| "type": "object", | |
| "required": [ | |
| "customer_id" | |
| ], | |
| "properties": { | |
| "referral_code": { | |
| "type": "string", | |
| "description": "An affiliate’s referral code.", | |
| "nullable": true | |
| }, | |
| "tracking_id": { | |
| "type": "string", | |
| "description": "The tracking id from javascript library.", | |
| "nullable": true | |
| }, | |
| "click_id": { | |
| "type": "string", | |
| "description": "The click id.", | |
| "nullable": true | |
| }, | |
| "coupon": { | |
| "type": "string", | |
| "description": "A coupon code.", | |
| "nullable": true | |
| }, | |
| "asset_id": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "source_id": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "customer_id": { | |
| "type": "string", | |
| "description": "Your unique ID for this customer." | |
| }, | |
| "status": { | |
| "type": "string", | |
| "description": "Initial status (e.g., 'new', 'trial'). Defaults to 'new'.", | |
| "nullable": true, | |
| "example": "trial" | |
| }, | |
| "user_agent": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "ip": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "meta_data": { | |
| "$ref": "#/components/schemas/MetaData" | |
| } | |
| }, | |
| "description": "Use one of: Tracking id, referral code, click id, coupon code, or asset_id & source_id." | |
| }, | |
| "UpdateCustomerRequest": { | |
| "type": "object", | |
| "properties": { | |
| "customer_id": { | |
| "type": "string", | |
| "description": "The id for this customer in your system.", | |
| "nullable": true | |
| }, | |
| "meta_data": { | |
| "$ref": "#/components/schemas/MetaData", | |
| "nullable": true | |
| } | |
| } | |
| }, | |
| "CommissionInConversion": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "conversion_sub_amount": { | |
| "type": "number" | |
| }, | |
| "amount": { | |
| "type": "number" | |
| }, | |
| "commission_type": { | |
| "type": "string" | |
| }, | |
| "approved": { | |
| "type": "boolean", | |
| "nullable": true | |
| }, | |
| "affiliate": { | |
| "$ref": "#/components/schemas/AffiliateInfoBasic" | |
| }, | |
| "kind": { | |
| "type": "string", | |
| "example": "regular" | |
| }, | |
| "currency": { | |
| "type": "string" | |
| }, | |
| "created_at": { | |
| "type": "string", | |
| "format": "date-time", | |
| "nullable": true | |
| }, | |
| "payout": { | |
| "type": "object", | |
| "nullable": true | |
| }, | |
| "comment": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "final": { | |
| "type": "object", | |
| "nullable": true | |
| }, | |
| "commission_name": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "ConversionCustomerInfo": { | |
| "type": "object", | |
| "nullable": true, | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "example": "cu_eXampl30th3r" | |
| }, | |
| "customer_id": { | |
| "type": "string", | |
| "example": "USER999" | |
| }, | |
| "status": { | |
| "type": "string", | |
| "example": "paying" | |
| } | |
| } | |
| }, | |
| "Conversion": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "integer", | |
| "example": 1 | |
| }, | |
| "external_id": { | |
| "type": "string", | |
| "nullable": true, | |
| "example": "ORD123" | |
| }, | |
| "amount": { | |
| "type": "number", | |
| "example": 550 | |
| }, | |
| "click": { | |
| "$ref": "#/components/schemas/ClickInfo" | |
| }, | |
| "commissions": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/components/schemas/CommissionInConversion" | |
| } | |
| }, | |
| "program": { | |
| "$ref": "#/components/schemas/ProgramInfoBasic" | |
| }, | |
| "affiliate": { | |
| "$ref": "#/components/schemas/AffiliateInfoBasic", | |
| "nullable": true | |
| }, | |
| "customer": { | |
| "$ref": "#/components/schemas/ConversionCustomerInfo" | |
| }, | |
| "affiliate_meta_data": { | |
| "$ref": "#/components/schemas/MetaData" | |
| }, | |
| "meta_data": { | |
| "$ref": "#/components/schemas/MetaData" | |
| }, | |
| "created_at": { | |
| "type": "string", | |
| "format": "date-time", | |
| "example": "2021-03-03T12:39:19+0000" | |
| }, | |
| "warnings": { | |
| "$ref": "#/components/schemas/Warnings" | |
| } | |
| } | |
| }, | |
| "ConversionList": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/components/schemas/Conversion" | |
| } | |
| }, | |
| "CreateConversionCommissionOverride": { | |
| "type": "object", | |
| "description": "Structure for overriding commissions. Details not fully specified in text, assuming basic fields.", | |
| "properties": { | |
| "amount": {"type": "number"}, | |
| "commission_type": {"type": "string"} | |
| } | |
| }, | |
| "CreateConversionRequest": { | |
| "type": "object", | |
| "properties": { | |
| "referral_code": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "tracking_id": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "click_id": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "coupon": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "currency": { | |
| "type": "string", | |
| "description": "Three letter ISO currency code. Overrides program default.", | |
| "nullable": true, | |
| "example": "EUR" | |
| }, | |
| "asset_id": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "source_id": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "external_id": { | |
| "type": "string", | |
| "description": "Unique ID for this conversion (e.g., order number).", | |
| "nullable": true | |
| }, | |
| "amount": { | |
| "type": "number", | |
| "description": "Conversion amount. Overridden if 'commissions' is set.", | |
| "nullable": true | |
| }, | |
| "customer_id": { | |
| "type": "string", | |
| "description": "Customer ID for recurring/lifetime commissions.", | |
| "nullable": true | |
| }, | |
| "commission_type": { | |
| "type": "string", | |
| "description": "Uses program default if not supplied.", | |
| "nullable": true | |
| }, | |
| "commissions": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/components/schemas/CreateConversionCommissionOverride" | |
| }, | |
| "description": "Overrides 'amount' and 'commission_type' if set.", | |
| "nullable": true | |
| }, | |
| "meta_data": { | |
| "$ref": "#/components/schemas/MetaData" | |
| }, | |
| "program_group": { | |
| "type": "string", | |
| "description": "The program group id.", | |
| "nullable": true | |
| }, | |
| "user_agent": { | |
| "type": "string", | |
| "nullable": true | |
| }, | |
| "ip": { | |
| "type": "string", | |
| "nullable": true | |
| } | |
| }, | |
| "description": "Use one of: referral code, customer_id, click id, coupon code, tracking id, or asset_id & source_id." | |
| }, | |
| "UpdateConversionRequest": { | |
| "type": "object", | |
| "properties": { | |
| "amount": { | |
| "type": "number", | |
| "description": "New amount for the conversion.", | |
| "nullable": true | |
| }, | |
| "external_id": { | |
| "type": "string", | |
| "description": "New unique id for this conversion.", | |
| "nullable": true | |
| }, | |
| "meta_data": { | |
| "$ref": "#/components/schemas/MetaData", | |
| "nullable": true | |
| } | |
| } | |
| }, | |
| "AddCommissionToConversionRequest": { | |
| "type": "object", | |
| "required": [ | |
| "conversion_sub_amount" | |
| ], | |
| "properties": { | |
| "conversion_sub_amount": { | |
| "type": "number", | |
| "description": "Amount on which commission should be calculated." | |
| }, | |
| "commission_type": { | |
| "type": "string", | |
| "description": "Uses program default if not supplied.", | |
| "nullable": true | |
| }, | |
| "comment": { | |
| "type": "string", | |
| "description": "Comment visible to affiliate.", | |
| "nullable": true | |
| } | |
| } | |
| }, | |
| "AddedCommissionResponseItem": { | |
| "type": "object", | |
| "properties": { | |
| "id": {"type": "integer"}, | |
| "conversion_sub_amount": {"type": "number"}, | |
| "amount": {"type": "number"}, | |
| "commission_type": {"type": "string"}, | |
| "approved": {"type": "boolean", "nullable": true}, | |
| "kind": {"type": "string"}, | |
| "affiliate": {"$ref": "#/components/schemas/AffiliateInfoBasic"}, | |
| "currency": {"type": "string"}, | |
| "created_at": {"type": "string", "format": "date-time", "nullable": true}, | |
| "payout": {"type": "object", "nullable": true}, | |
| "comment": {"type": "string", "nullable": true}, | |
| "final": {"type": "object", "nullable": true}, | |
| "commission_name": {"type": "string"} | |
| } | |
| }, | |
| "AddedCommissionResponse": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/components/schemas/AddedCommissionResponseItem" | |
| } | |
| }, | |
| "CommissionConversionInfo": { | |
| "type": "object", | |
| "nullable": true, | |
| "properties": { | |
| "id": { "type": "integer" } | |
| } | |
| }, | |
| "Commission": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "integer" }, | |
| "conversion_sub_amount": { "type": "number", "nullable": true }, | |
| "amount": { "type": "number" }, | |
| "commission_type": { "type": "string" }, | |
| "approved": { "type": "boolean", "nullable": true }, | |
| "affiliate": { "$ref": "#/components/schemas/AffiliateInfoBasic" }, | |
| "conversion": { "$ref": "#/components/schemas/CommissionConversionInfo" }, | |
| "kind": { "type": "string" }, | |
| "currency": { "type": "string" }, | |
| "created_at": { "type": "string", "format": "date-time", "nullable": true }, | |
| "payout": { "type": "object", "nullable": true }, | |
| "comment": { "type": "string", "nullable": true }, | |
| "final": { "type": "boolean", "nullable": true }, | |
| "finalization_date": { "type": "string", "format": "date-time", "nullable": true }, | |
| "commission_name": { "type": "string" } | |
| } | |
| }, | |
| "CommissionList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/Commission" } | |
| }, | |
| "UpdateCommissionRequest": { | |
| "type": "object", | |
| "properties": { | |
| "amount": { "type": "number", "nullable": true }, | |
| "comment": { "type": "string", "nullable": true }, | |
| "approved": { "type": "boolean", "nullable": true }, | |
| "conversion_sub_amount": { "type": "number", "nullable": true } | |
| } | |
| }, | |
| "AffiliateCustomFields": { | |
| "type": "object", | |
| "additionalProperties": { "type": "string" }, | |
| "nullable": true, | |
| "example": {"field1": "value1"} | |
| }, | |
| "Affiliate": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "firstname": { "type": "string" }, | |
| "lastname": { "type": "string" }, | |
| "email": { "type": "string", "format": "email" }, | |
| "password": { "type": "string", "nullable": true, "description": "Only returned when creating an affiliate if no password was provided by user (it's generated)." }, | |
| "company": { "$ref": "#/components/schemas/CompanyInfo" }, | |
| "address": { "$ref": "#/components/schemas/AddressInfo" }, | |
| "meta_data": { "$ref": "#/components/schemas/MetaData" }, | |
| "parent_id": { "type": "string", "nullable": true }, | |
| "affiliate_group_id": { "type": "string", "nullable": true }, | |
| "created_at": { "type": "string", "format": "date-time", "nullable": true }, | |
| "promoted_at": { "type": "string", "format": "date-time", "nullable": true }, | |
| "promotion_method": { "type": "string", "nullable": true }, | |
| "custom_fields": { "$ref": "#/components/schemas/AffiliateCustomFields" } | |
| } | |
| }, | |
| "AffiliateList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/Affiliate" } | |
| }, | |
| "CreateAffiliateRequestAddressCountry": { | |
| "type": "object", | |
| "required": ["code"], | |
| "properties": { | |
| "code": { "type": "string", "description": "Country ISO_3166-1 code." } | |
| } | |
| }, | |
| "CreateAffiliateRequestAddress": { | |
| "type": "object", | |
| "required": ["address", "postal_code", "city", "country"], | |
| "properties": { | |
| "address": { "type": "string" }, | |
| "postal_code": { "type": "string" }, | |
| "city": { "type": "string" }, | |
| "state": { "type": "string", "nullable": true }, | |
| "country": { "$ref": "#/components/schemas/CreateAffiliateRequestAddressCountry" } | |
| } | |
| }, | |
| "CreateAffiliateRequestCompany": { | |
| "type": "object", | |
| "properties": { | |
| "name": { "type": "string", "nullable": true }, | |
| "description": { "type": "string", "nullable": true } | |
| } | |
| }, | |
| "CreateAffiliateRequest": { | |
| "type": "object", | |
| "required": ["firstname", "lastname"], | |
| "properties": { | |
| "firstname": { "type": "string" }, | |
| "lastname": { "type": "string" }, | |
| "email": { "type": "string", "format": "email", "nullable": true }, | |
| "password": { "type": "string", "nullable": true, "description": "If not given, one is generated." }, | |
| "company": { "$ref": "#/components/schemas/CreateAffiliateRequestCompany", "nullable": true }, | |
| "address": { "$ref": "#/components/schemas/CreateAffiliateRequestAddress", "nullable": true }, | |
| "custom_fields": { "$ref": "#/components/schemas/AffiliateCustomFields", "nullable": true } | |
| } | |
| }, | |
| "SetAffiliateGroupRequest": { | |
| "type": "object", | |
| "required": ["group_id"], | |
| "properties": { | |
| "group_id": { "type": "string" } | |
| } | |
| }, | |
| "AffiliateNoteCreator": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "firstname": { "type": "string" }, | |
| "lastname": { "type": "string" } | |
| } | |
| }, | |
| "AffiliateNote": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "integer" }, | |
| "created_at": { "type": "string", "format": "date-time" }, | |
| "message": { "type": "string" }, | |
| "created_by": { "$ref": "#/components/schemas/AffiliateNoteCreator" } | |
| } | |
| }, | |
| "AffiliateNoteList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/AffiliateNote" } | |
| }, | |
| "CreateOrUpdateAffiliateNoteRequest": { | |
| "type": "object", | |
| "required": ["message"], | |
| "properties": { | |
| "message": { "type": "string" } | |
| } | |
| }, | |
| "MetaDataValueResponse": { | |
| "type": "object", | |
| "properties": { | |
| "value": { | |
| "description": "Value of the meta data key. Can be any type.", | |
| "example": "bar" | |
| } | |
| } | |
| }, | |
| "SetMetaDataKeyRequest": { | |
| "type": "object", | |
| "required": ["value"], | |
| "properties": { | |
| "value": { | |
| "description": "Value to set for the meta data key. Can be any type.", | |
| "example": "My value" | |
| } | |
| } | |
| }, | |
| "PayoutMethodDetails": { | |
| "type": "object", | |
| "additionalProperties": {}, | |
| "example": { "paypal_address": "[email protected]" } | |
| }, | |
| "PayoutMethod": { | |
| "type": "object", | |
| "properties": { | |
| "title": { "type": "string" }, | |
| "id": { "type": "string" }, | |
| "details": { "$ref": "#/components/schemas/PayoutMethodDetails" }, | |
| "primary": { "type": "boolean" } | |
| } | |
| }, | |
| "PayoutMethodList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/PayoutMethod" } | |
| }, | |
| "SetPayoutMethodRequest": { | |
| "type": "object", | |
| "additionalProperties": {}, | |
| "description": "Request body depends on the payout method. E.g. for PayPal: {\"paypal_address\": \"[email protected]\"}", | |
| "example": { "paypal_address": "[email protected]" } | |
| }, | |
| "SetParentAffiliateRequest": { | |
| "type": "object", | |
| "properties": { | |
| "affiliate_id": { "type": "string", "description": "The letter id of the parent affiliate.", "nullable": true }, | |
| "via": { "type": "string", "description": "The numeral id of the parent affiliate.", "nullable": true } | |
| }, | |
| "description": "Provide either affiliate_id or via." | |
| }, | |
| "AffiliateBalances": { | |
| "type": "object", | |
| "additionalProperties": { "type": "number" }, | |
| "description": "Balances per currency.", | |
| "example": { "USD": 5, "EUR": 35 } | |
| }, | |
| "AffiliatePaymentItem": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "created_at": { "type": "string", "format": "date-time" }, | |
| "affiliate": { "$ref": "#/components/schemas/AffiliateInfoBasic" }, | |
| "amount": { "type": "number" }, | |
| "currency": { "type": "string" } | |
| } | |
| }, | |
| "AffiliatePaymentList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/AffiliatePaymentItem" } | |
| }, | |
| "Affiliation": { | |
| "type": "object", | |
| "properties": { | |
| "applied_at": { "type": "string", "format": "date-time", "nullable": true }, | |
| "approved": { "type": "boolean", "nullable": true }, | |
| "coupon": { "type": "string", "nullable": true }, | |
| "id": { "type": "string", "description": "Program ID" }, | |
| "referral_link": { "$ref": "#/components/schemas/ReferralLinkInfo" }, | |
| "title": { "type": "string", "description": "Program Title" }, | |
| "assets_amount": { "type": "integer", "nullable": true } | |
| } | |
| }, | |
| "AffiliationList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/Affiliation" } | |
| }, | |
| "CustomFieldChoice": { | |
| "type": "object", | |
| "description": "Structure for choices if custom field is a dropdown/radio. Not detailed in text." | |
| }, | |
| "CustomFieldDefinition": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "title": { "type": "string" }, | |
| "choices": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/CustomFieldChoice" } | |
| } | |
| } | |
| }, | |
| "CustomFieldDefinitionList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/CustomFieldDefinition" } | |
| }, | |
| "AffiliateGroup": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "title": { "type": "string" }, | |
| "affiliate_count": { "type": "integer" } | |
| } | |
| }, | |
| "AffiliateGroupList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/AffiliateGroup" } | |
| }, | |
| "CreateAffiliateGroupRequest": { | |
| "type": "object", | |
| "required": ["title"], | |
| "properties": { | |
| "title": { "type": "string" } | |
| } | |
| }, | |
| "UpdateAffiliateGroupRequest": { | |
| "type": "object", | |
| "required": ["title"], | |
| "properties": { | |
| "title": { "type": "string" } | |
| } | |
| }, | |
| "AffiliateProspect": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "firstname": { "type": "string" }, | |
| "lastname": { "type": "string" }, | |
| "email": { "type": "string", "format": "email" }, | |
| "company": { "$ref": "#/components/schemas/CompanyInfo" }, | |
| "address": { "$ref": "#/components/schemas/AddressInfo" }, | |
| "signup_source": { "type": "string", "nullable": true }, | |
| "referral_link": { "$ref": "#/components/schemas/ReferralLinkInfo" }, | |
| "created_at": { "type": "string", "format": "date-time", "nullable": true }, | |
| "promoted_at": { "type": "string", "format": "date-time", "nullable": true }, | |
| "promotion_method": { "type": "string", "nullable": true } | |
| } | |
| }, | |
| "AffiliateProspectList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/AffiliateProspect" } | |
| }, | |
| "CreateAffiliateProspectRequest": { | |
| "type": "object", | |
| "required": ["firstname", "lastname"], | |
| "properties": { | |
| "firstname": { "type": "string" }, | |
| "lastname": { "type": "string" }, | |
| "email": { "type": "string", "format": "email", "nullable": true }, | |
| "company": { "$ref": "#/components/schemas/CreateAffiliateRequestCompany", "nullable": true }, | |
| "address": { "$ref": "#/components/schemas/CreateAffiliateRequestAddress", "nullable": true }, | |
| "program_id": { "type": "string", "nullable": true, "description": "Program to add prospect to. Defaults to default program if none passed." }, | |
| "affiliate_group_id": { "type": "string", "nullable": true, "description": "Affiliate group to add prospect to." } | |
| } | |
| }, | |
| "ProgramCategory": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "integer" }, | |
| "identifier": { "type": "string" }, | |
| "title": { "type": "string" }, | |
| "is_admitad_suitable": { "type": "boolean" } | |
| } | |
| }, | |
| "Program": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "currency": { "type": "string" }, | |
| "title": { "type": "string" }, | |
| "cookie_time": { "type": "integer", "description": "Cookie time in days." }, | |
| "default_landing_page_url": { "type": "string", "format": "url", "nullable": true }, | |
| "recurring": { "type": "boolean", "nullable": true }, | |
| "recurring_cap": { "type": "integer", "nullable": true }, | |
| "recurring_period_days": { "type": "integer", "nullable": true }, | |
| "program_category": { "$ref": "#/components/schemas/ProgramCategory", "nullable": true }, | |
| "currency_symbol": { "type": "string", "nullable": true } | |
| } | |
| }, | |
| "ProgramList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/Program" } | |
| }, | |
| "ProgramAffiliate": { | |
| "type": "object", | |
| "allOf": [ { "$ref": "#/components/schemas/Affiliate" } ], | |
| "properties": { | |
| "referral_link": { "$ref": "#/components/schemas/ReferralLinkInfo" }, | |
| "coupon": { "type": "string", "nullable": true }, | |
| "approved": { "type": "boolean", "nullable": true }, | |
| "applied_at": { "type": "string", "format": "date-time", "nullable": true } | |
| } | |
| }, | |
| "ProgramAffiliateList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/ProgramAffiliate" } | |
| }, | |
| "AddAffiliateToProgramRequestAffiliate": { | |
| "type": "object", | |
| "required": ["id"], | |
| "properties": { | |
| "id": { "type": "string", "description": "ID of the affiliate." } | |
| } | |
| }, | |
| "AddAffiliateToProgramRequest": { | |
| "type": "object", | |
| "required": ["affiliate"], | |
| "properties": { | |
| "affiliate": { "$ref": "#/components/schemas/AddAffiliateToProgramRequestAffiliate" }, | |
| "approved": { "type": "boolean", "nullable": true, "description": "true (Approved, default) | false (Disapproved) | null (Pending)" }, | |
| "coupon": { "type": "string", "nullable": true, "description": "Optional coupon for this affiliate." } | |
| } | |
| }, | |
| "UpdateAffiliateInProgramRequest": { | |
| "type": "object", | |
| "required": ["coupon"], | |
| "properties": { | |
| "coupon": { "type": "string", "description": "The affiliate's coupon code for this program." } | |
| } | |
| }, | |
| "ProgramCommissionTypeOverride": { | |
| "type": "object", | |
| "properties": { | |
| "commission_form": { "type": "string" }, | |
| "commission_value": { "type": "number" }, | |
| "affiliate_group_id": { "type": "string" } | |
| } | |
| }, | |
| "ProgramCommissionType": { | |
| "type": "object", | |
| "properties": { | |
| "title": { "type": "string" }, | |
| "commission_form": { "type": "string", "description": "e.g., percentage, fixed" }, | |
| "affiliate_group_overrides": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/ProgramCommissionTypeOverride" }, | |
| "nullable": true | |
| }, | |
| "identifier": { "type": "string" }, | |
| "commission_value": { "type": "number" }, | |
| "recurrence": { "type": "string", "description": "e.g., once" }, | |
| "visible": { "type": "boolean" }, | |
| "count_towards_cap": { "type": "boolean" } | |
| } | |
| }, | |
| "ProgramCommissionTypeList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/ProgramCommissionType" } | |
| }, | |
| "ProgramMlmLevel": { | |
| "type": "object", | |
| "properties": { | |
| "title": { "type": "string" }, | |
| "commission_form": { "type": "string" }, | |
| "identifier": { "type": "string" }, | |
| "commission_value": { "type": "number" } | |
| } | |
| }, | |
| "ProgramMlmLevelList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/ProgramMlmLevel" } | |
| }, | |
| "ProgramBonus": { | |
| "type": "object", | |
| "properties": { | |
| "title": { "type": "string" }, | |
| "commission_form": { "type": "string" }, | |
| "identifier": { "type": "string" }, | |
| "interval": { "type": "string", "description": "e.g., calmo (calendar month)" }, | |
| "target_type": { "type": "string", "description": "e.g., conversion_count" }, | |
| "active": { "type": "boolean" }, | |
| "start_date": { "type": "string", "format": "date", "nullable": true }, | |
| "end_date": { "type": "string", "format": "date", "nullable": true } | |
| } | |
| }, | |
| "ProgramBonusList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/ProgramBonus" } | |
| }, | |
| "BalanceEntry": { | |
| "type": "object", | |
| "properties": { | |
| "affiliate_id": { "type": "string" }, | |
| "balances": { "$ref": "#/components/schemas/AffiliateBalances" } | |
| } | |
| }, | |
| "BalanceList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/BalanceEntry" } | |
| }, | |
| "Payment": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string" }, | |
| "created_at": { "type": "string", "format": "date-time" }, | |
| "affiliate": { "$ref": "#/components/schemas/AffiliateInfoBasic" }, | |
| "amount": { "type": "number" }, | |
| "currency": { "type": "string" } | |
| } | |
| }, | |
| "PaymentList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/Payment" } | |
| }, | |
| "CreatePaymentRequestBody": { | |
| "type": "object", | |
| "required": ["affiliate_id", "amount", "currency"], | |
| "properties": { | |
| "affiliate_id": { "type": "string" }, | |
| "amount": { "type": "number" }, | |
| "currency": { "type": "string" } | |
| } | |
| }, | |
| "CreatePaymentRequest": { | |
| "oneOf": [ | |
| { "$ref": "#/components/schemas/CreatePaymentRequestBody" }, | |
| { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/CreatePaymentRequestBody" } | |
| } | |
| ], | |
| "description": "Can be a single payment object or an array of payment objects." | |
| }, | |
| "ClickMetaDataItem": { | |
| "type": "object", | |
| "properties": { | |
| "key": { "type": "string" }, | |
| "value": { "type": "string" } | |
| } | |
| }, | |
| "ClickDetails": { | |
| "type": "object", | |
| "properties": { | |
| "os": { "type": "string", "nullable": true }, | |
| "os_version": { "type": "string", "nullable": true }, | |
| "browser": { "type": "string", "nullable": true }, | |
| "browser_version": { "type": "string", "nullable": true }, | |
| "referrer": { "type": "string", "format": "url", "nullable": true }, | |
| "platform": { "type": "string", "nullable": true }, | |
| "landing_page_url": { "type": "string", "format": "url", "nullable": true } | |
| } | |
| }, | |
| "ClickGeolocation": { | |
| "type": "object", | |
| "properties": { | |
| "country": { "type": "string", "nullable": true } | |
| } | |
| }, | |
| "Click": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string", "format": "uuid" }, | |
| "created_at": { "type": "string", "format": "date-time" }, | |
| "meta_data": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/ClickMetaDataItem" }, | |
| "nullable": true | |
| }, | |
| "details": { "$ref": "#/components/schemas/ClickDetails", "nullable": true }, | |
| "geolocation": { "$ref": "#/components/schemas/ClickGeolocation", "nullable": true } | |
| } | |
| }, | |
| "ClickList": { | |
| "type": "array", | |
| "items": { "$ref": "#/components/schemas/Click" } | |
| }, | |
| "CreateClickRequest": { | |
| "type": "object", | |
| "required": ["referral_code"], | |
| "properties": { | |
| "referral_code": { "type": "string", "description": "Affiliate's referral code." }, | |
| "source_id": { "type": "string", "nullable": true, "description": "Source ID used by affiliate." }, | |
| "meta_data": { | |
| "type": "object", | |
| "additionalProperties": { "type": "string" }, | |
| "description": "Key-value pairs of meta data.", | |
| "nullable": true, | |
| "example": {"key": "value"} | |
| }, | |
| "referrer": { "type": "string", "format": "url", "nullable": true, "description": "HTTP referrer." }, | |
| "landing_page": { "type": "string", "format": "url", "nullable": true, "description": "Current page URL." }, | |
| "user_agent": { "type": "string", "nullable": true, "description": "Full user agent string." }, | |
| "ip": { "type": "string", "nullable": true, "description": "User IP address." } | |
| } | |
| }, | |
| "CreateClickResponse": { | |
| "type": "object", | |
| "properties": { | |
| "id": { "type": "string", "format": "uuid", "description": "The Click ID." } | |
| } | |
| }, | |
| "Error": { | |
| "type": "object", | |
| "properties": { | |
| "message": { "type": "string" }, | |
| "errors": { "type": "object", "additionalProperties": true } | |
| } | |
| } | |
| }, | |
| "parameters": { | |
| "PageParam": { | |
| "name": "page", | |
| "in": "query", | |
| "description": "Page number for paginated results (1-based).", | |
| "required": false, | |
| "schema": { | |
| "type": "integer", | |
| "minimum": 1 | |
| } | |
| }, | |
| "CustomerIdPath": { | |
| "name": "id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The Tapfiliate generated id of the Customer.", | |
| "schema": { "type": "string" }, | |
| "example": "cu_eXampl3" | |
| }, | |
| "MetaDataKeyPath": { | |
| "name": "key", | |
| "in": "path", | |
| "required": true, | |
| "description": "The meta data key.", | |
| "schema": { "type": "string" }, | |
| "example": "foo" | |
| }, | |
| "ConversionIdPath": { | |
| "name": "conversion_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "Numeric id of the conversion.", | |
| "schema": { "type": "integer" }, | |
| "example": 1 | |
| }, | |
| "CommissionIdPath": { | |
| "name": "commission_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "Numeric id of the commission.", | |
| "schema": { "type": "integer" }, | |
| "example": 1 | |
| }, | |
| "AffiliateIdPath": { | |
| "name": "affiliate_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the affiliate.", | |
| "schema": { "type": "string" }, | |
| "example": "janejameson" | |
| }, | |
| "AffiliateNoteIdPath": { | |
| "name": "id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the note.", | |
| "schema": { "type": "integer" }, | |
| "example": 1 | |
| }, | |
| "PayoutMethodIdPath": { | |
| "name": "payout_method_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the payout method.", | |
| "schema": { "type": "string" }, | |
| "example": "paypal" | |
| }, | |
| "ChildAffiliateIdPath": { | |
| "name": "child_affiliate_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the child affiliate.", | |
| "schema": { "type": "string" }, | |
| "example": "janejameson" | |
| }, | |
| "AffiliateIdForProgramsPath": { | |
| "name": "id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the affiliate (used in /affiliates/{id}/programs/).", | |
| "schema": { "type": "string" }, | |
| "example": "u_JaN3-J0n" | |
| }, | |
| "AffiliateGroupIdPath": { | |
| "name": "affiliate_group_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the affiliate group.", | |
| "schema": { "type": "string" }, | |
| "example": "ag_eXampl3" | |
| }, | |
| "AffiliateProspectIdPath": { | |
| "name": "affiliate_prospect_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the affiliate prospect.", | |
| "schema": { "type": "string" }, | |
| "example": "peterpeterson" | |
| }, | |
| "ProgramIdPath": { | |
| "name": "program_id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the Program.", | |
| "schema": { "type": "string" }, | |
| "example": "johns-affiliate-program" | |
| }, | |
| "PaymentIdPath": { | |
| "name": "id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the payment.", | |
| "schema": { "type": "string" }, | |
| "example": "pa_eXampl3" | |
| }, | |
| "ClickIdPath": { | |
| "name": "id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The id of the click.", | |
| "schema": { "type": "string", "format": "uuid" }, | |
| "example": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" | |
| } | |
| } | |
| }, | |
| "security": [ | |
| { | |
| "ApiKeyAuth": [] | |
| } | |
| ], | |
| "paths": { | |
| "/customers/{id}/": { | |
| "get": { | |
| "summary": "Retrieve a Customer", | |
| "operationId": "getCustomerById", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved customer.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Customer" }, | |
| "example": { "id": "cu_eXampl3", "customer_id": "USER123", "status": "trial", "created_at": "2021-07-02T09:55:20+00:00", "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "foo": "bar" }, "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "patch": { | |
| "summary": "Update a Customer", | |
| "operationId": "updateCustomerById", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/UpdateCustomerRequest" }, | |
| "example": { "customer_id": "USER456", "meta_data": { "buz": "baz" } } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully updated customer.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Customer" }, | |
| "example": { "id": "cu_eXampl3", "customer_id": "USER456", "status": "trial", "created_at": "2021-07-02T09:55:20+00:00", "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "buz": "baz" }, "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete a Customer", | |
| "operationId": "deleteCustomerById", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "responses": { | |
| "204": { | |
| "description": "Successfully deleted customer." | |
| } | |
| } | |
| } | |
| }, | |
| "/customers/": { | |
| "get": { | |
| "summary": "List all Customers", | |
| "operationId": "listCustomers", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "program_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "johns-affiliate-program" }, | |
| { "name": "customer_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "USER123" }, | |
| { "name": "affiliate_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "janejameson" }, | |
| { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "example": "2022-01-01" }, | |
| { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "example": "2025-12-31" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of customers.", | |
| "headers": { | |
| "Link": { "description": "Pagination links.", "schema": { "type": "string" } }, | |
| "X-Ratelimit-Limit": { "description": "Total allowed requests.", "schema": { "type": "integer" } }, | |
| "X-Ratelimit-Remaining": { "description": "Remaining requests.", "schema": { "type": "integer" } }, | |
| "X-Ratelimit-Reset": { "description": "Timestamp for rate limit reset.", "schema": { "type": "integer" } } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/CustomerList" }, | |
| "example": [{ "id": "cu_eXampl3", "customer_id": "USER123", "status": "trial", "created_at": "2021-07-02T09:55:20+00:00", "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "foo": "bar" }, "warnings": null }] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create a Customer", | |
| "operationId": "createCustomer", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "name": "override_max_cookie_time", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/CreateCustomerRequest" }, | |
| "example": { "coupon": "JANE10OFF", "customer_id": "USER789", "status": "trial", "meta_data": { "tim": "tam" }, "user_agent": "Mozilla/5.0...", "ip": "111.11.11.111" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully created customer.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Customer" }, | |
| "example": { "id": "cu_0Th3r", "customer_id": "USER789", "status": "trial", "created_at": "2021-07-02T09:55:20+00:00", "click": null, "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "affiliate_meta_data": null, "meta_data": { "tim": "tam" }, "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/customers/{id}/status/": { | |
| "delete": { | |
| "summary": "Cancel a customer", | |
| "operationId": "cancelCustomerStatus", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Customer status changed to canceled.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Customer" }, | |
| "example": { "id": "cu_eXampl3Pay1ng", "customer_id": "USER666", "status": "canceled", "created_at": "2021-07-02T09:55:20+00:00", "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "foo": "bar" }, "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Uncancel a customer", | |
| "operationId": "uncancelCustomerStatus", | |
| "tags": ["Customers"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Customer status reverted from canceled.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Customer" }, | |
| "example": { "id": "cu_eXampl3Pay1ng", "customer_id": "USER666", "status": "paying", "created_at": "2021-07-02T09:55:20+00:00", "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "foo": "bar" }, "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/customers/{id}/meta-data/": { | |
| "get": { | |
| "summary": "Retrieve customer meta data", | |
| "operationId": "getCustomerMetaData", | |
| "tags": ["Customers", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Customer's meta data.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/MetaData" }, | |
| "example": { "foo": "bar" } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Update (replace) customer meta data", | |
| "operationId": "updateCustomerMetaData", | |
| "tags": ["Customers", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/MetaData" }, | |
| "example": { "foo": "bar", "baz": "qux" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully updated meta data.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/MetaData" }, | |
| "example": { "foo": "bar", "baz": "qux" } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/customers/{id}/meta-data/{key}/": { | |
| "get": { | |
| "summary": "Retrieve customer meta data by key", | |
| "operationId": "getCustomerMetaDataByKey", | |
| "tags": ["Customers", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Value of the meta data key.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/MetaDataValueResponse" }, | |
| "example": { "value": "bar" } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Set customer meta data by key", | |
| "operationId": "setCustomerMetaDataByKey", | |
| "tags": ["Customers", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/SetMetaDataKeyRequest" }, | |
| "example": { "value": "bar" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully set meta data for key.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/MetaDataValueResponse" }, | |
| "example": { "value": "bar" } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete customer meta data by key", | |
| "operationId": "deleteCustomerMetaDataByKey", | |
| "tags": ["Customers", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/CustomerIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "responses": { | |
| "204": { | |
| "description": "Successfully deleted meta data for key." | |
| } | |
| } | |
| } | |
| }, | |
| "/conversions/{conversion_id}/": { | |
| "get": { | |
| "summary": "Retrieve a Conversion", | |
| "operationId": "getConversionById", | |
| "tags": ["Conversions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved conversion.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Conversion" }, | |
| "example": { "id": 1, "external_id": "ORD123", "amount": 550, "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "commissions": [ { "id": 1, "conversion_sub_amount": 550, "amount": 55, "commission_type": "standard", "approved": true, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "kind": "regular", "currency": "USD", "created_at": null, "payout": null, "comment": null, "final": null, "commission_name": "standard" } ], "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "customer": { "id": "cu_eXampl30th3r", "customer_id": "USER999", "status": "paying" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "foo": "bar", "tap": "awesome" }, "created_at": "2021-03-03T12:39:19+0000", "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "patch": { | |
| "summary": "Update a Conversion", | |
| "operationId": "updateConversionById", | |
| "tags": ["Conversions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" }, | |
| { "name": "recalculate_commissions", "in": "query", "required": false, "schema": { "type": "boolean", "default": false }, "description": "Also re-calculate commissions when changing the Conversion amount." } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/UpdateConversionRequest" }, | |
| "example": { "amount": 17.95, "external_id": "ORD123", "meta_data": { "baz": "qux" } } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully updated conversion.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Conversion" }, | |
| "example": { "id": 1, "external_id": "ORD123", "amount": 17.95, "click": { "created_at": "2021-03-03T12:39:19+0000", "referrer": "https://example-blog.inc/check-out-johns-product/", "landing_page": "https://tapper.inc/johns-cool-product/" }, "commissions": [ { "id": 1, "conversion_sub_amount": 550, "amount": 55, "commission_type": "standard", "approved": true, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "kind": "regular", "currency": "USD", "created_at": null, "payout": null, "comment": null, "final": null, "commission_name": "standard" } ], "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "customer": { "id": "cu_eXampl30th3r", "customer_id": "USER999", "status": "paying" }, "affiliate_meta_data": { "subid1": "baz" }, "meta_data": { "baz": "qux" }, "created_at": "2021-03-03T12:39:19+0000", "warnings": null } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete a Conversion", | |
| "operationId": "deleteConversionById", | |
| "tags": ["Conversions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" } | |
| ], | |
| "responses": { | |
| "204": { | |
| "description": "Successfully deleted conversion." | |
| } | |
| } | |
| } | |
| }, | |
| "/conversions/": { | |
| "get": { | |
| "summary": "List all conversions", | |
| "operationId": "listConversions", | |
| "tags": ["Conversions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "program_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "johns-affiliate-program" }, | |
| { "name": "external_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "ORD123" }, | |
| { "name": "affiliate_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "janejameson" }, | |
| { "name": "pending", "in": "query", "required": false, "schema": { "type": "boolean" }, "example": false, "description": "Only show conversions that have pending commissions." }, | |
| { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "example": "2022-01-01" }, | |
| { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "example": "2025-12-31" }, | |
| { "name": "use_profile_timezone", "in": "query", "required": false, "schema": { "type": "boolean" }, "example": false, "description": "Use profile timezone for date filtering." } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of conversions.", | |
| "headers": { | |
| "Link": { "description": "Pagination links.", "schema": { "type": "string" } }, | |
| "X-Ratelimit-Limit": { "description": "Total allowed requests.", "schema": { "type": "integer" } }, | |
| "X-Ratelimit-Remaining": { "description": "Remaining requests.", "schema": { "type": "integer" } }, | |
| "X-Ratelimit-Reset": { "description": "Timestamp for rate limit reset.", "schema": { "type": "integer" } } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/ConversionList" } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create a conversion", | |
| "operationId": "createConversion", | |
| "tags": ["Conversions"], | |
| "parameters": [ | |
| { "name": "override_max_cookie_time", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/CreateConversionRequest" }, | |
| "example": { "coupon": "JANE10OFF", "external_id": "ORD005", "amount": 100, "currency": "EUR", "meta_data": { "foo": "bar" }, "program_group": "my-group", "user_agent": "Mozilla/5.0...", "ip": "111.11.11.111" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully created conversion.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/Conversion" }, | |
| "example": { "id": 2, "external_id": "ORD005", "amount": 100, "click": null, "commissions": [ { "id": 2, "conversion_sub_amount": 100, "amount": 10, "commission_type": "standard", "approved": null, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "kind": "regular", "currency": "EUR", "created_at": "2021-03-03T12:39:19+0000", "payout": null, "comment": null, "final": null, "commission_name": "standard" }, { "id": 3, "conversion_sub_amount": 100, "amount": 5, "commission_type": "level-2", "approved": null, "kind": "level", "affiliate": { "id": "sandrasanderson", "firstname": "Sandra", "lastname": "Sanderson" }, "currency": "EUR", "created_at": "2021-03-03T12:39:19+0000", "payout": null, "comment": null, "final": null, "commission_name": "Level 2" } ], "program": { "id": "johns-affiliate-program", "title": "John's affiliate program", "currency": "USD" }, "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "customer": null, "meta_data": { "foo": "bar" }, "created_at": "2021-03-03T12:39:19+0000", "warnings": null, "affiliate_meta_data": null } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/conversions/{conversion_id}/commissions/": { | |
| "post": { | |
| "summary": "Add commissions to a conversion", | |
| "operationId": "addCommissionsToConversion", | |
| "tags": ["Conversions", "Commissions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/AddCommissionToConversionRequest" }, | |
| "example": { "conversion_sub_amount": 50, "commission_type": "mycommissiontype", "comment": "Awesome!" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully added commissions.", | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/AddedCommissionResponse" }, | |
| "example": [ { "id": 3, "conversion_sub_amount": 20, "amount": 2, "commission_type": "standard", "approved": null, "kind": "regular", "affiliate": { "id": "janejameson", "firstname": "Jane", "lastname": "Jameson" }, "currency": "USD", "created_at": "2021-03-03T12:39:19+0000", "payout": null, "comment": "Awesome!", "final": null, "commission_name": "standard" }, { "id": 4, "conversion_sub_amount": 20, "amount": 1, "commission_type": "level-2", "approved": null, "kind": "level", "affiliate": { "id": "sandrasanderson", "firstname": "Sandra", "lastname": "Sanderson" }, "currency": "USD", "created_at": "2021-03-03T12:39:19+0000", "payout": null, "comment": null, "final": null, "commission_name": "Level 2" } ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/conversions/{conversion_id}/meta-data/": { | |
| "get": { | |
| "summary": "Retrieve conversion meta data", | |
| "operationId": "getConversionMetaData", | |
| "tags": ["Conversions", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Conversion's meta data.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaData" }, "example": {"foo": "bar", "tap": "awesome"} } } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Update (replace) conversion meta data", | |
| "operationId": "updateConversionMetaData", | |
| "tags": ["Conversions", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaData" }, "example": {"foo": "bar", "baz": "qux"} } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully updated meta data.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaData" }, "example": {"foo": "bar", "baz": "qux"} } } | |
| } | |
| } | |
| } | |
| }, | |
| "/conversions/{conversion_id}/meta-data/{key}/": { | |
| "get": { | |
| "summary": "Retrieve conversion meta data by key", | |
| "operationId": "getConversionMetaDataByKey", | |
| "tags": ["Conversions", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Value of the meta data key.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaDataValueResponse" }, "example": {"value": "bar"} } } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Set conversion meta data by key", | |
| "operationId": "setConversionMetaDataByKey", | |
| "tags": ["Conversions", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetMetaDataKeyRequest" }, "example": {"value": "bar"} } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully set meta data for key.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaDataValueResponse" }, "example": {"value": "bar"} } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete conversion meta data by key", | |
| "operationId": "deleteConversionMetaDataByKey", | |
| "tags": ["Conversions", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ConversionIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "responses": { | |
| "204": { "description": "Successfully deleted meta data for key." } | |
| } | |
| } | |
| }, | |
| "/commissions/{commission_id}/": { | |
| "get": { | |
| "summary": "Retrieve a commission", | |
| "operationId": "getCommissionById", | |
| "tags": ["Commissions"], | |
| "parameters": [ { "$ref": "#/components/parameters/CommissionIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved commission.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Commission" } } } | |
| } | |
| } | |
| }, | |
| "patch": { | |
| "summary": "Update a commission", | |
| "operationId": "updateCommissionById", | |
| "tags": ["Commissions"], | |
| "parameters": [ { "$ref": "#/components/parameters/CommissionIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCommissionRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully updated commission.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Commission" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/commissions/": { | |
| "get": { | |
| "summary": "List all commissions", | |
| "operationId": "listCommissions", | |
| "tags": ["Commissions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "affiliate_id", "in": "query", "required": false, "schema": { "type": "string" }, "example": "janejameson" }, | |
| { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": ["approved", "disapproved", "pending"] }, "example": "approved" }, | |
| { "name": "paid", "in": "query", "required": false, "schema": { "type": "boolean" }, "example": false, "description": "Filter by paid status (true for paid, false for unpaid)." } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of commissions.", | |
| "headers": { | |
| "Link": { "description": "Pagination links.", "schema": { "type": "string" } } | |
| }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommissionList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/commissions/{commission_id}/approved/": { | |
| "put": { | |
| "summary": "Approve a commission", | |
| "operationId": "approveCommission", | |
| "tags": ["Commissions"], | |
| "parameters": [ { "$ref": "#/components/parameters/CommissionIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Commission approved.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Commission" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Disapprove a commission", | |
| "operationId": "disapproveCommission", | |
| "tags": ["Commissions"], | |
| "parameters": [ { "$ref": "#/components/parameters/CommissionIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Commission disapproved.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Commission" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/": { | |
| "get": { | |
| "summary": "Retrieve an affiliate", | |
| "operationId": "getAffiliateById", | |
| "tags": ["Affiliates"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved affiliate.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Affiliate" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete an affiliate", | |
| "operationId": "deleteAffiliateById", | |
| "tags": ["Affiliates"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "responses": { | |
| "204": { "description": "Successfully deleted affiliate." } | |
| } | |
| } | |
| }, | |
| "/affiliates/": { | |
| "get": { | |
| "summary": "List all affiliates", | |
| "operationId": "listAffiliates", | |
| "tags": ["Affiliates"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "click_id", "in": "query", "required": false, "schema": { "type": "string", "format": "uuid" } }, | |
| { "name": "source_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "email", "in": "query", "required": false, "schema": { "type": "string", "format": "email" } }, | |
| { "name": "referral_code", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "parent_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "affiliate_group_id", "in": "query", "required": false, "schema": { "type": "string" } } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of affiliates.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create an affiliate", | |
| "operationId": "createAffiliate", | |
| "tags": ["Affiliates"], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAffiliateRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully created affiliate.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Affiliate" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/group/": { | |
| "put": { | |
| "summary": "Set affiliate group", | |
| "operationId": "setAffiliateGroup", | |
| "tags": ["Affiliates", "Affiliate Groups"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetAffiliateGroupRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate group set successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Affiliate" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Remove affiliate group", | |
| "operationId": "removeAffiliateGroup", | |
| "tags": ["Affiliates", "Affiliate Groups"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "responses": { | |
| "204": { "description": "Affiliate group removed successfully." } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/notes/{id}/": { | |
| "put": { | |
| "summary": "Update note", | |
| "operationId": "updateAffiliateNote", | |
| "tags": ["Affiliates", "Notes"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/AffiliateNoteIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateAffiliateNoteRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Note updated successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateNote" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete note", | |
| "operationId": "deleteAffiliateNote", | |
| "tags": ["Affiliates", "Notes"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/AffiliateNoteIdPath" } | |
| ], | |
| "responses": { | |
| "204": { "description": "Note deleted successfully." } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/notes/": { | |
| "get": { | |
| "summary": "List notes for an affiliate", | |
| "operationId": "listAffiliateNotes", | |
| "tags": ["Affiliates", "Notes"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of notes.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateNoteList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create note for an affiliate", | |
| "operationId": "createAffiliateNote", | |
| "tags": ["Affiliates", "Notes"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateAffiliateNoteRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Note created successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateNote" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/meta-data/": { | |
| "get": { | |
| "summary": "Retrieve affiliate meta data", | |
| "operationId": "getAffiliateMetaData", | |
| "tags": ["Affiliates", "Meta Data"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate's meta data.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaData" } } } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Update (replace) affiliate meta data", | |
| "operationId": "updateAffiliateMetaData", | |
| "tags": ["Affiliates", "Meta Data"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaData" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully updated meta data.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaData" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/meta-data/{key}/": { | |
| "get": { | |
| "summary": "Retrieve affiliate meta data by key", | |
| "operationId": "getAffiliateMetaDataByKey", | |
| "tags": ["Affiliates", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Value of the meta data key.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaDataValueResponse" } } } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Set affiliate meta data by key", | |
| "operationId": "setAffiliateMetaDataByKey", | |
| "tags": ["Affiliates", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetMetaDataKeyRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Successfully set meta data for key.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetaDataValueResponse" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete affiliate meta data by key", | |
| "operationId": "deleteAffiliateMetaDataByKey", | |
| "tags": ["Affiliates", "Meta Data"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/MetaDataKeyPath" } | |
| ], | |
| "responses": { | |
| "204": { "description": "Successfully deleted meta data for key." } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/payout-methods/{payout_method_id}/": { | |
| "get": { | |
| "summary": "Get payout method for an affiliate", | |
| "operationId": "getAffiliatePayoutMethod", | |
| "tags": ["Affiliates", "Payout Methods"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/PayoutMethodIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Payout method details.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PayoutMethod" } } } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "summary": "Set payout method for an affiliate", | |
| "operationId": "setAffiliatePayoutMethod", | |
| "tags": ["Affiliates", "Payout Methods"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/PayoutMethodIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetPayoutMethodRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Payout method set successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PayoutMethod" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/payout-methods/": { | |
| "get": { | |
| "summary": "List payout methods for an affiliate", | |
| "operationId": "listAffiliatePayoutMethods", | |
| "tags": ["Affiliates", "Payout Methods"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of payout methods.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PayoutMethodList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{child_affiliate_id}/parent/": { | |
| "post": { | |
| "summary": "Set parent affiliate (MLM)", | |
| "operationId": "setParentAffiliate", | |
| "tags": ["Affiliates", "MLM"], | |
| "parameters": [ { "$ref": "#/components/parameters/ChildAffiliateIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetParentAffiliateRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Parent affiliate set successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Affiliate" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Remove parent affiliate (MLM)", | |
| "operationId": "removeParentAffiliate", | |
| "tags": ["Affiliates", "MLM"], | |
| "parameters": [ { "$ref": "#/components/parameters/ChildAffiliateIdPath" } ], | |
| "responses": { | |
| "204": { "description": "Parent affiliate removed successfully." } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/balances/": { | |
| "get": { | |
| "summary": "Retrieve affiliate's balances", | |
| "operationId": "getAffiliateBalances", | |
| "tags": ["Affiliates", "Balances", "Payments (New System)"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate's balances by currency.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateBalances" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{affiliate_id}/payments/": { | |
| "get": { | |
| "summary": "List affiliate's payments", | |
| "operationId": "listAffiliatePayments", | |
| "tags": ["Affiliates", "Payments (New System)"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of payments for the affiliate.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliatePaymentList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/{id}/programs/": { | |
| "get": { | |
| "summary": "Get affiliate's program affiliations", | |
| "operationId": "getAffiliatePrograms", | |
| "tags": ["Affiliates", "Programs"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/AffiliateIdForProgramsPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of programs the affiliate is part of.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliationList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliates/custom-fields/": { | |
| "get": { | |
| "summary": "Get custom field definitions for affiliates", | |
| "operationId": "getAffiliateCustomFields", | |
| "tags": ["Affiliates", "Custom Fields"], | |
| "responses": { | |
| "200": { | |
| "description": "A list of custom field definitions.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomFieldDefinitionList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliate-groups/": { | |
| "get": { | |
| "summary": "List all affiliate groups", | |
| "operationId": "listAffiliateGroups", | |
| "tags": ["Affiliate Groups"], | |
| "parameters": [ { "$ref": "#/components/parameters/PageParam" } ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of affiliate groups.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateGroupList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create new affiliate group", | |
| "operationId": "createAffiliateGroup", | |
| "tags": ["Affiliate Groups"], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAffiliateGroupRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate group created successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateGroup" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliate-groups/{affiliate_group_id}/": { | |
| "patch": { | |
| "summary": "Update affiliate group", | |
| "operationId": "updateAffiliateGroup", | |
| "tags": ["Affiliate Groups"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateGroupIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAffiliateGroupRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate group updated successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateGroup" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliate-prospects/": { | |
| "get": { | |
| "summary": "List all affiliate prospects", | |
| "operationId": "listAffiliateProspects", | |
| "tags": ["Affiliate Prospects"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "email", "in": "query", "required": false, "schema": { "type": "string", "format": "email" } }, | |
| { "name": "referral_code", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "program_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "group_id", "in": "query", "required": false, "schema": { "type": "string", "description": "Affiliate group ID." } } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of affiliate prospects.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateProspectList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create an affiliate prospect", | |
| "operationId": "createAffiliateProspect", | |
| "tags": ["Affiliate Prospects"], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAffiliateProspectRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate prospect created successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateProspect" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/affiliate-prospects/{affiliate_prospect_id}/": { | |
| "get": { | |
| "summary": "Retrieve an affiliate prospect", | |
| "operationId": "getAffiliateProspectById", | |
| "tags": ["Affiliate Prospects"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateProspectIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved affiliate prospect.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AffiliateProspect" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Delete an affiliate prospect", | |
| "operationId": "deleteAffiliateProspectById", | |
| "tags": ["Affiliate Prospects"], | |
| "parameters": [ { "$ref": "#/components/parameters/AffiliateProspectIdPath" } ], | |
| "responses": { | |
| "204": { "description": "Successfully deleted affiliate prospect." } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/": { | |
| "get": { | |
| "summary": "Retrieve a Program", | |
| "operationId": "getProgramById", | |
| "tags": ["Programs"], | |
| "parameters": [ { "$ref": "#/components/parameters/ProgramIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved program.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Program" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/": { | |
| "get": { | |
| "summary": "List all programs", | |
| "operationId": "listPrograms", | |
| "tags": ["Programs"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "asset_id", "in": "query", "required": false, "schema": { "type": "string" } } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of programs.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/affiliates/": { | |
| "get": { | |
| "summary": "List all affiliates in program", | |
| "operationId": "listProgramAffiliates", | |
| "tags": ["Programs", "Affiliates"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "source_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "email", "in": "query", "required": false, "schema": { "type": "string", "format": "email" } }, | |
| { "name": "parent_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "affiliate_group_id", "in": "query", "required": false, "schema": { "type": "string" } } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of affiliates in the program.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramAffiliateList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Add an affiliate to a program", | |
| "operationId": "addAffiliateToProgram", | |
| "tags": ["Programs", "Affiliates"], | |
| "parameters": [ { "$ref": "#/components/parameters/ProgramIdPath" } ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddAffiliateToProgramRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate added to program successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramAffiliate" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/affiliates/{affiliate_id}/": { | |
| "get": { | |
| "summary": "Retrieve an affiliate in a program", | |
| "operationId": "getAffiliateInProgram", | |
| "tags": ["Programs", "Affiliates"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/AffiliateIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate details within the program context.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramAffiliate" } } } | |
| } | |
| } | |
| }, | |
| "patch": { | |
| "summary": "Update an affiliate in a program", | |
| "operationId": "updateAffiliateInProgram", | |
| "tags": ["Programs", "Affiliates"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/AffiliateIdPath" } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAffiliateInProgramRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate details updated successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramAffiliate" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/affiliates/{affiliate_id}/approved/": { | |
| "put": { | |
| "summary": "Approve an affiliate for a program", | |
| "operationId": "approveAffiliateForProgram", | |
| "tags": ["Programs", "Affiliates"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/AffiliateIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate approved for program.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramAffiliate" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Disapprove an affiliate for a program", | |
| "operationId": "disapproveAffiliateForProgram", | |
| "tags": ["Programs", "Affiliates"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/AffiliateIdPath" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Affiliate disapproved for program.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramAffiliate" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/commission-types/": { | |
| "get": { | |
| "summary": "List program commission types", | |
| "operationId": "listProgramCommissionTypes", | |
| "tags": ["Programs", "Commissions"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of commission types for the program.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramCommissionTypeList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/levels/": { | |
| "get": { | |
| "summary": "List program MLM levels", | |
| "operationId": "listProgramMlmLevels", | |
| "tags": ["Programs", "MLM"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of MLM levels for the program.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramMlmLevelList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/programs/{program_id}/bonuses/": { | |
| "get": { | |
| "summary": "List program bonuses", | |
| "operationId": "listProgramBonuses", | |
| "tags": ["Programs", "Bonuses"], | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/ProgramIdPath" }, | |
| { "$ref": "#/components/parameters/PageParam" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of bonuses for the program.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProgramBonusList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/balances/": { | |
| "get": { | |
| "summary": "List all affiliate balances (New Payments System)", | |
| "operationId": "listAllBalances", | |
| "tags": ["Balances", "Payments (New System)"], | |
| "description": "Returns a non-paginated list of all non-zero affiliate balances.", | |
| "responses": { | |
| "200": { | |
| "description": "A list of affiliate balances.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BalanceList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/payments/{id}/": { | |
| "get": { | |
| "summary": "Retrieve payment (New Payments System)", | |
| "operationId": "getPaymentById", | |
| "tags": ["Payments (New System)"], | |
| "parameters": [ { "$ref": "#/components/parameters/PaymentIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Successfully retrieved payment.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Payment" } } } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "summary": "Cancel payment (New Payments System)", | |
| "operationId": "cancelPaymentById", | |
| "tags": ["Payments (New System)"], | |
| "description": "Cancels the payment and re-adds the amount to the affiliate’s balance.", | |
| "parameters": [ { "$ref": "#/components/parameters/PaymentIdPath" } ], | |
| "responses": { | |
| "204": { "description": "Payment canceled successfully." } | |
| } | |
| } | |
| }, | |
| "/payments/": { | |
| "get": { | |
| "summary": "List all payments (New Payments System)", | |
| "operationId": "listAllPayments", | |
| "tags": ["Payments (New System)"], | |
| "parameters": [ { "$ref": "#/components/parameters/PageParam" } ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of payments.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create a payment (New Payments System)", | |
| "operationId": "createPayment", | |
| "tags": ["Payments (New System)"], | |
| "description": "Create a single payment or multiple (using an array of payments).", | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePaymentRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Payment(s) created successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentList" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/clicks/": { | |
| "get": { | |
| "summary": "List all clicks (Enterprise Plan)", | |
| "operationId": "listClicks", | |
| "tags": ["Clicks"], | |
| "description": "This method is available only for clients of the Enterprise plan. For meta_data filtering, use query parameters like `meta_data[your_key]=your_value`.", | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/PageParam" }, | |
| { "name": "program_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "affiliate_id", "in": "query", "required": false, "schema": { "type": "string" } }, | |
| { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, | |
| { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "A list of clicks.", | |
| "headers": { "Link": { "description": "Pagination links.", "schema": { "type": "string" } } }, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClickList" } } } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create a Click", | |
| "operationId": "createClick", | |
| "tags": ["Clicks"], | |
| "description": "Use this endpoint to obtain a click_id for REST-only integrations.", | |
| "requestBody": { | |
| "required": true, | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateClickRequest" } } } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Click created successfully.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateClickResponse" } } } | |
| } | |
| } | |
| } | |
| }, | |
| "/clicks/{id}/": { | |
| "get": { | |
| "summary": "Get detailed information about click (Enterprise Plan)", | |
| "operationId": "getClickById", | |
| "tags": ["Clicks"], | |
| "description": "This method is available only for clients of the Enterprise plan.", | |
| "parameters": [ { "$ref": "#/components/parameters/ClickIdPath" } ], | |
| "responses": { | |
| "200": { | |
| "description": "Detailed information about the click.", | |
| "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Click" } } } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment