{
  "aod": "0.1",
  "provider": {
    "name": "Ironfang Ltd - Ironfang Finance E-Invoicing API",
    "url": "https://ironfang.com/finance",
    "portalUrl": "https://portal.ironfang.com",
    "apisJsonUrl": "https://ironfang.com/apis.json"
  },
  "maturity": "console-only",
  "account": {
    "required": true,
    "signupUrl": "https://id.ironfang.com/signup?return_to=https%3A%2F%2Fportal.ironfang.com%2Fproducts%2Ffinance",
    "agentPolicy": "unspecified",
    "prerequisites": [
      "An email address (or a Google account).",
      "Your country, declared at signup."
    ],
    "plans": [
      {
        "name": "Free",
        "requiredFor": "Every account, with no card: a free allowance on every meter, renewed on the first day of each UTC calendar month. When an allowance runs out, that work stops until the next month and nothing is charged.",
        "url": "https://ironfang.com/pricing#finance"
      },
      {
        "name": "Pay as you go",
        "requiredFor": "Usage past the free allowances at graduated rates, within the monthly usage limit before VAT the account sets and any product limit; work that would pass a limit is refused before it starts. Switched on, paused and limited in the portal by a person with billing rights; one itemised invoice a month for every product. Paid usage of Ironfang Finance needs an approved UK or EU business profile.",
        "url": "https://ironfang.com/pricing#finance"
      }
    ],
    "termsOfService": {
      "url": "https://ironfang.com/legal/terms",
      "acceptance": "implicit"
    }
  },
  "verification": [
    {
      "name": "Email verification",
      "description": "A verification link is emailed at signup. It confirms the address; API keys can be minted before it is clicked.",
      "blocking": false,
      "expectedLatency": "minutes"
    }
  ],
  "registration": {
    "applicationNoun": "API key",
    "owner": "organization",
    "mechanisms": [
      {
        "type": "console-only",
        "description": "Sign in to the portal, open API keys under Developers, choose the scopes (finance:einvoices:rulesets:read or narrower) and mint. The key belongs to the organisation and is shown once.",
        "baseUrl": "https://portal.ironfang.com/developers/api-keys",
        "docsUrls": [
          "https://ironfang.com/docs/finance#api"
        ],
        "auth": "Browser session at id.ironfang.com (email and password, or Google)."
      }
    ]
  },
  "authentication": {
    "methods": [
      {
        "id": "platform-api-key",
        "type": "bearer-env",
        "env": [
          "IRONFANG_API_KEY"
        ],
        "header": "Authorization",
        "scheme": "Bearer",
        "tokenPrefix": "if_live_",
        "bootstrap": "A person signs in to https://portal.ironfang.com/developers/api-keys and mints a key with the scopes it needs. The key is shown once.",
        "notes": "Send the key as a bearer token to https://api.ironfang.com/finance. Scopes: finance:einvoices:rulesets:read, finance:einvoices:read, finance:einvoices:write."
      }
    ]
  },
  "credentials": [
    {
      "type": "api-key",
      "fields": {
        "key": "The secret, prefixed if_live_, sent as a bearer token."
      },
      "ttl": "Until revoked.",
      "rotation": "Mint a replacement in the portal, move traffic to it, revoke the old key. No API for either step.",
      "oneTimeDisplay": true
    }
  ],
  "scopes": {
    "model": "scope-strings",
    "vocabularyUrl": "https://ironfang.com/docs/finance#api",
    "notes": "Ironfang Finance E-Invoicing API: finance:einvoices:rulesets:read, finance:einvoices:read, finance:einvoices:write"
  },
  "gaps": [
    "API keys are minted, scoped and revoked by a person in the portal; there is no API to create or rotate them.",
    "There is no sandbox: the free monthly allowances are the trial, against production.",
    "No changelog page is published yet; the OpenAPI contracts carry the current version."
  ],
  "securityProfile": {
    "tier": "normal",
    "senderConstraining": "none"
  },
  "flow": {
    "args": [
      {
        "name": "IRONFANG_API_KEY",
        "description": "An API key minted in the portal with the finance:einvoices:rulesets:read scope (or finance:einvoices:rulesets:read).",
        "required": true
      }
    ],
    "steps": [
      {
        "id": "verify-key",
        "description": "Prove the key works and read the registered rulesets. Requires finance:einvoices:rulesets:read.",
        "auth": "platform-api-key",
        "request": {
          "method": "GET",
          "url": "https://api.ironfang.com/finance/v1/einvoices/rulesets",
          "headers": {
            "Authorization": "Bearer {args.IRONFANG_API_KEY}",
            "Accept": "application/json"
          }
        },
        "onStatus": {
          "200": {
            "action": "continue",
            "message": "The key is valid; the body holds the registered rulesets."
          },
          "401": {
            "action": "fail",
            "message": "The key is missing, malformed or revoked."
          },
          "403": {
            "action": "fail",
            "message": "The key exists but lacks finance:einvoices:rulesets:read."
          }
        }
      }
    ],
    "outputs": {
      "rulesets": "{steps.verify-key.body}"
    }
  },
  "economics": {
    "pricingUrl": "https://ironfang.com/pricing#finance",
    "freeTier": "Free each UTC calendar month on every account, with no card: 250 validations and 100 generated documents. Paid usage of Ironfang Finance needs an approved UK or EU business profile on the account; the free allowances are open to everyone. The anonymous validator and JSON playground on the site are free with request and rate limits, and are not counted against an account.",
    "rateLimitsUrl": "https://ironfang.com/docs/finance#limits"
  }
}
