Examples Submit Transaction RTR Product Purchase
February 14, 2023 at 10:38 AMPrepaid RTR products always REQUIRE a user input like a phone number or email, in this case, for example, the product have an input labeled “Phone Number”. You need build a form in the UI to allow user input required information. See more about user inputs
Firstly must get all products inputs required to make the refill.
query ($id: ID!) {
node(id: $id) {
... on Product {
isPIN
inputs {
name
type
required
label
html {
type
maxlength
minlength
min
max
pattern
}
}
}
}
}
{
"id": "4132Q0YzBh4PQ=="
}
{
"data": {
"node": {
"isPIN": false,
"inputs": [
{
"name": "accountNumber",
"type": "phone",
"required": true,
"label": "Phone Number",
"html": {
"type": "tel",
"maxlength": null,
"minlength": null,
"min": null,
"max": null,
"pattern": null
}
}
]
}
}
}
Then submit the transaction with all user inputs
mutation ($input: SubmitTransactionInput!) {
transactions {
submit(input: $input) {
transaction {
date
status
grossTotal
adjustments {
name
total
}
total
response {
... on PinSaleResponse {
pin
code
}
message
redemptionUrl
}
}
}
}
}
{
"input": {
"product": "4132Q0YzBh4PQ==",
"inputs": { "accountNumber" : "+12345678901" }
}
}
{
"data": {
"transactions": {
"submit": {
"transaction": {
"date": "2020-12-16T13:09:43-05:00",
"status": "COMPLETED",
"grossTotal": 3.89,
"adjustments": [],
"total": 3.89,
"response": {
"redemptionUrl": null,
"message": "Your account has been successfully credited."
}
}
}
}
}
}
The response has more properties than shown here, this is a basic example, to see all possible properties look for the
SubmitTransactionPayload
type object in the explorer