Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. App calls /transact with the NO auth details

  2. In the details object, app inserts the user’s message as text + a callback url

  3. Provider responds with PendingValidation and a details an action object corresponding to the message from the underlying intent (text, menu, buttons, attachments)

    1. Where the response is delayed: Provider responds via the callback url

  4. App calls /transact/validate to supply the user’s choice/text

  5. Provider responds with any of the completion codes Successful or Failed if it has all it needs to finish off the intent. Otherwise go back to #3

  6. To query the status of a transaction, the app can call /transact/query

  7. Where the provider supports it, the app can call /transact/reverse to request a reversal (if supported)

...

Code Block
languagejson
{
    "request_ref": "{{request_ref}}",
    "request_type": "benefits_intent",
    "auth": {
        "type": null,
        "secure": null,
        "auth_provider": "Benefits",
        "route_mode":
null     },
    "transaction": {
        "mock_mode": "live",
        "transaction_ref": "{{transaction_ref}}",
        "transaction_desc": "A random transaction",
        "transaction_ref_parent": null,
        "amount": 0,
        "customer": {
            "customer_ref": "{{customer_id}}",
            "firstname": "Uju",
            "surname": "Usmanu",
            "email": "ujuusmanu@gmail.com",
            "mobile_no": "234802343132"
        },
        "meta": {
            "a_key": "a_meta_value_1",
            "another_key": "a_meta_value_2"
        },
        "details": {
            "message": "{{some kain text to trigger the intent or respond to a message}}",
            "callback_url": "{{a url to post the response to for long running proceses}}",
            "subsequent_messages": [], // An array of {{message}} elements. Such that if a developer already knows the EXACT set of questions that will follow in order to complete an intent, they can preload it, the provider will hold on their behalf and forward to OneChapp as each response is received. USE CASE: Making it possible to have one-shot API calls. e.g. We can then have Appsolute built a single USSD string to trigger pay4me in one shot when its time for retailer self-service built a single USSD string to trigger pay4me in one shot when its time for retailer self-service
            "subsequent_messages": [
                {
                    "question": "Onepipe Benefits",
                    "answer": "Opt in"
                },
                {
                    "question": "Please enter your BVN",
                    "answer": "{{ encrypted BVN }}"
                },
                {
                    "question": "Please enter your date (YYYY-MM-DD) of birth",
                    "answer": "{{ encrypted DOB }}"
                },
                {
                    "question": "do you want to continue?",
                    "answer": "yes"
                },
                {
                    "question": "4-digit transaction pin",
                    "answer": "{{encrypted PIN}}"
                }
            ],
            "client_id": "{{app_code of the app}}", //optional
            "sender_id": "{{customer_ref}}", //optional
            "channel": "OnePipe", //optional
        }
    }
}
Note

NOTE: details.message must be sent encryptedAny sensitive information (such as BVN, DOB, PIN etc) that would be provided in the subsequent messages MUST be encrypted using the app’s secret key.

Info

A NOTE ON subsequent_messages: An arrangement such that if a developer already knows the EXACT set of questions that will follow in order to complete an intent, they can preload it, the provider will hold the array on their behalf and forward to OneChapp as each response is received from OneChapp. USE CASE: Making it possible to have one-shot API calls. e.g. We can then have Appsolute built a single USSD string to trigger pay4me in one shot when its time for retailer self-service. Or we can have someone call a single API to upgrade an account from level 1 to 3

Response

Note

NOTE: provider_response.action must be received encrypted

Text

Code Block
languagejson
{
    "status": "Successful | Failed | PendingValidation",
    "message": "{{The same value in provider_response.action.message}}",
    "data": {
        "provider_response_code": "00",
        "provider": "Benefits",
        "errors": null,
        "error": null,
        "provider_response": {
            "reference":"263636363633777",
            "action": {
                "recipientId": "2347083108908",
                "message": {
                    "type": "text",
                    "text": "How much do you need?"                
                },
            }
            "meta":{}
        }
    }
}

...

Code Block
languagejson
{
  "request_ref":"{{request_ref}}", 
  "request_type":"benefits_intent",
	"auth": {
        "secure": "{{the encrypted message or selection from the user}}",
        "auth_provider": "Benefits" 
    },
    "transaction": {
        "transaction_ref": "70713093460718"
    }
}

...