ExpenseType Examples

Query All Expense Types

Query for all expense types.

[
  {
    "Action": "Query",
    "QueryType": "ExpenseTypeAll",
    "DomainType": "Replicon.Expense.Domain.ExpenseType",
    "Args": []
  }
]

Query Expense Types by Id

Query for expense types by Id.

[
  {
    "Action": "Query",
    "QueryType": "ExpenseTypeById",
    "DomainType": "Replicon.Expense.Domain.ExpenseType",
    "Args": [
      [
        "2",
        "3"
      ]
    ]
  }
]

Query Expense Types by Name

Query for expense types by name.

[
  {
    "Action": "Query",
    "QueryType": "ExpenseTypeByName",
    "DomainType": "Replicon.Expense.Domain.ExpenseType",
    "Args": [
      "Mileage"
    ]
  }
]

Create Expense Type (Expense Code)

Create an expense type

[
  {
    "Action": "Create",
    "Type": "Replicon.Expense.Domain.ExpenseType",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "New Expense Type",
        "Description": "created via RepliConnect",
        "TaxCode1": {
          "__type": "Replicon.Expense.Domain.TaxCode",
          "Identity": "2"
        },
        "Formula1": "$Net * 1.05"
      }
    ]
  }
]

SetRate Operation

Operation to set the rate for a rated expense type on create

[
  {
    "Action": "Create",
    "Type": "Replicon.Expense.Domain.ExpenseType",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "New Expense Type",
        "Description": "created via RepliConnect",
        "TaxCode1": {
          "__type": "Replicon.Expense.Domain.TaxCode",
          "Identity": "2"
        },
        "Formula1": "$Net * 1.05",
        "ExpenseUnitLabel": "km"
      },
      {
        "__operation": "SetRate",
        "Currency": {
          "__type": "Replicon.Domain.Currency",
          "Identity": "1"
        },
        "Rate": 99
      }
    ]
  }
]

SetRate Operation

Operation to set the rate for a rated expense type while editing an existing rated expense type

[
  {
    "Action": "Edit",
    "Type": "Replicon.Expense.Domain.ExpenseType",
    "Identity": "19",
    "Operations": [
      {
        "__operation": "SetRate",
        "Currency": {
          "__type": "Replicon.Domain.Currency",
          "Identity": "1"
        },
        "Rate": 75
      }
    ]
  }
]