{
  "opencollection": "1.0.0",
  "info": {
    "name": "Suger API Billing API",
    "version": "1.0"
  },
  "items": [
    {
      "info": {
        "name": "Billing",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "List Addons",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/addon",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "List pagination size, default 1000, max value is 1000"
              },
              {
                "name": "offset",
                "value": "",
                "type": "query",
                "description": "List pagination offset, default 0"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "List all addon templates"
        },
        {
          "info": {
            "name": "Create Addon",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.suger.cloud/org/:orgId/addon",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Create an addon template"
        },
        {
          "info": {
            "name": "Get Addon",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/addon/:addonId",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "addonId",
                "value": "",
                "type": "path",
                "description": "Addon ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Get an addon template"
        },
        {
          "info": {
            "name": "Update Addon",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.suger.cloud/org/:orgId/addon/:addonId",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "addonId",
                "value": "",
                "type": "path",
                "description": "Addon ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Update an addon template"
        },
        {
          "info": {
            "name": "Delete Addon",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.suger.cloud/org/:orgId/addon/:addonId",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "addonId",
                "value": "",
                "type": "path",
                "description": "Addon ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Soft delete an addon template"
        },
        {
          "info": {
            "name": "List Refunds.",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/buyer/:buyerId/paymentTransaction/:paymentTransactionId/refund",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "buyerId",
                "value": "",
                "type": "path",
                "description": "Buyer ID"
              },
              {
                "name": "paymentTransactionId",
                "value": "",
                "type": "path",
                "description": "Payment transaction ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "list refunds of the payment transactions."
        },
        {
          "info": {
            "name": "Create Refund.",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.suger.cloud/org/:orgId/buyer/:buyerId/paymentTransaction/:paymentTransactionId/refund",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "buyerId",
                "value": "",
                "type": "path",
                "description": "Buyer ID"
              },
              {
                "name": "paymentTransactionId",
                "value": "",
                "type": "path",
                "description": "Payment transaction ID"
              },
              {
                "name": "amount",
                "value": "",
                "type": "query",
                "description": "Refund amount"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "create refund on the payment transaction, support partial refunds multiple times."
        },
        {
          "info": {
            "name": "List Invoices",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/invoice",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "entitlementId",
                "value": "",
                "type": "query",
                "description": "Optional, filter by the entitlement ID"
              },
              {
                "name": "buyerId",
                "value": "",
                "type": "query",
                "description": "Optional, filter by the given buyer ID"
              },
              {
                "name": "status",
                "value": "",
                "type": "query",
                "description": "Optional, filter by invoice status as filter, if not provided, all status invoices are returned"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "List pagination size, default 1000, max value is 1000"
              },
              {
                "name": "offset",
                "value": "",
                "type": "query",
                "description": "List pagination offset, default 0"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "List invoices with pagination and filter by status (optional)"
        },
        {
          "info": {
            "name": "Get Invoice",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/invoice/:invoiceId",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Get the invoice by ID"
        },
        {
          "info": {
            "name": "Update Invoice Info",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.suger.cloud/org/:orgId/invoice/:invoiceId/info",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Update a draft invoice. Only DueDate, OverallDiscount, and Memo can be updated."
        },
        {
          "info": {
            "name": "Issue Invoice",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.suger.cloud/org/:orgId/invoice/:invoiceId/issue",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Issue the invoice immediately. It can be used for manual issue or reissue invoice."
        },
        {
          "info": {
            "name": "Pay Invoice",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.suger.cloud/org/:orgId/invoice/:invoiceId/pay",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Initiate the payment for the invoice immediately. It can be used for manual payment or retry payment."
        },
        {
          "info": {
            "name": "Preview Invoice Email",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/invoice/:invoiceId/preview",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Returns the preview HTML content of the invoice issued email."
        },
        {
          "info": {
            "name": "Void Invoice",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.suger.cloud/org/:orgId/invoice/:invoiceId/void",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "Void the invoice. It can be used for manual void or cancel the invoice."
        },
        {
          "info": {
            "name": "List Payment Transactions",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.suger.cloud/org/:orgId/paymentTransaction",
            "params": [
              {
                "name": "orgId",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              },
              {
                "name": "buyerId",
                "value": "",
                "type": "query",
                "description": "Optional, filter by the given buyer ID"
              },
              {
                "name": "entitlementId",
                "value": "",
                "type": "query",
                "description": "Optional, filter by the given entitlement ID"
              },
              {
                "name": "invoiceId",
                "value": "",
                "type": "query",
                "description": "Optional, filter by the given invoice ID"
              },
              {
                "name": "status",
                "value": "",
                "type": "query",
                "description": "Optional, filter by status"
              },
              {
                "name": "type",
                "value": "",
                "type": "query",
                "description": "Optional, filter by transaction type"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "List pagination size, default 1000, max value is 1000"
              },
              {
                "name": "offset",
                "value": "",
                "type": "query",
                "description": "List pagination offset, default 0"
              }
            ],
            "auth": {
              "type": "apikey",
              "key": "Authorization",
              "value": "{{Authorization}}",
              "placement": "header"
            }
          },
          "docs": "List payment transactions with pagination and filters"
        }
      ]
    }
  ],
  "bundled": true
}