{"servers":[{"url":"/api/v1"}],"info":{"title":"Affil API","version":"1.0.0","description":"Programmatic access to current credit card data from Affil."},"components":{"securitySchemes":{"propelAuthOrganizationApiKey":{"type":"http","scheme":"bearer","bearerFormat":"PropelAuth organization API key"}}},"openapi":"3.1.1","paths":{"/credit-cards":{"get":{"operationId":"listCreditCards","summary":"List credit cards","description":"Returns current credit card data from Affil.","parameters":[{"name":"issuer","in":"query","schema":{"type":"string","minLength":1,"description":"Issuer UUID or slug."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"creditCards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issuerId":{"type":"string","format":"uuid"},"issuerSlug":{"type":"string"},"issuerName":{"type":"string"},"artworkUrls":{"type":"array","items":{"type":"string"}},"fees":{"anyOf":[{"type":"object","properties":{"ongoingAnnualFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"foreignTransactionFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"introAnnualFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"introBalanceTransferFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"balanceTransferFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"cashAdvanceFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]}},"required":["ongoingAnnualFee"]},{"type":"null"}]},"aprs":{"anyOf":[{"type":"object","properties":{"ongoingPurchaseAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"introPurchaseAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"introBalanceTransferAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"ongoingBalanceTransferAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"ongoingCashAdvanceAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"ongoingPenaltyAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]}},"required":["ongoingPurchaseAPR"]},{"type":"null"}]},"newCardmemberOffer":{"anyOf":[{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"type":{"enum":["cash","points","miles","other"],"type":"string"},"limitedTime":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"spendingRequirement":{"type":"number"},"spendingRequirementDuration":{"type":"string"},"spendingDurationMonths":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationWeeks":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"startDate":{"type":"string"},"amountQualifier":{"enum":["exact","up_to"],"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"type":{"enum":["cash","points","miles","other"],"type":"string"},"spendingRequirement":{"type":"number"},"spendingRequirementDuration":{"type":"string"},"spendingDurationMonths":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationWeeks":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationDays":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["description","amount","type","spendingDurationMonths","spendingDurationWeeks","spendingDurationDays"]}}},"required":["description","amount","type","limitedTime","endDate","spendingDurationMonths","spendingDurationWeeks","spendingDurationDays"]},{"type":"null"}]},"marketingBullets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","slug","name","updatedAt","issuerId","issuerSlug","issuerName","artworkUrls","fees","aprs","newCardmemberOffer","marketingBullets"]}}},"required":["creditCards"]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHENTICATED"},"status":{"const":401},"message":{"type":"string","default":"A valid PropelAuth organization API key is required."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"FORBIDDEN"},"status":{"const":403},"message":{"type":"string","default":"This API key is not authorized for this operation."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many API key validation requests."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"503":{"description":"503","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAVAILABLE"},"status":{"const":503},"message":{"type":"string","default":"The Affil API is temporarily unavailable."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}},"security":[{"propelAuthOrganizationApiKey":[]}]}},"/credit-cards/{idOrSlug}":{"get":{"operationId":"getCreditCard","summary":"Get a credit card","description":"Looks up a credit card by its Affil product ID or slug.","parameters":[{"name":"idOrSlug","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issuerId":{"type":"string","format":"uuid"},"issuerSlug":{"type":"string"},"issuerName":{"type":"string"},"artworkUrls":{"type":"array","items":{"type":"string"}},"fees":{"anyOf":[{"type":"object","properties":{"ongoingAnnualFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"foreignTransactionFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"introAnnualFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"introBalanceTransferFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"balanceTransferFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]},"cashAdvanceFee":{"type":"object","properties":{"type":{"enum":["dollar","other"],"type":"string"},"amount":{"type":"string"},"duration":{"type":"string"},"label":{"type":"string"}},"required":["type","amount"]}},"required":["ongoingAnnualFee"]},{"type":"null"}]},"aprs":{"anyOf":[{"type":"object","properties":{"ongoingPurchaseAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"introPurchaseAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"introBalanceTransferAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"ongoingBalanceTransferAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"ongoingCashAdvanceAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]},"ongoingPenaltyAPR":{"type":"object","properties":{"label":{"type":"string"},"type":{"enum":["variable","fixed","other"],"type":"string"},"duration":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]}},"required":["ongoingPurchaseAPR"]},{"type":"null"}]},"newCardmemberOffer":{"anyOf":[{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"type":{"enum":["cash","points","miles","other"],"type":"string"},"limitedTime":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"spendingRequirement":{"type":"number"},"spendingRequirementDuration":{"type":"string"},"spendingDurationMonths":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationWeeks":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"startDate":{"type":"string"},"amountQualifier":{"enum":["exact","up_to"],"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"type":{"enum":["cash","points","miles","other"],"type":"string"},"spendingRequirement":{"type":"number"},"spendingRequirementDuration":{"type":"string"},"spendingDurationMonths":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationWeeks":{"anyOf":[{"type":"number"},{"type":"null"}]},"spendingDurationDays":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["description","amount","type","spendingDurationMonths","spendingDurationWeeks","spendingDurationDays"]}}},"required":["description","amount","type","limitedTime","endDate","spendingDurationMonths","spendingDurationWeeks","spendingDurationDays"]},{"type":"null"}]},"marketingBullets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","slug","name","updatedAt","issuerId","issuerSlug","issuerName","artworkUrls","fees","aprs","newCardmemberOffer","marketingBullets"]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHENTICATED"},"status":{"const":401},"message":{"type":"string","default":"A valid PropelAuth organization API key is required."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"FORBIDDEN"},"status":{"const":403},"message":{"type":"string","default":"This API key is not authorized for this operation."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Credit card not found."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many API key validation requests."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"503":{"description":"503","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAVAILABLE"},"status":{"const":503},"message":{"type":"string","default":"The Affil API is temporarily unavailable."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}},"security":[{"propelAuthOrganizationApiKey":[]}]}},"/issuers":{"get":{"operationId":"listIssuers","summary":"List issuers","description":"Returns issuers that currently have credit cards in Affil's Card Catalog.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"issuers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"creditCardCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","slug","name","creditCardCount"]}}},"required":["issuers"]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHENTICATED"},"status":{"const":401},"message":{"type":"string","default":"A valid PropelAuth organization API key is required."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"FORBIDDEN"},"status":{"const":403},"message":{"type":"string","default":"This API key is not authorized for this operation."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many API key validation requests."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"503":{"description":"503","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAVAILABLE"},"status":{"const":503},"message":{"type":"string","default":"The Affil API is temporarily unavailable."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}},"security":[{"propelAuthOrganizationApiKey":[]}]}}}}