POST /v1/transactions/create-custom

Create Custom Transaction

application/json

Body Required

Request for creating a custom transaction

  • familyId string Required

    Family ID

  • automaticCharge boolean Required

    Should the transaction be automatically charged

  • date string(date) Required

    Date to create transaction for

  • details array[object] Required

    details

    Custom Transaction Details Schema, to create a relevant transaction tree

    Hide details attributes Show details attributes object
    • description string Required

      Description of the transaction

    • amount integer Required

      Amount to create transaction for (in pence)

    • discount integer Required

      Discount to create transaction for (in pence)

    • taxRateId string | null

      Tax rate ID

Responses

  • 403 application/json

    Not authorized

    Hide response attributes Show response attributes object

    Error schema

    • statusCode number Required

      Status Code

    • messages array[string] Required

      List of error messages

    • exception object

      Exception

  • 404 application/json

    Not found

    Hide response attributes Show response attributes object

    Error schema

    • statusCode number Required

      Status Code

    • messages array[string] Required

      List of error messages

    • exception object

      Exception

  • 200 application/json

    successful operation

    Hide response attributes Show response attributes object
    • aggregateId string Required

      aggregateId

    • transaction object Required

      Transaction schema

      Hide transaction attributes Show transaction attributes object
      • id string Required

        id

      • companyId string Required

        Company ID

      • familyId string Required

        Family ID

      • familyName string Required

        Family name

      • relatedTransactionId string | null

        Related transaction ID

      • type string Required

        Values are debit or credit.

      • date string(date) Required

        Date of transaction

      • description string Required

        Description of transaction

      • deletedAt string(date-time) | null

        Deleted at date

    • details array[object] Required

      details

      Transaction Details with related entities schema

      Hide details attributes Show details attributes object
      • details object Required

        Transaction Detail schema

        Hide details attributes Show details attributes object
        • id string Required

          id

        • companyId string Required

          Company ID

        • transactionId string Required

          Transaction ID

        • type string Required

          Values are manual-debit, tax, additional-fee, registration-fee, tuition, trial, refund, payment-auto-failed, payment-auto-failed-reversal, discount-credit, payment-manual, discount, discount-tax, credit-note, manual-debit-credit, tax-credit, registration-fee-credit, tuition-credit, trial-credit, payment-auto, payment-pending-card, fee-class-manager, or fee-company.

        • amount integer Required

          Amount of transaction

        • description string Required

          Description of transaction

        • deletedAt string(date-time) | null

          Deleted at date

      • relatedEntities array[object] Required

        relatedEntities

        Transaction Detail Entity schema

        Hide relatedEntities attributes Show relatedEntities attributes object
        • id string Required

          id

        • companyId string Required

          Company ID

        • transactionDetailId string Required

          Transaction Detail ID

        • entityId string Required

          Entity ID

    • stats object Required

      Transaction stats

      Hide stats attributes Show stats attributes object
      • total integer Required

        Total amount of transaction

      • subtotal integer Required

        Subtotal amount of transaction

      • discountTotal integer Required

        Total discount amount of transaction

      • taxTotal integer Required

        Total tax amount of transaction

POST /v1/transactions/create-custom
curl \
 --request POST 'https://localhost/v1/transactions/create-custom' \
 --header "Content-Type: application/json" \
 --data '[{"familyId":"fml_xxxxxxxxxxxxxxxxxxxxxxxxxx","automaticCharge":true,"date":"2023-12-05","details":[{"description":"string","amount":100,"discount":100,"taxRateId":"tax_xxxxxxxxxxxxxxxxxxxxxxxxxx"}]}]'
Request examples
[
  {
    "familyId": "fml_xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "automaticCharge": true,
    "date": "2023-12-05",
    "details": [
      {
        "description": "string",
        "amount": 100,
        "discount": 100,
        "taxRateId": "tax_xxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    ]
  }
]
Response examples (403)
{
  "statusCode": 42.0,
  "messages": [
    "string"
  ],
  "exception": {}
}
Response examples (404)
{
  "statusCode": 42.0,
  "messages": [
    "string"
  ],
  "exception": {}
}
Response examples (200)
[
  {
    "aggregateId": "trn_xxxxxxxxxxx",
    "transaction": {
      "id": "trn_123123123123",
      "companyId": "co_123123123123",
      "familyId": "fml_123123123123",
      "familyName": "Potter",
      "relatedTransactionId": "trn_123123123123",
      "type": "debit",
      "date": "2023-12-05",
      "description": "This is a transaction",
      "deletedAt": "2023-12-05 14:30:41"
    },
    "details": [
      {
        "details": {
          "id": "trn_123123123123",
          "companyId": "co_123123123123",
          "transactionId": "trn_123123123123",
          "type": "manual-debit",
          "amount": 100,
          "description": "This is a transaction",
          "deletedAt": "2023-12-05 14:30:41"
        },
        "relatedEntities": [
          {
            "id": "trn_123123123123",
            "companyId": "co_123123123123",
            "transactionDetailId": "trnd_123123123123",
            "entityId": "cls_123123123123"
          }
        ]
      }
    ],
    "stats": {
      "total": 1000,
      "subtotal": 950,
      "discountTotal": 30,
      "taxTotal": 20
    }
  }
]