Definitions

What are definitions?

Definitions are helpful when you want to reuse or enforce a specific structure to objects within Modernbanc.

Examples of when you might want to use definitions:

  • enforce the account and routing number for a bank account route.
  • ensure every route has a card number, cardholder name, and expiration date for a credit card.
  • your app has a monthly subscription fee, and you want the structure of your transactions to reflect that.

Currently, definitions are only supported for routes but will be added to additional Modernbanc objects soon.

Note about JSONSchema

Definitions, specifically variable_definitions, must adhere to JSONSchema.

In the below examples, you can see the variable_definitions for a credit card and a bank account and their accompanying correct variables. If the variables you provide to a route, or another object, don't match the variable_definitions schema, you will receive an error.

{
    "type": "object",
    "properties": {
        "credit_card_name": {
            "description": "CC name",
            "type": "string"
        },
        "credit_card_number": {
            "description": "Credit card number",
            "type": "integer"
        },
        "credit_card_expiration": {
            "description": "Credit card expiration date mm/yy format",
            "type": "string"
        },
        "credit_card_cvv": {
            "description": "Credit card cvv number",
            "type": "integer"
        }
    },
    "required": [
        "credit_card_number", "credit_card_expiration", "credit_card_cvv"
    ]
}

Usage

Create definition

  • Coming soon!

List definitions

  • Coming soon!

Update definition

  • Coming soon!

Delete definition

- Coming soon!