Transaction Channels Configuration
  • 03 May 2023
  • 5 Minutes To Read
  • Dark
    Light
  • PDF

Transaction Channels Configuration

  • Dark
    Light
  • PDF

Article Summary

A transaction channel is a form of payment such as cash, POS device, receipt, check, bank and so on.

Mambu ships with one predefined transaction channel — cash — but you can add other transaction channels as needed for your organization. For more information, see Transaction Channels.

With Configuration as Code (CasC), you may batch configure your transaction channels configuration via the API using YAML. For general information on CasC, see Configuration as Code Overview.

API Operations

CasC for transaction channels supports two operations.

ActionEndpointDescription
GET/configuration/transactionchannels.yamlGet current transaction channels configuration.
PUT/configuration/transactionchannels.yamlWrite a new transaction channels configuration to Mambu.
Please Note

If you PUT a configuration to Mambu, any current configuration settings not included in the new YAML configuration will be deleted. Unless they cannot be deleted in which case you will receive a warning. PATCH requests are not currently supported.

Requests

For general information on CasC requests such as authentication and required headers, see Configuration as Code Overview.

The following section shows sample requests using curl and basic authentication. For all examples, replace TENANT_NAME with your actual tenant name.

GET configuration

curl -X GET 'https://TENANT_NAME.mambu.com/api/configuration/transactionchannels.yaml' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Authorization: Basic {auth}'

{auth} is the base-64-encoded value of username:password. For more information, see Authentication in our API reference.

PUT configuration

curl -X PUT 'https://TENANT_NAME.mambu.com/api/configuration/transactionchannels.yaml' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Content-Type: application/yaml' \
-H 'Authorization: Basic {auth}' \
--data-binary @transactionchannels.yaml

{auth} is the base-64-encoded value of username:password. For more information, see Authentication in our API reference.

“@transactionchannels.yaml” represents the absolute path of the file on your device.

(Use “--data-raw” if you want to specify the YAML body inline).

Configuration body example

---
defaultTransactionChannel:
  id: "cash"
  name: "Cash"
  state: "ACTIVE"
  loansConstraints:
    usage: "UNCONSTRAINED_USAGE"
    constraints: []
  savingsConstraints:
    usage: "UNCONSTRAINED_USAGE"
    constraints: []
  usageRights:
    roles: []
    allUsers: true
transactionChannels:
- id: "63547"
  name: "Visa Card"
  state: "ACTIVE"
  loansConstraints:
    usage: "LIMITED_USAGE"
    constraints:
    - criteria: "PRODUCT"
      filterElement: "EMPTY"
      values: []
    matchFilter: "ALL"
  savingsConstraints:
    usage: "UNCONSTRAINED_USAGE"
    constraints: []
  glAccountCode: "66734"
  usageRights:
    roles:
    - "35436"
    allUsers: false
- id: "837489"
  name: "Master card "
  state: "ACTIVE"
  loansConstraints:
    usage: "LIMITED_USAGE"
    constraints:
    - criteria: "PRODUCT"
      filterElement: "EMPTY"
      values: []
    matchFilter: "ALL"
  savingsConstraints:
    usage: "UNCONSTRAINED_USAGE"
    constraints: []
  glAccountCode: "68982"
  usageRights:
    roles:
    - "43643"
    allUsers: false
- id: "83203"
  name: "BACS"
  state: "ACTIVE"
  loansConstraints:
    usage: "LIMITED_USAGE"
    constraints:
    - criteria: "AMOUNT"
      filterElement: "LESS_THAN"
      values:
      - "9999.99"
    matchFilter: "ALL"
  savingsConstraints:
    usage: "LIMITED_USAGE"
    constraints:
    - criteria: "AMOUNT"
      filterElement: "LESS_THAN"
      values:
      - "9999.99"
    matchFilter: "ALL"
  glAccountCode: "54323"
  usageRights:
    roles:
    - "1064356630"
    allUsers: false
- id: "82352"
  name: "CHAPS"
  state: "ACTIVE"
  loansConstraints:
    usage: "LIMITED_USAGE"
    constraints:
    - criteria: "AMOUNT"
      filterElement: "MORE_THAN"
      values:
      - "10000.00"
    matchFilter: "ALL"
  savingsConstraints:
    usage: "LIMITED_USAGE"
    constraints:
    - criteria: "AMOUNT"
      filterElement: "MORE_THAN"
      values:
      - "10000.00"
    matchFilter: "ALL"
  glAccountCode: "63213"
  usageRights:
    roles:
    - "1108047100"
    allUsers: false

