Use the Transactions API to pay & process a specific product. Transactions can be used to process a variety of products, Wireless Refill, Refill GiftCards, Bill Payments and much more.

In order to create a transaction must have the product to pay and all required inputs.

Our API provide a helpful method to use before submit a transaction: validate.

This method is completely optional, but useful when you want to displays errors to the final user without having to submit a transaction yet. With this method you can let us make the validation of all the data entered by the client.

The validation process is more than a simple validation of the data submitted by the user, can check if the merchant has enough balance to process that transaction, if the product is still available and active, in other words, prepare the transaction and verify if it is possible to process the transaction with the given data.

The validation mutation is very similar to the submit transaction mutation with two main differences.

  • Most of the fields are optional, and only those that are sent or strictly necessary are verified.
  • The validation never creates or processes the transaction, for that reason it does not return a transaction number or status.

A validation is successful when it returns the selected fields, otherwise a failed validation always returns null and the list of errors.

Example of FAILED validation:

mutation validateTransaction($validate: ValidateTransactionInput!) {
    transactions {
        validate(input: $validate){
            total
        }
    }
}
{
  "validate": {
    "product": "ji12sd4c0a3D0=",
    "inputs": {
      "amount": 50
    }
  }
}
{
  "errors": [
    {
      "code": 422,
      "tracking_id": "86136e8f-d21f-ca53-aefb-312916d6",
      "message": "Unprocessable Entity",
      "category": "user",
      "constraintViolations": [
        {
          "code": "c1051bb4-d103-4f74-8988-acbcafc7fdc3",
          "message": "This value should not be blank.",
          "messageTemplate": "This value should not be blank.",
          "propertyPath": "inputs.accountNumber",
          "parameters": {
            "{{ value }}": "null"
          },
          "invalidValue": null,
          "plural": null
        }
      ]
    }
  ],
  "data": {
    "transactions": {
      "validate": null
    }
  }
}

The error 422 refer to invalid submitted data. Can safely display constraint violations message to final users, the user must update the form and try submitting the transaction again. Can use the propertyPath to resolve what’s the input with error.

Validation error always contains a key called constraintViolations with some details about the validation error.

Example of SUCCESS validation:

mutation validateTransaction($validate: ValidateTransactionInput!) {
    transactions {
        validate(input: $validate){
            total
        }
    }
}
{
  "input": {
    "product": "ji12sd4c0a3D0=",
    "inputs": {
      "accountNumber": "+13051231234",
      "amount": 50
    }
  }
}
{
  "data": {
    "transactions": {
      "validate": {
        "total": 50
      }
    }
  }
}