{"openapi":"3.0.3","info":{"title":"Tweed API","description":"","version":"1.0","contact":{}},"servers":[],"tags":[{"name":"api","description":""}],"paths":{"/v1/contracts/{contractId}":{"get":{"operationId":"getContractById","summary":"Get contract by ID","parameters":[{"name":"contractId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["contracts"],"security":[{"bearer":[]}]}},"/v1/contracts":{"get":{"operationId":"getAllContracts","summary":"Get all contracts","parameters":[],"responses":{"200":{"description":""}},"tags":["contracts"],"security":[{"bearer":[]}]}},"/v1/contracts/add":{"post":{"operationId":"addContract","summary":"Add contract","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContractDto"}}}},"responses":{"201":{"description":""}},"tags":["contracts"],"security":[{"bearer":[]}]}},"/v1/contracts/add-contract-function":{"post":{"operationId":"addContractFunction","summary":"Add contract function","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContractFunctionDto"}}}},"responses":{"201":{"description":""}},"tags":["contracts"],"security":[{"bearer":[]}]}},"/v1/contracts/contract/{contractId}":{"delete":{"operationId":"deleteContract","summary":"Delete contract","parameters":[{"name":"contractId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["contracts"],"security":[{"bearer":[]}]}},"/v1/payouts/{payoutId}":{"get":{"operationId":"getPayoutById","summary":"Get payout by ID","parameters":[{"name":"payoutId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["payouts"],"security":[{"bearer":[]}]}},"/v1/payouts":{"get":{"operationId":"getAllPayouts","summary":"Get all payouts","parameters":[],"responses":{"200":{"description":""}},"tags":["payouts"],"security":[{"bearer":[]}]}},"/v1/payouts/add":{"post":{"operationId":"addPayout","summary":"Add payout","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPayoutDto"}}}},"responses":{"201":{"description":""}},"tags":["payouts"],"security":[{"bearer":[]}]}},"/v1/payouts/payout/{payoutId}":{"delete":{"operationId":"deletePayout","summary":"Delete payout","parameters":[{"name":"payoutId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["payouts"],"security":[{"bearer":[]}]}},"/v1/items/{id}":{"get":{"operationId":"getItemById","summary":"Get item by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemDto"}}}}},"tags":["items"],"security":[{"bearer":[]}]},"delete":{"operationId":"deleteItem","summary":"Delete item","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["items"],"security":[{"bearer":[]}]}},"/v1/items/add":{"post":{"operationId":"addItem","summary":"Add item","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddItemDto"}}}},"responses":{"201":{"description":""}},"tags":["items"],"security":[{"bearer":[]}]}},"/v1/items":{"get":{"operationId":"getAllItems","summary":"Get all items","parameters":[],"responses":{"200":{"description":""}},"tags":["items"],"security":[{"bearer":[]}]}},"/v1/items/all/contract/count/{contractId}":{"get":{"operationId":"getItemsCountByContractId","summary":"Get items count by contract id","parameters":[{"name":"contractId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["items"],"security":[{"bearer":[]}]}},"/v1/items/all/payout/count/{payoutId}":{"get":{"operationId":"getItemCountByPayoutId","summary":"Get items count by payout id","parameters":[{"name":"payoutId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["items"],"security":[{"bearer":[]}]}},"/v1/assets/{id}":{"get":{"operationId":"findAssetById","summary":"Get an asset by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["assets"],"security":[{"bearer":[]}]}},"/v1/assets":{"get":{"operationId":"findAllAssets","summary":"Get all assets","parameters":[],"responses":{"200":{"description":""}},"tags":["assets"],"security":[{"bearer":[]}]}},"/v1/assets/blockchain/{blockchainId}":{"get":{"operationId":"findAssetsByBlockchainId","summary":"Get assets by blockchain id","parameters":[{"name":"blockchainId","required":true,"in":"path","schema":{"type":"string"}},{"name":"stableCoinOnly","required":true,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":""}},"tags":["assets"],"security":[{"bearer":[]}]}},"/v1/assets/all/blockchains":{"get":{"operationId":"findAllAssetBlockchains","summary":"Get all asset blockchains","parameters":[],"responses":{"200":{"description":""}},"tags":["assets"],"security":[{"bearer":[]}]}},"/v1/blockchains/{id}":{"get":{"operationId":"findBlockchainById","summary":"Get a blockchain by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A blockchain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindBlockchainResponseDto"}}}}},"tags":["blockchains"],"security":[{"bearer":[]}]}},"/v1/blockchains":{"get":{"operationId":"findAllBlockchains","summary":"Get all blockchains","parameters":[],"responses":{"200":{"description":"A list of available blockchains","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FindBlockchainResponseDto"}}}}}},"tags":["blockchains"],"security":[{"bearer":[]}]}},"/v1/blockchains/multiple/{ids}":{"get":{"operationId":"findMultipleBlockchainsByIds","summary":"Get multiple blockchains by ids","parameters":[{"name":"ids","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of blockchains","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FindBlockchainResponseDto"}}}}}},"tags":["blockchains"],"security":[{"bearer":[]}]}},"/v1/blockchains/native-asset/{id}":{"get":{"operationId":"getBlockchainNativeAsset","summary":"Get native asset for a blockchain","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetDto"}}}}},"tags":["blockchains"],"security":[{"bearer":[]}]}},"/v1/audit-event-mappings":{"get":{"operationId":"getAuditEventMappings","summary":"","description":"Get audit event mappings","parameters":[{"name":"auditType","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditEventMappingDto"}}}}}},"tags":["audit-event-mappings"],"security":[{"bearer":[]}]}},"/v1/platform-webhooks":{"get":{"operationId":"getPlatformWebhooks","summary":"","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlatformWebhookDto"}}}}}},"tags":["platform-webhooks"],"security":[{"bearer":[]}]},"post":{"operationId":"addPlatformWebhook","summary":"","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlatformWebhookDto"}}}},"responses":{"201":{"description":""}},"tags":["platform-webhooks"],"security":[{"bearer":[]}]}},"/v1/platform-webhooks/{id}":{"put":{"operationId":"updatePlatformWebhook","summary":"","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlatformWebhookDto"}}}},"responses":{"200":{"description":""}},"tags":["platform-webhooks"],"security":[{"bearer":[]}]},"delete":{"operationId":"deletePlatformWebhook","summary":"","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["platform-webhooks"],"security":[{"bearer":[]}]}},"/v1/platform-webhooks/{id}/set-active":{"post":{"operationId":"setActivePlatformWebhook","summary":"","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPlatformWebhookActiveDto"}}}},"responses":{"201":{"description":""}},"tags":["platform-webhooks"],"security":[{"bearer":[]}]}},"/v1/tickets":{"post":{"operationId":"addSupportTicket","summary":"Create a new support ticket","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportTicketDto"}}}},"responses":{"201":{"description":""}},"tags":["tickets"],"security":[{"bearer":[]}]}}},"components":{"schemas":{"AddContractDto":{"type":"object","properties":{"address":{"type":"string"},"blockchainId":{"type":"string"},"abi":{"type":"string"}},"required":["address","blockchainId","abi"]},"AddContractFunctionDto":{"type":"object","properties":{"contractId":{"type":"string"},"functionSignature":{"type":"string"},"fixedFunctionParams":{"type":"object","additionalProperties":{"type":"string"}},"abiVersion":{"type":"string"}},"required":["contractId","functionSignature","fixedFunctionParams","abiVersion"]},"AddFiatPayoutDto":{"type":"object","properties":{"provider":{"type":"string"},"paymentProviderId":{"type":"string"}},"required":["provider","paymentProviderId"]},"AddStablecoinPayoutDto":{"type":"object","properties":{"blockchainId":{"type":"string"},"tokenId":{"type":"string"},"spender":{"type":"string"}},"required":["blockchainId","tokenId","spender"]},"AddNativePayoutDto":{"type":"object","properties":{"blockchainId":{"type":"string"}},"required":["blockchainId"]},"AddPayoutDto":{"type":"object","properties":{"type":{"type":"string","enum":["free","fiat","native","stablecoin"]},"name":{"type":"string"},"fiatDetails":{"$ref":"#/components/schemas/AddFiatPayoutDto"},"stablecoinDetails":{"$ref":"#/components/schemas/AddStablecoinPayoutDto"},"nativeDetails":{"$ref":"#/components/schemas/AddNativePayoutDto"}},"required":["type","name"]},"PayoutDto":{"type":"object","properties":{"type":{"type":"string","enum":["free","fiat","native","stablecoin"]},"blockchainId":{"type":"string"},"stripeConnectedAccountId":{"type":"string"},"assetId":{"type":"string"},"spender":{"type":"string"}},"required":["type","blockchainId","stripeConnectedAccountId","assetId","spender"]},"ContractDto":{"type":"object","properties":{"address":{"type":"string"},"blockchainId":{"type":"string"},"abi":{"type":"object"}},"required":["address","blockchainId","abi"]},"ContractFunctionDto":{"type":"object","properties":{"functionSignature":{"type":"string"},"fixedFunctionParams":{"type":"object"},"contract":{"$ref":"#/components/schemas/ContractDto"}},"required":["functionSignature","fixedFunctionParams","contract"]},"ItemDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"currency":{"type":"string"},"price":{"type":"number"},"description":{"type":"string"},"imageUrl":{"type":"string"},"payout":{"$ref":"#/components/schemas/PayoutDto"},"contractFunction":{"$ref":"#/components/schemas/ContractFunctionDto"}},"required":["id","title","currency","price","description","imageUrl","payout","contractFunction"]},"AddItemDto":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"currency":{"type":"string"},"priceCurrency":{"type":"number"},"imageUrl":{"type":"string"},"contractFunctionId":{"type":"string"},"payoutId":{"type":"string"}},"required":["title","description","currency","priceCurrency","imageUrl","contractFunctionId","payoutId"]},"FindBlockchainResponseDto":{"type":"object","properties":{"id":{"type":"string"},"blockchainEcosystem":{"type":"object"},"nativeCurrency":{"type":"object"},"name":{"type":"string"},"isMainnet":{"type":"boolean"},"rpcUrl":{"type":"string"},"iconUrl":{"type":"string"},"explorer":{"type":"object"},"indexer":{"type":"object"},"metadata":{"type":"object"}},"required":["id","blockchainEcosystem","nativeCurrency","name","isMainnet","rpcUrl","iconUrl","explorer","indexer","metadata"]},"AssetDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"defaultDecimals":{"type":"number"},"isStablecoin":{"type":"boolean"},"defaultContractAddress":{"type":"string"}},"required":["id","name","symbol","defaultDecimals","isStablecoin","defaultContractAddress"]},"AuditEventMappingDto":{"type":"object","properties":{"eventId":{"type":"string"},"auditType":{"type":"string","enum":["AUDIT_LOG","WEBHOOK","SLACK","EMAIL"]},"description":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUpdatedAt":{"format":"date-time","type":"string"}},"required":["eventId","auditType","description"]},"CreateAuditEventMappingDto":{"type":"object","properties":{"eventId":{"type":"string"},"auditType":{"type":"string","enum":["AUDIT_LOG","WEBHOOK","SLACK","EMAIL"]},"description":{"type":"string"}},"required":["eventId","auditType","description"]},"PlatformWebhookDto":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"isActive":{"type":"boolean"},"events":{"type":"array","items":{"type":"string"}},"createdAt":{"format":"date-time","type":"string"},"lastUpdatedAt":{"format":"date-time","type":"string"}},"required":["id","url","isActive","events"]},"CreatePlatformWebhookDto":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"}},"required":["url","events"]},"UpdatePlatformWebhookDto":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"}}},"SetPlatformWebhookActiveDto":{"type":"object","properties":{"isActive":{"type":"boolean"}},"required":["isActive"]},"CreateSupportTicketDto":{"type":"object","properties":{"contactEmail":{"type":"string"},"type":{"type":"string","enum":["BILLING","TECHNICAL","GENERAL","OTHER"]},"subject":{"type":"string"},"message":{"type":"string"},"platformName":{"type":"string"},"memberName":{"type":"string"}},"required":["contactEmail","type","subject","message","platformName","memberName"]}},"securitySchemes":{"bearer":{"scheme":"Bearer","bearerFormat":"Bearer","description":"Please enter token in following format: Bearer <JWT>","name":"Authorization","type":"http","in":"Header"}}},"x-amazon-apigateway-gateway-responses":{"DEFAULT_4XX":{"statusCode":403,"responseParameters":{"gatewayresponse.header.Access-Control-Allow-Origin":"'*'","gatewayresponse.header.Access-Control-Allow-Headers":"'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'","gatewayresponse.header.Access-Control-Allow-Methods":"'GET,OPTIONS,POST'"},"responseTemplates":{"application/json":"{\"message\":$context.error.messageString}"}},"DEFAULT_5XX":{"statusCode":500,"responseParameters":{"gatewayresponse.header.Access-Control-Allow-Origin":"'*'","gatewayresponse.header.Access-Control-Allow-Headers":"'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'","gatewayresponse.header.Access-Control-Allow-Methods":"'GET,OPTIONS,POST'"},"responseTemplates":{"application/json":"{\"message\":$context.error.messageString}"}}}}