> For the complete documentation index, see [llms.txt](https://docs.paynow.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.paynow.gg/management/management-api/affiliate-links.md).

# Affiliate Links

## GET /v1/stores/{storeId}/affiliate-links

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"affiliate-links"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"AffiliateLinkDto":{"required":["apply_for_subscriptions","code","commission_amount","commission_amount_steps","commission_type","created_at","created_by","discount_amount","discount_type","enabled","id","last_commission_amount_step_repeats","referer_type","store_id","tracking_length_days","wallet_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"wallet_id":{"type":"string","description":"The identifier of the wallet that receives the affiliate commission payouts."},"enabled":{"type":"boolean","description":"Indicates whether the affiliate link is enabled."},"code":{"type":"string","description":"The unique code associated with the affiliate link."},"referer_type":{"$ref":"#/components/schemas/AffiliateLinkRefererTypeDto"},"tracking_length_days":{"type":"integer","description":"The number of days a customer's referral is tracked after following the affiliate link.","format":"int32"},"apply_for_subscriptions":{"type":"boolean","description":"Whether the affiliate earns commission on subscription renewals.\nMust be enabled for 'commission_amount_steps' past the first cycle to apply - when disabled, only the initial purchase earns commission."},"discount_type":{"$ref":"#/components/schemas/AffiliateLinkDiscountTypeDto"},"discount_amount":{"type":"integer","description":"The discount amount, in the smallest currency unit (e.g., cents) for fixed discounts, or tenths of a percent (e.g., 125 = 12.5%) for percentage discounts.","format":"int64"},"commission_type":{"$ref":"#/components/schemas/AffiliateLinkCommissionTypeDto"},"commission_amount":{"type":"integer","description":"The commission amount, in tenths of a percent (e.g., 125 = 12.5%) for percentage commissions.","format":"int64"},"commission_amount_steps":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkCommissionAmountStepDto"},"description":"Per-cycle commission overrides. Requires 'apply_for_subscriptions' to be enabled for billing cycles past 1.\nWhen empty, the base commission amount applies to every renewal. When steps are defined, each renewal cycle pays its matching steps amount.\nCycles without a matching step earn no commission, except cycles past the last step when 'last_commission_amount_step_repeats' is true."},"last_commission_amount_step_repeats":{"type":"boolean","description":"Whether the last commission amount steps rate continues to apply to all billing cycles past the last step.\nWhen false, cycles past the last step earn no commission."},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the affiliate link was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the affiliate link was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of an affiliate link, including configuration and audit information."},"AffiliateLinkRefererTypeDto":{"enum":["invalid","first_referer","last_referer"],"type":"string","description":"Specifies which affiliate link is credited when a customer follows multiple links before purchasing."},"AffiliateLinkDiscountTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of discount offered to customers referred through an affiliate link."},"AffiliateLinkCommissionTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of commission an affiliate earns from referred purchases."},"AffiliateLinkCommissionAmountStepDto":{"required":["billing_cycle_sequence","commission_amount"],"type":"object","properties":{"billing_cycle_sequence":{"type":"integer","description":"The billing cycle number this commission step applies to. Starts at 1 for the initial purchase.","format":"int32"},"commission_amount":{"type":"integer","description":"The commission percentage for this cycle, in tenths of a percent (e.g., 125 = 12.5%).","format":"int64"}},"additionalProperties":false,"description":"Represents the commission for a specific subscription renewal billing cycle.\nA step applies to its exact cycle - see the affiliate link's 'last_commission_amount_step_repeats' for what happens past the last step."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/affiliate-links":{"get":{"tags":["affiliate-links"],"operationId":"AffiliateLinks_GetAffiliateLinks","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## POST /v1/stores/{storeId}/affiliate-links

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"affiliate-links"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"CreateAffiliateLinkDto":{"required":["wallet_id","enabled","code","referer_type","tracking_length_days","apply_for_subscriptions","discount_type","discount_amount","commission_type","commission_amount","commission_amount_steps","last_commission_amount_step_repeats"],"type":"object","properties":{"wallet_id":{"type":"string"},"enabled":{"type":"boolean"},"code":{"type":"string"},"referer_type":{"$ref":"#/components/schemas/AffiliateLinkRefererTypeDto"},"tracking_length_days":{"type":"integer","format":"int32"},"apply_for_subscriptions":{"type":"boolean"},"discount_type":{"$ref":"#/components/schemas/AffiliateLinkDiscountTypeDto"},"discount_amount":{"type":"integer","format":"int64"},"commission_type":{"$ref":"#/components/schemas/AffiliateLinkCommissionTypeDto"},"commission_amount":{"type":"integer","format":"int64"},"commission_amount_steps":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkCommissionAmountStepDto"}},"last_commission_amount_step_repeats":{"type":"boolean"}}},"AffiliateLinkRefererTypeDto":{"enum":["invalid","first_referer","last_referer"],"type":"string","description":"Specifies which affiliate link is credited when a customer follows multiple links before purchasing."},"AffiliateLinkDiscountTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of discount offered to customers referred through an affiliate link."},"AffiliateLinkCommissionTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of commission an affiliate earns from referred purchases."},"AffiliateLinkCommissionAmountStepDto":{"required":["billing_cycle_sequence","commission_amount"],"type":"object","properties":{"billing_cycle_sequence":{"type":"integer","description":"The billing cycle number this commission step applies to. Starts at 1 for the initial purchase.","format":"int32"},"commission_amount":{"type":"integer","description":"The commission percentage for this cycle, in tenths of a percent (e.g., 125 = 12.5%).","format":"int64"}},"additionalProperties":false,"description":"Represents the commission for a specific subscription renewal billing cycle.\nA step applies to its exact cycle - see the affiliate link's 'last_commission_amount_step_repeats' for what happens past the last step."},"AffiliateLinkDto":{"required":["apply_for_subscriptions","code","commission_amount","commission_amount_steps","commission_type","created_at","created_by","discount_amount","discount_type","enabled","id","last_commission_amount_step_repeats","referer_type","store_id","tracking_length_days","wallet_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"wallet_id":{"type":"string","description":"The identifier of the wallet that receives the affiliate commission payouts."},"enabled":{"type":"boolean","description":"Indicates whether the affiliate link is enabled."},"code":{"type":"string","description":"The unique code associated with the affiliate link."},"referer_type":{"$ref":"#/components/schemas/AffiliateLinkRefererTypeDto"},"tracking_length_days":{"type":"integer","description":"The number of days a customer's referral is tracked after following the affiliate link.","format":"int32"},"apply_for_subscriptions":{"type":"boolean","description":"Whether the affiliate earns commission on subscription renewals.\nMust be enabled for 'commission_amount_steps' past the first cycle to apply - when disabled, only the initial purchase earns commission."},"discount_type":{"$ref":"#/components/schemas/AffiliateLinkDiscountTypeDto"},"discount_amount":{"type":"integer","description":"The discount amount, in the smallest currency unit (e.g., cents) for fixed discounts, or tenths of a percent (e.g., 125 = 12.5%) for percentage discounts.","format":"int64"},"commission_type":{"$ref":"#/components/schemas/AffiliateLinkCommissionTypeDto"},"commission_amount":{"type":"integer","description":"The commission amount, in tenths of a percent (e.g., 125 = 12.5%) for percentage commissions.","format":"int64"},"commission_amount_steps":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkCommissionAmountStepDto"},"description":"Per-cycle commission overrides. Requires 'apply_for_subscriptions' to be enabled for billing cycles past 1.\nWhen empty, the base commission amount applies to every renewal. When steps are defined, each renewal cycle pays its matching steps amount.\nCycles without a matching step earn no commission, except cycles past the last step when 'last_commission_amount_step_repeats' is true."},"last_commission_amount_step_repeats":{"type":"boolean","description":"Whether the last commission amount steps rate continues to apply to all billing cycles past the last step.\nWhen false, cycles past the last step earn no commission."},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the affiliate link was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the affiliate link was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of an affiliate link, including configuration and audit information."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/affiliate-links":{"post":{"tags":["affiliate-links"],"operationId":"AffiliateLinks_CreateAffiliateLink","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAffiliateLinkDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateAffiliateLinkDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateAffiliateLinkDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateLinkDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## GET /v1/stores/{storeId}/affiliate-links/{affiliateLinkId}

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"affiliate-links"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"AffiliateLinkDto":{"required":["apply_for_subscriptions","code","commission_amount","commission_amount_steps","commission_type","created_at","created_by","discount_amount","discount_type","enabled","id","last_commission_amount_step_repeats","referer_type","store_id","tracking_length_days","wallet_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"wallet_id":{"type":"string","description":"The identifier of the wallet that receives the affiliate commission payouts."},"enabled":{"type":"boolean","description":"Indicates whether the affiliate link is enabled."},"code":{"type":"string","description":"The unique code associated with the affiliate link."},"referer_type":{"$ref":"#/components/schemas/AffiliateLinkRefererTypeDto"},"tracking_length_days":{"type":"integer","description":"The number of days a customer's referral is tracked after following the affiliate link.","format":"int32"},"apply_for_subscriptions":{"type":"boolean","description":"Whether the affiliate earns commission on subscription renewals.\nMust be enabled for 'commission_amount_steps' past the first cycle to apply - when disabled, only the initial purchase earns commission."},"discount_type":{"$ref":"#/components/schemas/AffiliateLinkDiscountTypeDto"},"discount_amount":{"type":"integer","description":"The discount amount, in the smallest currency unit (e.g., cents) for fixed discounts, or tenths of a percent (e.g., 125 = 12.5%) for percentage discounts.","format":"int64"},"commission_type":{"$ref":"#/components/schemas/AffiliateLinkCommissionTypeDto"},"commission_amount":{"type":"integer","description":"The commission amount, in tenths of a percent (e.g., 125 = 12.5%) for percentage commissions.","format":"int64"},"commission_amount_steps":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkCommissionAmountStepDto"},"description":"Per-cycle commission overrides. Requires 'apply_for_subscriptions' to be enabled for billing cycles past 1.\nWhen empty, the base commission amount applies to every renewal. When steps are defined, each renewal cycle pays its matching steps amount.\nCycles without a matching step earn no commission, except cycles past the last step when 'last_commission_amount_step_repeats' is true."},"last_commission_amount_step_repeats":{"type":"boolean","description":"Whether the last commission amount steps rate continues to apply to all billing cycles past the last step.\nWhen false, cycles past the last step earn no commission."},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the affiliate link was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the affiliate link was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of an affiliate link, including configuration and audit information."},"AffiliateLinkRefererTypeDto":{"enum":["invalid","first_referer","last_referer"],"type":"string","description":"Specifies which affiliate link is credited when a customer follows multiple links before purchasing."},"AffiliateLinkDiscountTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of discount offered to customers referred through an affiliate link."},"AffiliateLinkCommissionTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of commission an affiliate earns from referred purchases."},"AffiliateLinkCommissionAmountStepDto":{"required":["billing_cycle_sequence","commission_amount"],"type":"object","properties":{"billing_cycle_sequence":{"type":"integer","description":"The billing cycle number this commission step applies to. Starts at 1 for the initial purchase.","format":"int32"},"commission_amount":{"type":"integer","description":"The commission percentage for this cycle, in tenths of a percent (e.g., 125 = 12.5%).","format":"int64"}},"additionalProperties":false,"description":"Represents the commission for a specific subscription renewal billing cycle.\nA step applies to its exact cycle - see the affiliate link's 'last_commission_amount_step_repeats' for what happens past the last step."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/affiliate-links/{affiliateLinkId}":{"get":{"tags":["affiliate-links"],"operationId":"AffiliateLinks_GetAffiliateLink","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"affiliateLinkId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateLinkDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## DELETE /v1/stores/{storeId}/affiliate-links/{affiliateLinkId}

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"affiliate-links"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/affiliate-links/{affiliateLinkId}":{"delete":{"tags":["affiliate-links"],"operationId":"AffiliateLinks_DeleteAffiliateLink","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"affiliateLinkId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## PATCH /v1/stores/{storeId}/affiliate-links/{affiliateLinkId}

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"affiliate-links"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"UpdateAffiliateLinkDto":{"type":"object","properties":{"wallet_id":{"type":"string"},"enabled":{"type":"boolean"},"code":{"type":"string"},"referer_type":{"$ref":"#/components/schemas/AffiliateLinkRefererTypeDto"},"tracking_length_days":{"type":"integer","format":"int32"},"apply_for_subscriptions":{"type":"boolean"},"discount_type":{"$ref":"#/components/schemas/AffiliateLinkDiscountTypeDto"},"discount_amount":{"type":"integer","format":"int64"},"commission_type":{"$ref":"#/components/schemas/AffiliateLinkCommissionTypeDto"},"commission_amount":{"type":"integer","format":"int64"},"commission_amount_steps":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkCommissionAmountStepDto"}},"last_commission_amount_step_repeats":{"type":"boolean"}}},"AffiliateLinkRefererTypeDto":{"enum":["invalid","first_referer","last_referer"],"type":"string","description":"Specifies which affiliate link is credited when a customer follows multiple links before purchasing."},"AffiliateLinkDiscountTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of discount offered to customers referred through an affiliate link."},"AffiliateLinkCommissionTypeDto":{"enum":["none","fixed","percentage"],"type":"string","description":"Specifies the type of commission an affiliate earns from referred purchases."},"AffiliateLinkCommissionAmountStepDto":{"required":["billing_cycle_sequence","commission_amount"],"type":"object","properties":{"billing_cycle_sequence":{"type":"integer","description":"The billing cycle number this commission step applies to. Starts at 1 for the initial purchase.","format":"int32"},"commission_amount":{"type":"integer","description":"The commission percentage for this cycle, in tenths of a percent (e.g., 125 = 12.5%).","format":"int64"}},"additionalProperties":false,"description":"Represents the commission for a specific subscription renewal billing cycle.\nA step applies to its exact cycle - see the affiliate link's 'last_commission_amount_step_repeats' for what happens past the last step."},"AffiliateLinkDto":{"required":["apply_for_subscriptions","code","commission_amount","commission_amount_steps","commission_type","created_at","created_by","discount_amount","discount_type","enabled","id","last_commission_amount_step_repeats","referer_type","store_id","tracking_length_days","wallet_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"wallet_id":{"type":"string","description":"The identifier of the wallet that receives the affiliate commission payouts."},"enabled":{"type":"boolean","description":"Indicates whether the affiliate link is enabled."},"code":{"type":"string","description":"The unique code associated with the affiliate link."},"referer_type":{"$ref":"#/components/schemas/AffiliateLinkRefererTypeDto"},"tracking_length_days":{"type":"integer","description":"The number of days a customer's referral is tracked after following the affiliate link.","format":"int32"},"apply_for_subscriptions":{"type":"boolean","description":"Whether the affiliate earns commission on subscription renewals.\nMust be enabled for 'commission_amount_steps' past the first cycle to apply - when disabled, only the initial purchase earns commission."},"discount_type":{"$ref":"#/components/schemas/AffiliateLinkDiscountTypeDto"},"discount_amount":{"type":"integer","description":"The discount amount, in the smallest currency unit (e.g., cents) for fixed discounts, or tenths of a percent (e.g., 125 = 12.5%) for percentage discounts.","format":"int64"},"commission_type":{"$ref":"#/components/schemas/AffiliateLinkCommissionTypeDto"},"commission_amount":{"type":"integer","description":"The commission amount, in tenths of a percent (e.g., 125 = 12.5%) for percentage commissions.","format":"int64"},"commission_amount_steps":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateLinkCommissionAmountStepDto"},"description":"Per-cycle commission overrides. Requires 'apply_for_subscriptions' to be enabled for billing cycles past 1.\nWhen empty, the base commission amount applies to every renewal. When steps are defined, each renewal cycle pays its matching steps amount.\nCycles without a matching step earn no commission, except cycles past the last step when 'last_commission_amount_step_repeats' is true."},"last_commission_amount_step_repeats":{"type":"boolean","description":"Whether the last commission amount steps rate continues to apply to all billing cycles past the last step.\nWhen false, cycles past the last step earn no commission."},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the affiliate link was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the affiliate link was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of an affiliate link, including configuration and audit information."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/affiliate-links/{affiliateLinkId}":{"patch":{"tags":["affiliate-links"],"operationId":"AffiliateLinks_UpdateAffiliateLink","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"affiliateLinkId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAffiliateLinkDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateAffiliateLinkDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateAffiliateLinkDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateLinkDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.paynow.gg/management/management-api/affiliate-links.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