Attributes

Transaction channel configuration attributes

NameTypeDescriptionRequired
defaultTransactionChannelTransaction
Channel
Configuration
The default transaction channel.
transactionChannelsTransaction
Channel
Configuration
List of all transaction channels.

Transaction channel attributes

NameTypeDescriptionRequired
idStringUser-defined ID, unique in the configuration.
nameStringName of the transaction channel.
stateStringState of the transaction channel. The options are ACTIVE and INACTIVE.
loanConstraintsListA list of loan constraints for the transaction channel.
loanConstraints.
usage
StringStates the limited or unconstrained usage of the transaction channel. The options are UNCONSTRAINED_USAGE and LIMITED_USAGE.
loanConstraints.
constraints
Constraint
Configuration
The loan constraints for the transaction channel.Required if usage is LIMITED_USAGE, otherwise must be empty.
loanConstraints.
matchFilter
StringThe match filter of the constraints. The options are ANY or ALL.Required if usage is LIMITED_USAGE, otherwise must be empty.
savingsConstraintsListA list of savings constraints for the transaction channel.
savingsConstraints.
usage
StringStates the limited or unconstrained usage of the transaction channel. The options are UNCONSTRAINED_USAGE and LIMITED_USAGE.
savingsConstraints.
constraints
Constraint
Configuration
The saving constraints for the transaction channel.Required if usage is LIMITED_USAGE, otherwise must be empty.
savingsConstraints.
matchFilter
StringThe match filter of the constraints. The options are ANY or ALL.Required if usage is LIMITED_USAGE, otherwise must be empty.
glAccountCodeStringThe code of the GLAccount of the transaction channel.
usageRightsAccessRightsResponse representation of access rights configuration.
usageRights.roles[String]Lists the IDs in ascending order of the roles that have view/edit rights for this configuration when it's not accessible by all users.Required if allUsers is false.
usageRights.allUsersBooleanIndicates whether the configuration can be viewed or edited by all users if true or by the roles indicated by the roles attribute if false.

Loan and savings constraint attributes

NameTypeDescriptionRequired
criteriaStringSpecifies the criteria based on which the constraint will be applied. The options are AMOUNT, TYPE, and PRODUCT.
filterElementStringSpecifies the operator of the constraint. The options are EQUALS, EMPTY, NOT_EMPTY, MORE_THAN, LESS_THAN, BETWEEN, and IN.
values[String]The values of the constraint. Depending on the type of constraint the list will contain a variable number of values.Required for EQUALS, MORE_THAN, LESS_THAN, and BETWEEN filter elements. Not required for EMPTY and NOT_EMPTY filter elements.

Replies

If you do not receive a 200 OK status code then fix any validation errors and make another PUT request until you receive a 200 OK status code.

Please Note

If you PUT a valid YAML configuration to the API and you do not receive a 200 OK status code within 60 seconds, you may receive a 504 Gateway Timeout status code. We expect all responses to be below 60 seconds.

If you encounter this issue, please contact us through Mambu Support so we can investigate it.

Validations

With all use cases, a validation of the uploaded file will be done, ensuring the following:

  • Syntax is correct as per YAML standards and the template for holidays.
  • Minimum requirements indicates the line with the syntax error.
  • Content is correct.

Configuration settings may be specified in any order.

Transaction channel attribute validations

NameValidation
idThe ID must not exceed a length of 32 characters and must not be duplicate. The default transaction channel ID cannot be changed.
nameMaximum 256 characters in length.
glAccountCodeThe GL Account with the specified code must exist.

Access rights validations

NameValidation
rolesThe IDs specified in this list must not be blank or duplicate and must belong to an existing user role.

Constraint attribute validations

NameValidation
filterElement
  • AMOUNTcriterion can only have EQUALS, MORE_THAN, LESS_THAN, BETWEEN, EMPTY, and NOT_EMPTY values.
  • TYPEcriterion can only have IN, EMPTY, and NOT_EMPTY values.
  • PRODUCT criterion can only have IN, EMPTY, and NOT_EMPTY values.
values
  • It must be existing product IDs for PRODUCT criterion with filter element IN, either savings or loans, depending on the type of constraint.
  • It must have disbursment or repayment values for loans constraints with the TYPE criterion.
  • It must have deposit or withdrawal values for savings contrains with the TYPE criterion.

Warnings

In case a transaction channel cannot be deleted, it will be deactivated and the following warning will be returned: TransactionChannel [tr2] could not be deleted: The transaction channel cannot be deleted since it is used in a transaction.


Was this article helpful?