ACMC GraphQL - Payload Encryption

Payload Encryprion Overview:

The doEncrypt operation is a crucial security feature for transmitting sensitive information to the server. It uses the server’s public key to encrypt data, ensuring that only the server can decrypt it with its private key. This operation is particularly useful for protecting confidential data. The encrypted output can be used as input for other mutations that require secure data transmission. To maintain the highest level of security, always use HTTPS when communicating with the API, complementing the encryption provided by doEncrypt.

Key points

  • Input Type: EncryptInput
  • Output: Returns encryptedData as a string
  • Used for encrypting sensitive information before sending it to the server
  • Essential for operations that require secure data transmission, such as payments

Encrypt Data

Operation: doEncrypt

This mutation encrypts sensitive data using the server’s public key.

mutation ($input: EncryptInput!) {
  doEncrypt(input: $input) {
    encryptedData
  }
}

Variables

{
    "input": {
        "encryptedPayload": {
            "action": "payment",
            "payment-method": "NPP",
            "recipient": {
                "account-number": "1347825467",
                "bank-code": "083054",
                "name": "Sachin Testing"
            },
            "sender": {
                "account": {
                    "id": "QWNjb3VudDo1OTNmYThlMGFiNzQ4NDRmNzU0Y2M0ZGQ4MTA2ZTc5ZTEzYjhjNjgzMzc1NDBmNGMyNzc2OTRmZjhkNWRmYjVh"
                }
            },
            "amount": {
                "value": "5.00",
                "currency": "AUD"
            },
            "value-date": "2024-10-07",
            "reference": "npp pay"
        }
    }
}

Response

{
    "data": {
        "doEncrypted": {
            "commandId": "Q29tbWFuZDo5MTAxY2YwNi1iZTU3LTRjMDEtYWJmNi0xYWQ5NTM2NzA4Yjg="
        }
    }
}