{
  "opencollection": "1.0.0",
  "info": {
    "name": "Earnipay Invoicing App Business API",
    "version": "1.0"
  },
  "items": [
    {
      "info": {
        "name": "Business",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Upload a file",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/businesses/upload",
            "body": {
              "type": "multipart-form",
              "data": [
                {
                  "name": "file",
                  "type": "text",
                  "value": ""
                },
                {
                  "name": "folder",
                  "type": "text",
                  "value": ""
                }
              ]
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Upload an image file (e.g. business logo) to S3. Returns a URL that can be used as logoUrl."
        },
        {
          "info": {
            "name": "Get user's businesses",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v1/businesses",
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Retrieve all businesses associated with the authenticated user"
        },
        {
          "info": {
            "name": "Create new business",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/businesses",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Create a new business profile. User becomes the OWNER automatically."
        },
        {
          "info": {
            "name": "Get business details",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v1/businesses/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Retrieve detailed information about a specific business"
        },
        {
          "info": {
            "name": "Update business",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update business profile information. Requires OWNER or ADMIN role."
        },
        {
          "info": {
            "name": "Delete business",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/v1/businesses/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Delete a business. Only OWNER can delete. This is a soft delete."
        },
        {
          "info": {
            "name": "Update business settings",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id/settings",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update business settings like requireApproval and autoSubmitToFirs. Only OWNER and ADMIN."
        },
        {
          "info": {
            "name": "Update FIRS configuration",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id/firs-config",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Configure FIRS settings including Business ID, Service ID, and crypto keys. Only OWNER can update."
        },
        {
          "info": {
            "name": "Upload crypto keys file",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id/crypto-keys",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "multipart-form",
              "data": [
                {
                  "name": "cryptoKeysFile",
                  "type": "text",
                  "value": ""
                }
              ]
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Upload the crypto_keys.txt file from FIRS. Only OWNER can upload."
        },
        {
          "info": {
            "name": "Update APP configuration",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id/app-config",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Configure Access Point Provider (APP) connection details. Only OWNER can update."
        },
        {
          "info": {
            "name": "Test APP connection",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/businesses/:id/test-app-connection",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Test connection to Access Point Provider with provided credentials"
        },
        {
          "info": {
            "name": "Set business as default",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/businesses/:id/set-default",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Set this business as the default for the authenticated user"
        },
        {
          "info": {
            "name": "Update APP provider",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id/app-provider",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Select which Access Point Provider (APP) to use for FIRS invoice submission. Only OWNER can update."
        },
        {
          "info": {
            "name": "Update Interswitch credentials",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/businesses/:id/interswitch-credentials",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Save Interswitch ClientId and ClientSecret for FIRS invoice submission. Only OWNER can update."
        },
        {
          "info": {
            "name": "Test Interswitch connection",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/businesses/:id/test-interswitch-connection",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Test connection to Interswitch API with provided ClientId and ClientSecret"
        },
        {
          "info": {
            "name": "Get supported APP providers",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v1/businesses/providers/supported",
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get list of supported Access Point Providers (APP) for FIRS invoice submission"
        }
      ]
    }
  ],
  "bundled": true
}