SolidX

Create

Information about the create endpoint of the REST API, including usage, parameters, and responses

Create Endpoint Overview

This section provides information about the SolidX create REST endpoints, including how to use them, what parameters they accept, and what responses they return.

SolidX supports both single record creation and bulk record creation.

Mental Model

Create endpoints are the write path for new records in generated SolidX APIs.

  • Use JSON requests for standard records.
  • Use bulk requests when multiple records should be created in one operation.
  • Use multipart form data when the create operation includes media fields.

Creating a Single Record

Headers

Content-Type: application/json
Authorization: Bearer <token>

Request Body

POST /api/fee-type

{
  "feeType": "string",
  "instituteId": 0,
  "instituteUserKey": "string",
  "partPaymentAllowed": true,
  "latePaymentFeesType": "string",
  "latePaymentFees": 0
}

Sample Request

{
  "feeType": "tuition",
  "instituteUserKey": "Don Bosco",
  "partPaymentAllowed": true
}

Sample Response

{
  "statusCode": 200,
  "message": [],
  "error": "",
  "data": {
    "partPaymentAllowed": true,
    "feeType": "test",
    "institute": {
      "id": 3,
      "instituteName": "Don Bosco",
      "hostedPagePrefix": "donbosco",
      "paymentGatewayMerchantId": "CUST123",
      "instituteAddress": "Kurla",
      "instituteContactNumber": "9833795342"
    },
    "createdBy": {
      "id": 1,
      "fullName": "Default Admin",
      "username": "admin@example.service.com",
      "email": "admin@example.service.com"
    },
    "updatedBy": {
      "id": 1,
      "fullName": "Default Admin",
      "username": "admin@example.service.com",
      "email": "admin@example.service.com"
    },
    "id": 3,
    "createdAt": "2025-08-06T23:30:10.185Z",
    "updatedAt": "2025-08-06T23:30:10.185Z"
  }
}

Bulk Record Creation

To create multiple records at once:

POST /api/fee-type/bulk

Sample Bulk Request

[
  {
    "feeType": "tuition",
    "instituteUserKey": "Don Bosco",
    "partPaymentAllowed": true
  }
]

Creating a Record with Media

If your model includes media fields (e.g., uploading a logo), use the multipart/form-data content type.

Request with Media

POST /api/fee-type
Content-Type: multipart/form-data
Authorization: Bearer <token>

Multipart Form Data Example

--boundary
Content-Disposition: form-data; name="data"

{
  "feeType": "tuition",
  "instituteUserKey": "Don Bosco",
  "partPaymentAllowed": true
}
--boundary
Content-Disposition: form-data; name="logo"; filename="tuitionLogo.png"
Content-Type: image/png

<binary data>
--boundary--

Access Requirement

Ensure the caller has the appropriate create permission for the model. Refer to Permissions for the access-control side of the flow.