Aggregated Payment (CLI to CLA) Overview:
When requesting an aggregated payment, please note the following guidelines and exceptions:
- The target account must be a domestic AU account.
- The customer must provide a unique reference that will be stored and can be accessed at both the client account level and source account level.
- Once the customer instruction is successfully processed, client transactions and the aggregated payment should be settled near real-time on the applicable accounts (i.e., Client Accounts & Source Account).
Exceptions and Error Handling
Client Account Issues If the customer instruction contains details of a client account that:
- Does not exist
- Has insufficient funds
- Has an active restraint
Then:
- The associated client transaction amount will be excluded from the aggregated payment.
- The aggregated total amount will be revised/updated before being paid to the target account.
- The status of the aggregated payment will indicate the existence of exception(s). For example: “Aggregated payment made but there were exceptions” (Note: The actual message may vary).
- The exception account and details (client account, transaction amount, exception reason, aggregation reference) will be recorded and can be queried by the customer.
Downstream Processing Failure In case of downstream processing failure (e.g., source account has insufficient funds):
- The exception will be reflected in the status of the aggregated payment.
- All associated client transaction amounts will be reverted back as available balance.
General Validation Exceptions The request will not proceed and the exception will be made available to the customer in the following cases:
- Mandatory fields missing from request
- Invalid data (e.g., invalid payment method, account format, etc.)
- Duplicate aggregated payment reference (i.e., not unique)
- Incorrect total number of instructions
- Incorrect total value of instructions
Create Aggregated Payment
Mutation: doEncrypted (action: aggregate-payment, creditDebit: DEBIT)
This mutation creates a new aggregated payment in the system, taking into account the guidelines and exceptions mentioned above.
mutation ($input: EncryptedInput!) {
doEncrypted(i: $input) {
commandId
}
}
Variables:
{
"input": {
"encryptedPayload": {
"action": "aggregate-payment",
"reference": "paying 25 ref1",
"externalAccount": {
"customer-linked-account": {
"id": "Q3VzdG9tZXJMaW5rZWRBY2NvdW50OmEwODQxNzcyN2E4ZjNkODEyYTViMDY4ZDRjZjU4YTRiMmY5NWE5ZTg1OGU4YThlOTNmMWQ3MDkyNThmZjMzZmI="
}
},
"count": 2,
"total-amount": {
"value": "25.00",
"currency": "AUD",
"creditDebit": "DEBIT"
},
"instructions": [
{
"tracing-id": "first pay 15",
"narrative": "pay 15",
"account": {
"id": "QWNjb3VudDo1OTNmYThlMGFiNzQ4NDRmNzU0Y2M0ZGQ4MTA2ZTc5ZTEzYjhjNjgzMzc1NDBmNGMyNzc2OTRmZjhkNWRmYjVh"
},
"amount": {
"value": "15.00",
"currency": "AUD",
"creditDebit": "DEBIT"
}
},
{
"tracing-id": "second pay 10",
"narrative": "pay 10",
"account": {
"id": "QWNjb3VudDpiMTFiYWQ3YzkzODFiZjA3MjMzOTE0YmM0OTljM2QwMTM2OGU3NTFhNTRkNjMxNzdhNDIxOTA5MjljMTQ0MDIz"
},
"amount": {
"value": "10.00",
"currency": "AUD",
"creditDebit": "DEBIT"
}
}
]
}
}
}
Input Fields
The EncryptedInput
contains an encryptedPayload
with the following fields:
Field | Type | Description |
---|---|---|
action | SCALAR! | Action type, set to “aggregate-payment” for disaggregated payments |
reference | SCALAR | Unique reference for the aggregated payment |
externalAccount | UNION | Contains the customer-linked-account / destination account details |
count | SCALAR | Number of instructions |
total-amount | OBJECT | Total amount and currency of the aggregated payment |
instructions | OBJECT! | List of payment instructions |
Instruction Object
Field | Type | Description |
---|---|---|
tracing-id | SCALAR | tracing identifier for the instruction |
narrative | SCALAR | Description of the instruction |
account | OBJECT | Contains the account identifier to credit |
amount | OBJECT | Amount and currency for this instruction |
Query Aggregated Payment Creation Command Status
Query: node
This query retrieves the status of a command, such as the aggregated payment creation command.
query QueryCommand {
node(id: "Q29tbWFuZDo1YWRhMTkzMy0zNDI4LTQzMDQtOGMyNC05NTFiNTY2M2E4NTM=") {
... on EncryptedCommand {
action
id
state
user
unencryptedCommand {
... on AggregatePaymentExecuteCommand {
action
id
state
invalid {
code
field
reason
}
aggregatePayment {
count
successfulCount
failedCount
totalAmount {
value
}
totalAmountSuccessful {
value
}
totalAmountFailed {
value
}
count
customerTransactionReference
paymentState
instructions {
edges {
node {
account {
accountNumber
}
amount {
creditDebit
currency
value
}
state
tracingId
}
}
}
}
}
}
}
}
}
Input Fields
Field | Type | Description |
---|---|---|
id | SCALAR! | The ID of the command to query |
CommandState
The command state
field in the response can have the following values. note that command state is different from the payment state.
SUBMITTED
SUCCESSFUL
PARTIALLY_SUCCESSFUL
FAILED
PaymentState
The payment state
field in the response can have the following values.
SUBMITTED
RECEIVED
PENDING
PROCESSING
COMPLETED
COMPLETED_WITH_ERRORS
REJECTED
Response
{
"data": {
"node": {
"action": "DO-ENCRYPTED-COMMAND",
"id": "Q29tbWFuZDo1YWRhMTkzMy0zNDI4LTQzMDQtOGMyNC05NTFiNTY2M2E4NTM=",
"state": "SUCCESSFUL",
"user": "SJTRADING",
"unencryptedCommand": {
"action": "AGGREGATE-PAYMENT-EXECUTE",
"id": "Q29tbWFuZDpiYWQxZjk2MmQ0MWQ1NTAzNDAzN2E5YWUzY2RkZDczOWM1MjE5YmFhNmIzYmYzYzhkYWYzNGE0YjRkZjRkYzZj",
"state": "SUCCESSFUL",
"invalid": [],
"aggregatePayment": {
"count": 2,
"successfulCount": 2,
"failedCount": 0,
"totalAmount": {
"value": "25.00"
},
"totalAmountSuccessful": {
"value": "25.00"
},
"totalAmountFailed": {
"value": "0.00"
},
"customerTransactionReference": null,
"paymentState": "COMPLETED",
"instructions": {
"edges": [
{
"node": {
"account": {
"accountNumber": "173358181"
},
"amount": {
"creditDebit": "DEBIT",
"currency": "AUD",
"value": "10.00"
},
"state": "SUCCEEDED",
"tracingId": "second pay 10"
}
},
{
"node": {
"account": {
"accountNumber": "173355850"
},
"amount": {
"creditDebit": "DEBIT",
"currency": "AUD",
"value": "15.00"
},
"state": "SUCCEEDED",
"tracingId": "first pay 15"
}
}
]
}
}
}
}
}
}
Response Fields
The following table explains the structure and meaning of each field in the response:
Field | Type | Description |
---|---|---|
data.node | INTERFACE | The entity containing information about the command |
data.node.action | SCALAR! | The operation type of the command, “DO-ENCRYPTED-COMMAND” |
data.node.id | SCALAR! | The unique identifier of the command |
data.node.state | ENUM! | The current state of the encryption command, “SUCCESSFUL” |
data.node.user | SCALAR! | The user who initiated the command, “SJTRADING” |
data.node.unencryptedCommand | INTERFACE | Contains nested command in the encrypted payload |
unencryptedCommand.action | SCALAR! | The specific action of the unencrypted command, “AGGREGATE-PAYMENT-EXECUTE” |
unencryptedCommand.id | SCALAR! | The unique identifier of the unencrypted command |
unencryptedCommand.state | ENUM! | The current state of the aggregate command, “SUCCESSFUL” |
unencryptedCommand.invalid | OBJECT! | List of any invalid fields or errors (empty in this case) |
unencryptedCommand.aggregatePayment | OBJECT | Contains the business process node of the aggregated payment |
aggregatePayment.count | SCALAR | The total number of instructions in the payment, 2 |
aggregatePayment.state | ENUM | The current state of the aggregate payment, “COMPLETE” |
aggregatePayment.successfulCount | SCALAR | The number of successful instructions, 2 |
aggregatePayment.failedCount | SCALAR | The number of failed instructions, 0 |
aggregatePayment.totalAmount.value | SCALAR! | The total amount of the aggregate payment, “25.00” |
aggregatePayment.totalAmountSuccessful.value | SCALAR! | The total amount of successful transactions, “25.00” |
aggregatePayment.totalAmountFailed.value | SCALAR! | The total amount of failed transactions, “0.00” |
aggregatePayment.customerTransactionReference | SCALAR | Customer’s reference for the transaction, null in this case |
aggregatePayment.paymentState | ENUM | The overall state of the payment, “COMPLETED” |
aggregatePayment.instructions | OBJECT! | Contains the list of individual payment instructions |
instructions.edges[].node | INTERFACE | Individual instruction details |
instructions.edges[].node.account.accountNumber | SCALAR | The account number for the instruction |
instructions.edges[].node.amount.creditDebit | ENUM! | Indicates if it’s a credit or debit, “DEBIT” |
instructions.edges[].node.amount.currency | SCALAR! | The currency of the transaction, “AUD” |
instructions.edges[].node.amount.value | SCALAR! | The amount of the individual instruction |
instructions.edges[].node.state | ENUM | Current state of the instruction, “SUCCEEDED” |
instructions.edges[].node.tracingId | SCALAR | Unique identifier for the instruction |