> For the complete documentation index, see [llms.txt](https://docs.yifi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yifi.io/docs/earn/partners.md).

# Partners

B2B attribution: partner analytics, strategy policy and revenue share reporting

## Get supported chains

> Returns chains supported by the partners service.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.Chain":{"type":"object","properties":{"chain_id":{"type":"integer"},"chain_name":{"type":"string"},"distributor":{"description":"Distributor is the TokenDistributor contract address on this chain (empty if not deployed)","type":"string"},"provider":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/supported-chains":{"get":{"description":"Returns chains supported by the partners service.","tags":["Partners"],"summary":"Get supported chains","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/models.Chain"}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Get API keys

> Returns all API keys for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.APIKey":{"type":"object","properties":{"api_key":{"description":"essential key to be used by","type":"string"},"created_at":{"type":"string"},"hash":{"description":"чтобы декриптнуть локально","type":"array","items":{"type":"integer"}},"meta":{},"name":{"type":"string"},"prefix":{"type":"string"},"revoked_at":{"type":"string"},"secret_byte":{"description":"this is his secret token to sign, shown just one time","type":"array","items":{"type":"integer"}},"status":{"type":"boolean"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/api-keys":{"get":{"description":"Returns all API keys for a partner.","tags":["Partners"],"summary":"Get API keys","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/models.APIKey"}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Create API key

> Creates a new API key for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.APIKeyFull":{"type":"object","properties":{"api_key":{"description":"essential key to be used by","type":"string"},"created_at":{"type":"string"},"hash":{"description":"чтобы декриптнуть локально","type":"array","items":{"type":"integer"}},"meta":{},"name":{"type":"string"},"prefix":{"type":"string"},"revoked_at":{"type":"string"},"secret":{"type":"string"},"secret_byte":{"description":"this is his secret token to sign, shown just one time","type":"array","items":{"type":"integer"}},"status":{"type":"boolean"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}},"core.CreateAPIKeyRequest":{"type":"object","properties":{"name":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/api-keys":{"post":{"description":"Creates a new API key for a partner.","tags":["Partners"],"summary":"Create API key","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.APIKeyFull"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.CreateAPIKeyRequest"}}},"description":"API key payload","required":true}}}}}
```

## Revoke API key

> Revokes a partner API key.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/api-keys/{api_key}":{"delete":{"description":"Revokes a partner API key.","tags":["Partners"],"summary":"Revoke API key","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true},{"schema":{"type":"string"},"description":"API key","name":"api_key","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Get claim addresses

> Returns all claim addresses for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.ClaimAddress":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"integer"},"created_at":{"type":"string"},"name":{"type":"string"},"partner_id":{"type":"string"},"status":{"type":"boolean"},"updated_at":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/claim-addresses":{"get":{"description":"Returns all claim addresses for a partner.","tags":["Partners"],"summary":"Get claim addresses","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/models.ClaimAddress"}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Attach new claim address

> Adds a new claim address for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}},"models.ClaimAddressPublic":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"integer"},"name":{"type":"string"},"partner_id":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/claim-addresses":{"post":{"description":"Adds a new claim address for a partner.","tags":["Partners"],"summary":"Attach new claim address","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ClaimAddressPublic"}}},"description":"Claim address payload","required":true}}}}}
```

## Update claim address

> Updates an existing claim address for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}},"models.ClaimAddress":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"integer"},"created_at":{"type":"string"},"name":{"type":"string"},"partner_id":{"type":"string"},"status":{"type":"boolean"},"updated_at":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/claim-addresses/{address}":{"put":{"description":"Updates an existing claim address for a partner.","tags":["Partners"],"summary":"Update claim address","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true},{"schema":{"type":"string"},"description":"Claim address","name":"address","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ClaimAddress"}}},"description":"Claim address payload","required":true}}}}}
```

## Get fee balance

> Returns the current fee balance for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.Balance":{"type":"object","properties":{"available_usd":{"type":"string"},"partner_id":{"type":"string"},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/models.TokenBalanceView"}},"updated_at":{"type":"string"}}},"models.TokenBalanceView":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/models.TokenAmount"},"chain_id":{"type":"integer"},"token_id":{"type":"string"}}},"models.TokenAmount":{"type":"object","properties":{"free":{"description":"Free is accrued but not yet pushed to the TokenDistributor.","type":"string"},"pending":{"description":"Pending is pushed to the TokenDistributor and claimable on-chain.","type":"string"},"total":{"description":"Total = Free + Pending, the whole fee balance for the token.","type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/fee-balance":{"get":{"description":"Returns the current fee balance for a partner.","tags":["Partners"],"summary":"Get fee balance","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.Balance"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Claim fees

> Submits a fee claim for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.TxInfo":{"type":"object","properties":{"amount_sent":{"type":"string"},"chain_id":{"type":"integer"},"claim_id":{"type":"string"},"data":{"description":"Data is the unsigned claim()/claimAll() calldata the partner signs from\ntheir claim address (From) to the distributor (To), value 0.","type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token_id":{"type":"string"},"tx_hash":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}},"models.PartnerFeeClaimRequest":{"type":"object","properties":{"chain_id":{"type":"string"},"claim_address":{"type":"string"},"is_token_native":{"type":"boolean"},"partner_id":{"type":"string"},"token_id":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/fees/claim":{"post":{"description":"Submits a fee claim for a partner.","tags":["Partners"],"summary":"Claim fees","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.TxInfo"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.PartnerFeeClaimRequest"}}},"description":"Claim fees payload","required":true}}}}}
```

