Transaction Allocation

Transaction Allocation Examples Overview:

This page provides comprehensive examples of GraphQL queries and mutations for managing transaction allocations in the ANZ Cash Management Central (ACMC) system. These operations cover various aspects of allocation management, including querying unallocated transactions, initiating transaction allocations, un-allocating transactions, and retrieving allocation command details. Each example is accompanied by explanations of input fields, sample requests, and response structures to help developers effectively integrate with the ACMC API for allocation-related operations.

The ACMC system handles transaction allocations through both automatic and manual processes:

  1. Automatic Allocation:
    • Payments or receipts that match a Client Account number or Client Account reference are automatically allocated to the relevant CMM Client Account.
  2. Manual Allocation:
    • Receipts not automatically allocated remain available in the Source Account for 10 Business Days.
    • During this period, these receipts can be manually allocated to a Client Account.
    • If allocation is completed within 10 Business Days of receipt, interest for the transaction will be backdated to the date of receipt.
  3. Unallocated Receipts:
    • Receipts that remain unallocated for 10 Business Days are transferred to the Nominated Trust Account on the subsequent Business Day.
    • These receipts do not accrue interest for the period they remained unallocated within the Source Account.
    • Once transferred to the Nominated Trust Account, they will accrue interest at the rate applied to that account (if any).

The following GraphQL operations allow you to manage and query these manual allocation processes within the ACMC system.

Table of Contents

  1. Query Unallocated transactions
  2. Initiate Transaction Allocation
  3. Query Transaction Allocation Command
  4. Un-allocate a Transaction
  5. Query Un-allocate Transaction Command

Query Unallocated Transactions (payments and receipts)

Query: node: unallocated

This query retrieves a list of unallocated payments and receipts.

{
    bank {
        unallocated {
            edges {
                node {
                    ... on Payment {
                        __typename
                        id
                        entryReference
                        narrative
                        unallocatedReason
                        reversal
                        transactions {
                            edges {
                                node {
                                    currency
                                    transactionType
                                    valueDate
                                    initiatedTimestamp
                                    businessProcess {
                                        ... on Payment {
                                            amount {
                                                creditDebit
                                                value
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    ... on Receipt {
                        __typename
                        id
                        entryReference
                        narrative
                        unallocatedReason
                        reversal
                        transactions {
                            edges {
                                node {
                                    currency
                                    transactionType
                                    valueDate
                                    initiatedTimestamp
                                    businessProcess {
                                        ... on Receipt {
                                            amount {
                                                creditDebit
                                                value
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Response:

{
	"data": {
		"bank": {
			"unallocated": {
				"edges": [
					{
						"node": {
							"__typename": "Payment",
							"id": "UmVjZWlwdDo5MDg0ZTQ5OTE2N2Q0ZDRhMjg2NjIzZTZmYWQyNDg2OWFiYWNjM2UzZjJkMTMwYjQyMWJkYmVmOTZjYzdkODk0",
							"entryReference": "173300000",
							"narrative": "173300000 Matching",
							"unallocatedReason": "Manually unallocated",
							"reversal": false,
							"transactions": {
								"edges": [
									{
									"node": {
										"currency": "AUD",
										"transactionType": "source-allocation",
										"valueDate": "2022-11-24",
										"initiatedTimestamp": "2022-11-24T00:46:58.404Z",
										"businessProcess": {
											"amount": {
													"creditDebit": "CREDIT",
													"value": "900.00"
												}
											}
										}
									}
								]
							}
						}
					}
				]
			}
		}
	}
}

Response Fields:

Field Description
id ID of the unallocated transaction
__typename Type of the transaction, payment or receipt
entryReference Reference of the transaction
narrative Narrative of the transaction
unallocatedReason Reason for unallocated transaction
reversal Whether the transaction is a reversal
transactions Transactions associated with the unallocated payments or receipts

Initiate Transaction Allocation

Mutation: allocate

This mutation allocates a transaction to a client account.

mutation ($input: AllocateInput!) {
	allocate(i: $input) {
		commandId
	}
}

Input Fields:

Field Description
accountId ID of the client account to allocate to
allocationComment Comment for the allocation
unallocatedId ID of the unallocated transaction
{
	"input": {
		"accountId": "QWNjb3VudDoyN2ViNWEzZGZhY2Y1Y2FkN2I4OWVlNzk0MWYxNGRkYmQzMTk3MGI3ODJhNThhYTg4OWE3ZWRlODY2OWQ3ODBk",
		"allocationComment": null,
		"unallocatedId": "UmVjZWlwdDoyZWRkY2E5YTk2YTE1OWYzYjRiZDNiZjcyZjExZWIxNWUzYTcxMWI4MzljMGQ4YTA1NjE0ZTNmZDA2YWNjMTFl"
	}
}

Query Transaction Allocation Command

Query: node: allocation

This query retrieves the status of a transaction allocation command.

query QueryCommand($commandId: ID!) {
    node(id: $commandId) {
        __typename
        ... on Command {
            action
            state
            step
            invalid {
                field
                reason
                __typename
            }
            createdTimestamp
        }
    }
}

Variables:

{
	"commandId": "Q29tbWFuZDo3ZjIyMDM2Ny0wYTljLTRhZDEtOTY3Yi1hN2ZmZTNlYzZiZjA="
}

Response:

{
	"data": {
		"node": {
			"__typename": "AllocatableAllocateCommand",
			"action": "ALLOCATABLE-ALLOCATE",
			"state": "SUCCESSFUL",
			"step": "END",
			"invalid": [],
			"createdTimestamp": "2024-10-16T03:00:13.564Z"
		}
	}
}

Response Fields:

Field Description
action Action performed by the command
state Current state of the command
step Current step of the command
invalid List of validation errors (empty in this case)
createdTimestamp Timestamp when the command was created

Un-allocate a Transaction

Mutation: unallocate

This mutation removes the allocation of a transaction from client accounts.

mutation {
  unallocate(i: {unallocatableId: "UmVjZWlwdDoyZWRkY2E5YTk2YTE1OWYzYjRiZDNiZjcyZjExZWIxNWUzYTcxMWI4MzljMGQ4YTA1NjE0ZTNmZDA2YWNjMTFl"}) {
    commandId
  }
}

Input Fields:

Field Description
unallocatableId Unique id of the Payment or Receipt to be unallocated

Query Un-allocate Transaction Command

Query: node: unallocate

This query retrieves the status of an un-allocation command.

query QueryCommand($commandId: ID!){
	node(id: $commandId){
		__typename...onCommand{
			actionstatestepinvalid{
				fieldreason__typename
			}createdTimestamp
		}
	}
}

Variables:

{
	"commandId": "Q29tbWFuZDo2MTY1NjdlOC1mNTA3LTQ3NmEtOWE3ZC03YjRkNGQ4NDdjMmE="
}

Response:

{
	"data": {
		"node": {
			"__typename": "UnallocateCommand",
			"action": "UNALLOCATE",
			"state": "SUCCESSFUL",
			"step": "END",
			"invalid": [],
			"createdTimestamp": "2024-10-16T03:10:39.939Z"
		}
	}
}

Response Fields:

Field Description
action Action performed by the command
state Current state of the command
step Current step of the command
invalid List of validation errors (empty in this case)
createdTimestamp Timestamp when the command was created