# /organizations/{organizationId}/subaccounts/preview

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Partner API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://admin.formstack.com/api/v1",
      "description": "Partner API"
    }
  ],
  "paths": {
    "/organizations/{organizationId}/subaccounts/preview": {
      "post": {
        "tags": [
          "PartnerApi"
        ],
        "operationId": "createNewSubaccountPreview",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "ID of the parent organization",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "b443d63c-3e37-11f1-8898-0242ac000003"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewBuildNewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New Subaccount Billing Preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerApiCreateSubaccountPreview"
                }
              }
            }
          },
          "422": {
            "description": "Errors occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/general_validation_error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "common.MoneyAmount": {
        "properties": {
          "amount": {
            "description": "amount in cents/smallest monetary unit for a currency",
            "type": "string",
            "example": "4200"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "formatted": {
            "type": "string",
            "example": "$400.00"
          }
        },
        "type": "object",
        "readOnly": true
      },
      "general_validation_error": {
        "properties": {
          "message": {
            "description": "Basic error description",
            "type": "string",
            "example": "The given data failed to pass validation."
          },
          "errors": {
            "description": "Basic error description",
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string",
                "example": "cannot be blank"
              }
            }
          }
        },
        "type": "object"
      },
      "PreviewBuildNewRequest": {
        "required": [
          "productHandles"
        ],
        "properties": {
          "productHandles": {
            "type": "array",
            "items": {
              "description": "Billing product handle (e.g. p: or c: prefix)",
              "type": "string"
            },
            "example": [
              "p:forms-teams",
              "c:forms-extra-user:2"
            ]
          },
          "periodicity": {
            "description": "Periodicity of the order",
            "type": "string",
            "example": "yearly",
            "enum": [
              "monthly",
              "yearly"
            ]
          }
        },
        "type": "object"
      },
      "PartnerApiCreateSubaccountPreview": {
        "properties": {
          "immediateCharge": {
            "$ref": "#/components/schemas/common.MoneyAmount"
          },
          "regularCharge": {
            "$ref": "#/components/schemas/common.MoneyAmount"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer authentication"
      }
    }
  },
  "tags": [
    {
      "name": "PartnerApi",
      "description": "PartnerApi"
    }
  ]
}
```