## Claim all fees

> Claims every token's whole fee balance on a chain for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.TxInfo":{"type":"object","properties":{"amount_sent":{"type":"string"},"chain_id":{"type":"integer"},"claim_id":{"type":"string"},"data":{"description":"Data is the unsigned claim()/claimAll() calldata the partner signs from\ntheir claim address (From) to the distributor (To), value 0.","type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token_id":{"type":"string"},"tx_hash":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/fees/claim-all":{"post":{"description":"Claims every token's whole fee balance on a chain for a partner.","tags":["Partners"],"summary":"Claim all fees","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.TxInfo"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Claim all fees payload ({\\","required":true}}}}}
```

## Get partner metrics

> Returns aggregated partner metrics for the given time range.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.Metrics":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/models.Metric"}},"partner_id":{"type":"string"},"updated_at":{"description":"last time user updated (or us) his summuary (хранится в кэше, обновлять можно руками, можем сами)","type":"string"}}},"models.Metric":{"type":"object","properties":{"deposits_usd":{"type":"string"},"fees_earned_usd":{"type":"string"},"strategy_id":{"type":"string"},"users_count":{"type":"integer"},"withdrawals_usd":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/metrics":{"get":{"description":"Returns aggregated partner metrics for the given time range.","tags":["Partners"],"summary":"Get partner metrics","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true},{"schema":{"type":"string"},"description":"From date (RFC3339 or YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string"},"description":"To date (RFC3339 or YYYY-MM-DD)","name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.Metrics"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Get partner policy

> Returns the active policy for a partner.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.Policy":{"type":"object","properties":{"allow_strategy_ids":{"type":"array","items":{"type":"string"}},"allowed_category_ids":{"type":"array","items":{"type":"string"}},"allowed_chain_ids":{"type":"array","items":{"type":"string"}},"deny_strategy_ids":{"type":"array","items":{"type":"string"}},"fees_policies":{"$ref":"#/components/schemas/models.FeePolicy"},"max_risk_level":{"type":"string"},"min_rate":{"type":"string"},"min_tvl_usd":{"type":"string"},"rate_type":{"type":"string"},"updated_at":{"type":"string"}}},"models.FeePolicy":{"type":"object","properties":{"common_fee":{"description":"правило для всех стратегий если не указано иное ниже","type":"string"},"strategies_fee":{"type":"array","items":{"$ref":"#/components/schemas/models.StrategyFee"}}}},"models.StrategyFee":{"type":"object","properties":{"partner_fee_preference":{"type":"string"},"strategy_id":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/policy":{"get":{"description":"Returns the active policy for a partner.","tags":["Partners"],"summary":"Get partner policy","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.Policy"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```

## Update partner policy

> Replaces the partner policy.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}},"models.Policy":{"type":"object","properties":{"allow_strategy_ids":{"type":"array","items":{"type":"string"}},"allowed_category_ids":{"type":"array","items":{"type":"string"}},"allowed_chain_ids":{"type":"array","items":{"type":"string"}},"deny_strategy_ids":{"type":"array","items":{"type":"string"}},"fees_policies":{"$ref":"#/components/schemas/models.FeePolicy"},"max_risk_level":{"type":"string"},"min_rate":{"type":"string"},"min_tvl_usd":{"type":"string"},"rate_type":{"type":"string"},"updated_at":{"type":"string"}}},"models.FeePolicy":{"type":"object","properties":{"common_fee":{"description":"правило для всех стратегий если не указано иное ниже","type":"string"},"strategies_fee":{"type":"array","items":{"$ref":"#/components/schemas/models.StrategyFee"}}}},"models.StrategyFee":{"type":"object","properties":{"partner_fee_preference":{"type":"string"},"strategy_id":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/policy":{"put":{"description":"Replaces the partner policy.","tags":["Partners"],"summary":"Update partner policy","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.Policy"}}},"description":"Policy payload","required":true}}}}}
```

## Get partner summary

> Returns summary stats for a partner for the given time range.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"B2B attribution: partner analytics, strategy policy and revenue share reporting","name":"Partners"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"models.Summary":{"type":"object","properties":{"deposits_usd":{"type":"string"},"fees_earned_usd":{"type":"string"},"from":{"type":"string"},"partner_id":{"type":"string"},"to":{"type":"string"},"updated_at":{"description":"last time user updated (or us) his summuary (хранится в кэше, обновлять можно руками, можем сами)","type":"string"},"users_count":{"type":"integer"},"withdrawals_usd":{"type":"string"}}},"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/partners/{partner_id}/summary":{"get":{"description":"Returns summary stats for a partner for the given time range.","tags":["Partners"],"summary":"Get partner summary","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"partner_id","in":"path","required":true},{"schema":{"type":"string"},"description":"From date (RFC3339 or YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string"},"description":"To date (RFC3339 or YYYY-MM-DD)","name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.Summary"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ErrorResponse"}}}}}}}}}
```
