{
  "opencollection": "1.0.0",
  "info": {
    "name": "OpenRelay Account Billing API",
    "version": "0.1.0"
  },
  "items": [
    {
      "info": {
        "name": "Billing",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Read the org's auto-recharge policy",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/auto-recharge",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Read the org's auto-recharge policy"
        },
        {
          "info": {
            "name": "Set the org's auto-recharge policy",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/auto-recharge",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Set the org's auto-recharge policy"
        },
        {
          "info": {
            "name": "Org balance + recent transactions",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/balance",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Org balance + recent transactions"
        },
        {
          "info": {
            "name": "Charge the saved card to top up prepaid balance",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/deposit",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Charges the org's default saved card off-session. The balance credit is applied by the payment_intent.succeeded webhook (the authoritative money signal), not this response — poll the balance after success."
        },
        {
          "info": {
            "name": "List saved cards (brand/last4/exp only)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/payment-methods",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "List saved cards (brand/last4/exp only)"
        },
        {
          "info": {
            "name": "Remove a saved card",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/payment-methods/:paymentMethodId",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              },
              {
                "name": "paymentMethodId",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Remove a saved card"
        },
        {
          "info": {
            "name": "Start saving a card (Stripe SetupIntent for inline Elements)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.openrelay.inc/v1/orgs/:orgId/billing/setup-intent",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Start saving a card (Stripe SetupIntent for inline Elements)"
        }
      ]
    }
  ],
  "bundled": true
}