Goods & Services API documentation

Goods & Services API documentation
4. Variable value recharges


Recharge transactions with variable value

Using DT One Goods & Services API you can perform recharge transactions with the amount you want (e.g. mobile top ups in India).

A recharge transaction will credit (top up) an account with the benefits of the product selected. Amounts to be paid are in local currency.

Depending on the parameters submitted to the API, a notification SMS may be sent to the sender and/or recipient of the transaction.

You can either do a real transaction, or simulate a transaction. A simulation will not debit your TShop account but will give you an overview of the response you would get from processing a real transaction.

Note that a successful status returned in the simulation does not guarantee a successful status during the real processing of the transaction. As no remote call is being performed during a simulation, exceptions that may happen between DT One and the partner delivering the final value to the recipient can not be anticipated and are therefore considered as successful.

If the transaction is processed successfully, the system will return a 201 http status. The status of the transaction itself is returned in the response.
If an error occurred during the processing, an HTTP code 400 or 500 will be returned.

1 - Perform a RECHARGE transaction

Request :

POST /transactions/variable_value_recharges

Transaction parameters :

Parameter Type Mandatory Description
account_number Text Yes Account number to benefit from the selected product
product_id Numeric Yes Product ID for the transaction, retrieve via product discovery methods
external_id Numeric Yes Unique ID of the transaction given by the client application
local_value Numeric Yes The transaction value in local amount to be sent
simulation Boolean No 1: simulation mode , 0: real transaction, set to 1 (simulation) by default
sender_sms_notification Boolean No Whether a SMS has to be sent to the sender mobile
sender_sms_text Text No Custom message to send to the sender mobile, up to 30 characters
recipient_sms_notification Boolean No Whether a SMS has to be sent to the recipient mobile
recipient_sms_text Text No Custom message to send to the recipient mobile, up to 30 characters
sender.last_name Text No Last name of the sender
sender.middle_name Text No Middle name of the sender
sender.first_name Text No First name of the sender
sender.email Email No Email of the sender
sender.mobile Phone Yes Mobile of the sender
recipient.last_name Text No Last name of the recipient
recipient.middle_name Text No Middle name of the recipient
recipient.first_name Text No First name of the recipient
recipient.email Email No Email of the recipient
recipient.mobile Phone Yes Mobile of the recipient
custom_field_1 Text No Optional custom information field
custom_field_2 Text No Optional custom information field
custom_field_3 Text No Optional custom information field

Body:

{
  "account_number":"911234567890",
  "product_id":"1520",
  "external_id":"14248512386098431",
  "local_value":"101",
  "simulation":"0",
  "sender_sms_notification":"1",
  "sender_sms_text":"Sender message",
  "recipient_sms_notification":"1",
  "recipient_sms_text":"Recipient message",
  "sender":{
    "last_name":"Delorm",
    "middle_name":"",
    "first_name":"John",
    "email":"john@testaccount.com",
    "mobile":"6012345678"
  },
  "recipient":{
    "last_name":"Delorm",
    "middle_name":"",
    "first_name":"Lisa",
    "email":"lisa@testaccount.com",
    "mobile":"911234567890"
  }
}

Response :

HTTP Code: 201

Body:

{
    "transaction_id": "225278",
    "simulation": 0,
    "status": "0",
    "status_message": "Transaction successful",
    "date": "2016-06-09 05:16:29",
    "account_number": "911234567890",
    "external_id": "14248512386098431",
    "operator_reference": "10291928",
    "product_id": "1520",
    "product": "IDEA Punjab India Bundles",
    "product_desc": "IDEA Punjab India Bundles",
    "product_currency": "INR",
    "product_value": 101,
    "local_currency": "INR",
    "local_value": 101,
    "operator_id": "2241",
    "operator": "IDEA Punjab India",
    "country_id": "766",
    "country": "India",
    "account_currency": "USD",
    "wholesale_price": 1.58,
    "retail_price": 1.58,
    "fee": 0,
    "sender": {
        "last_name": "Delorm",
        "middle_name": "",
        "first_name": "John",
        "email": "john@testaccount.com",
        "mobile": "6012345678",
        "custom_field_1": "",
        "custom_field_2": "",
        "custom_field_3": ""
    },
    "recipient": {
        "last_name": "Delorm",
        "middle_name": "",
        "first_name": "Lisa",
        "email": "lisa@testaccount.com",
        "mobile": "911234567890",
        "custom_field_1": "",
        "custom_field_2": "",
        "custom_field_3": ""
    }
    "sender_sms_notification": 1,
    "sender_sms_text": "Sender message",
    "recipient_sms_notification": 1,
    "recipient_sms_text": "Recipient message",
    "custom_field_1": "",
    "custom_field_2": "",
    "custom_field_3": ""
}

2 - Retrieve a RECHARGE transaction

Requests :

GET /transactions/variable_value_recharges/{transaction_id} - Retrieve the details of the transaction based on the DT One identifier. The response is in the same format as the POST response.

GET /transactions/variable_value_recharges/ext-{external-id} - Retrieve the details of the transaction based on the external identifier. The response is in the same format as the POST response.