### Retrieve Product Information (GET Requests)
Source: https://developers.dtone.com/docs/best-practices-for-filtering-and-categorizing-products
Examples of GET requests for retrieving product information. This includes fetching a specific product by its ID and retrieving a list of products, potentially filtered by service and subservice IDs. These endpoints are crucial for understanding available products and their details.
```json
GET /v1/products/56876
```
```json
GET /v1/products?service_id=1&subservice_id=11
```
--------------------------------
### Example SDK Initialization with Multiple Options
Source: https://developers.dtone.com/docs/configure-solution-behavior
A comprehensive example of SDK initialization, demonstrating the use of clientUid, sessionId, template, containerId, and userCountry. This configuration sets up the SDK for a specific transaction within a designated HTML element and user location.
```javascript
const sdkConfiguration = {
clientUid: '0191db27-...',
sessionId: 'xxxx',
template: 'TransactionConfirmation',
containerId: 'sdk-container',
userCountry: 'FRA',
};
```
--------------------------------
### Retrieve Example Bundle Benefits
Source: https://developers.dtone.com/docs/mobile-ranged_value_recharge-copy
This JSON example shows how to retrieve details for a bundle package, which may include multiple benefits like Talktime, SMS, and Data. It illustrates the structure for different benefit types.
```json
{
"benefits": [
{
"additional_information": "unlimited DITO-to-DITO voice calls, 300 mins of calls to other mobile networks!",
"amount": {
"base": -1,
"promotion_bonus": 0,
"total_excluding_tax": -1,
"total_including_tax": -1
},
"type": "TALKTIME",
"unit": "MINUTES",
"unit_type": "TIME"
},
{
"additional_information": "Available for DITO Prepaid only. 8GB all-access data + unlimited all net SMS + unlimited DITO-to-DITO voice calls + 300 mins of calls to other mobile networks! + Optimax. Valid for 30 days. ",
"amount": {
"base": 8,
"promotion_bonus": 0,
"total_excluding_tax": 8,
"total_including_tax": 8
},
"type": "DATA",
"unit": "GB",
"unit_type": "DATA"
},
{
"additional_information": null,
"amount": {
"base": -1,
"promotion_bonus": 0,
"total_excluding_tax": -1,
"total_including_tax": -1
},
"type": "SMS",
"unit": "UNITS",
"unit_type": "QUANTITY"
}
]
}
```
--------------------------------
### Response Example for Product Retrieval
Source: https://developers.dtone.com/docs/gift-card-fixed_value_pin_purchase
This JSON response provides an example of the data returned when a product is retrieved by ID. It includes details like availability zones, benefits, pricing, operator information, and PIN-specific details such as validity and redemption instructions.
```json
{
"availability_zones": ["INTERNATIONAL"],
"benefits": [
{
"additional_information": null,
"amount": {
"base": 10,
"promotion_bonus": 0,
"total_excluding_tax": 10,
"total_including_tax": 10
},
"type": "CREDITS",
"unit": "USD",
"unit_type": "CURRENCY"
}
],
"description": "Amazon GiftCard USA 10 USD",
"destination": {
"amount": 10,
"unit": "USD",
"unit_type": "CURRENCY"
},
"id": 28524,
"name": "Amazon GiftCard USA 10 USD",
"operator": {
"country": {
"iso_code": "USA",
"name": "United States",
"regions": [
{
"code": "USA",
"name": "United States"
}
]
},
"id": 3285,
"name": "Amazon USA",
"regions": null
},
"pin": {
"terms": "Restrictions apply, see amazon.com/gc-legal",
"usage_info": [
"To redeem your gift card visit http://www.amazon.com/redeem"
],
"validity": {
"quantity": -1,
"unit": "DAY"
}
},
"prices": {
"retail": {
"amount": 11.33,
"fee": 0,
"unit": "USD",
"unit_type": "CURRENCY"
},
"wholesale": {
"amount": 10.11,
"fee": 0,
"unit": "USD",
"unit_type": "CURRENCY"
}
},
"type": "FIXED_VALUE_PIN_PURCHASE",
"validity": {
"quantity": -1,
"unit": "DAY"
}
}
```
--------------------------------
### Full SDK Configuration Object with Customization (JavaScript)
Source: https://developers.dtone.com/docs/configure-solution-behavior
This comprehensive example demonstrates an advanced sdkConfiguration object. It covers authentication (token), session management, detailed template options, UI customization (whitelabel, currencies), and callback functions for various SDK events.
```javascript
const sdkConfiguration = {
clientUid: 'your-client-id',
// Your unique Client ID provided by DT One.
// This is required only if you are not using
// the `token` parameter for authentication.
sessionId: 'session-id',
// A unique identifier for the current user session.
// This is required only when you are using
// the 'TransactionConfirmation' template.
token: 'xxxxx',
// A secure token used for authentication
// in Advanced Initialization.
// This is required only if you are using
// Advanced Initialization.
template: 'DVS',
// Specifies the UI flow template to be used.
// Options include: 'DVS', 'TransactionConfirmation',
// 'GiftCards', 'MobileTopUp'.
containerId: 'sdk-container',
// The ID of the HTML element where the SDK UI
// will be injected. This element should exist
// in your webpage's DOM.
userCountry: 'FRA',
// The user's country code in ISO 3166 format
// (e.g., 'FRA' for France, 'USA' for United States).
language: 'en',
// Sets the default language for the UI.
// Options include: 'en', 'fr', 'de', 'es', 'pt', 'ru', 'zh'.
// If not provided, the SDK will attempt to
// auto-detect the user's language.
currencies: {
// Allows you to define custom currency settings.
// If not provided, your Account's base currency will be used.
baseCurrency: 'USD',
// The base currency of your account in
// ISO 4217 format.
defaultCurrency: 'EUR',
// The default currency to be displayed in
// the SDK, which must be one of the `quoteCurrencies`.
quoteCurrencies: ['USD', 'EUR', 'PLN']
// A list of currencies that users can choose
// from in the SDK.
},
whitelabel: {
// Enables you to customize the visual appearance
// of the SDK to match your brand.
colors: {
pageBackgroundColor: '#f3f3f3',
// Custom background color for the SDK page.
primaryButtonBackgroundColor: '#021914',
// Custom background color for primary buttons.
// ... other color customization options
}
},
termsAndConditionsUrl: '[https://your-terms-and-conditions-url.com](https://your-terms-and-conditions-url.com)',
// URL to your website's terms and conditions page.
callbackUrl: '[https://your-callback-url.com](https://your-callback-url.com)',
// URL to your server that will receive
// transaction status updates.
callbacks: {
onInit: () => { console.log('SDK initialized'); },
// A function that will be executed after
// the SDK is successfully initialized.
onSubmit: (transaction, sessionId) => {
console.log('Transaction created', transaction, sessionId); },
// A function that will be executed after a
// transaction is successfully created.
onError: (error) => { console.log('Error during transaction', error); }
// A function that will be executed if an error
// occurs during the transaction process.
}
};
```
--------------------------------
### Retrieve Active Campaigns (Python)
Source: https://developers.dtone.com/reference/campaigns
Example request to retrieve a list of active campaigns using Python. This typically uses the 'requests' library to send the GET request.
```python
# Python example would go here, likely using the 'requests' library.
```
--------------------------------
### Retrieve Active Campaigns (cURL)
Source: https://developers.dtone.com/reference/campaigns
Example request to retrieve a list of active campaigns using cURL. This demonstrates the HTTP GET method and the required 'accept' header.
```shell
curl --request GET \
--url https://preprod-dvs-api.dtone.com/v1/campaigns \
--header 'accept: application/json'
```
--------------------------------
### Initialize SDK with MobileTopUp Template
Source: https://developers.dtone.com/docs/configure-solution-behavior
Configures the SDK to use the 'MobileTopUp' template for mobile service transactions. This is an example of initializing the SDK with a specific UI flow template.
```javascript
const sdkConfiguration = {
template: 'MobileTopUp' // Available templates:
// 'DVS',
// 'TransactionConfirmation',
// 'GiftCards',
// 'MobileTopUp',
// 'ESIM'
};
```
--------------------------------
### Simple SDK Initialization
Source: https://developers.dtone.com/docs/initialization-flow
Demonstrates how to initialize the DT One SDK with minimum and additional parameters.
```APIDOC
## Simple Initialization
### Description
Initialize the DT One SDK with the essential parameters required for basic functionality.
### Parameters
* **clientUid** (string) - Required - Your unique client identifier.
* **template** (string) - Required - The template to use (e.g., 'DVS').
* **containerId** (string) - Required - The ID of the HTML element where the SDK will be mounted.
* **userCountry** (string) - Required - The user's country code (e.g., 'FRA').
* **termsAndConditionsUrl** (string) - Optional - URL for terms and conditions.
* **callbackUrl** (string) - Optional - URL for handling callbacks.
* **userId** (string) - Optional - Unique identifier for the user.
* **language** (string) - Optional - Language code for the SDK interface.
* **callbacks** (object) - Optional - An object containing callback functions (onInit, onSubmit, onError).
* **currencies** (object) - Optional - Configuration for currencies, including base, default, and quote currencies.
* **whitelabel** (object) - Optional - For customizing the look and feel of the SDK.
### Request Example (Minimum Required)
```javascript
const sdkConfiguration = {
clientUid: '0191db27-...',
template: 'DVS',
containerId: 'sdk-container',
userCountry: 'FRA',
};
```
### Request Example (Additional Parameters)
```javascript
const sdkConfiguration = {
clientUid: '0191db27-...',
template: 'DVS',
containerId: 'sdk-container',
termsAndConditionsUrl: '[https://yoursite.com/tc](https://yoursite.com/tc)',
callbackUrl: '[https://yoursite.com/callbackUrl](https://yoursite.com/callbackUrl)',
userId: 'customer-be-user-id',
userCountry: 'FRA',
language: 'en',
callbacks: {
onInit: () => { console.log('SDK was initialized'); },
onSubmit: (transaction, sessionId) => {
console.log('Transaction was created', transaction, sessionId);
console.log('Redirect to payment ...');
},
onError: (error) => { console.log('An error occurred while creating the transaction:', error); },
},
currencies: {
baseCurrency: 'SGD',
defaultCurrency: 'EUR',
quoteCurrencies: ['USD', 'EUR', 'PLN'],
},
whitelabel: {
colors: {
// ... color customizations
},
},
};
```
```
--------------------------------
### Query Transaction by DTone ID - API Request
Source: https://developers.dtone.com/docs/gift-card-ranged_value_recharge
This example shows how to retrieve a specific transaction by its DTone-generated ID. This GET request is used to fetch detailed information about a single transaction using the unique identifier assigned by DTone.
```http
GET /v1/transactions/2239243424
```
--------------------------------
### Retrieve Benefit Types using Ruby
Source: https://developers.dtone.com/reference/benefits
Ruby code example for retrieving benefit types from the DTone API. It uses the 'Net::HTTP' library to perform a GET request and prints the JSON response.
```ruby
require 'net/http'
require 'uri'
uri = URI.parse('https://preprod-dvs-api.dtone.com/v1/benefit-types')
request = Net::HTTP::Get.new(uri)
request['accept'] = 'application/json'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.parse(response.body)
```
--------------------------------
### Advanced SDK Initialization
Source: https://developers.dtone.com/docs/initialization-flow
Details on advanced SDK initialization, including a sequence diagram and an example using a token.
```APIDOC
## Advanced Initialization
### Description
This section outlines the advanced integration flow for the DT One SDK, which is required when you need to set sensitive information such as custom exchange rates. It includes a sequence diagram illustrating the process and an example of SDK configuration using a token.
### Sequence Diagram
```mermaid
sequenceDiagram
autonumber
actor a as Shopper
participant b as Browser
participant cs as Customer Server
participant dt1 as DT One
a->>b: Open customer's webpage
note over a, dt1: Advance integration flow required if the customer would like \n to set sensitive information like custom exchange rates.
b->>+cs: Get Session \n (Pre SDK Init)
activate b
cs->>+dt1: Create Session \n (Auth)
dt1->>-cs: Session Data
cs->>-b: Session Data
b->>b: Init SDK with Session Data
deactivate b
note over a, dt1: SDK initialized and the shopper continues with product selection\n and checkout.
```
### Parameters
* **token** (string) - Required - Authentication token for advanced initialization.
* **template** (string) - Required - The template to use (e.g., 'DVS').
* **containerId** (string) - Required - The ID of the HTML element where the SDK will be mounted.
* **userCountry** (string) - Required - The user's country code (e.g., 'FRA').
### Request Example
```javascript
const sdkConfiguration = {
token: 'eyJhbGciOiJIUzUxMiIsI...', // Replace with your actual token
template: 'DVS', // 'DVS' | 'GiftCards' | 'MobileTopUp'
containerId: 'sdk-container',
userCountry: 'FRA'
};
```
```
--------------------------------
### Query Transaction by External ID - API Request
Source: https://developers.dtone.com/docs/gift-card-ranged_value_recharge
This example demonstrates how to query a list of transactions using a customer-generated external ID. This GET request allows for retrieving transaction details based on a unique identifier provided by the client system.
```http
GET /v1/transactions?external_id=TEST-000006
```
--------------------------------
### Retrieve Benefit Types using Node.js
Source: https://developers.dtone.com/reference/benefits
Example code for fetching benefit types using Node.js. It utilizes the 'https' module to make a GET request to the specified API endpoint and logs the response data.
```javascript
const https = require('https');
const options = {
method: 'GET',
url: 'https://preprod-dvs-api.dtone.com/v1/benefit-types',
headers: {
'accept': 'application/json'
}
};
https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
console.log(JSON.parse(data));
});
}).on('error', (err) => {
console.error(err);
}).end();
```
--------------------------------
### Configure SDK URLs: Terms, Conditions, and Callbacks
Source: https://developers.dtone.com/docs/configure-solution-behavior
Set essential URLs for your SDK integration. This includes the URL for your terms and conditions page and a callback URL on your server to receive transaction status updates. These are optional but recommended for a complete integration.
```javascript
const sdkConfiguration = {
termsAndConditionsUrl: "https://your-terms-and-conditions-url.com",
callbackUrl: "https://your-callback-url.com"
};
```
--------------------------------
### Retrieve Active Campaigns (Node.js)
Source: https://developers.dtone.com/reference/campaigns
Example request to retrieve a list of active campaigns using Node.js. This typically involves using a library like 'axios' or the built-in 'https' module to make the GET request.
```javascript
// Node.js example would go here, likely using a fetch or axios implementation.
```
--------------------------------
### Initialize Dtone SDK - Simple Configuration (JavaScript)
Source: https://developers.dtone.com/docs/initialization-flow
Demonstrates the minimum and additional parameters required for simple initialization of the Dtone SDK. It requires client UID, template, container ID, and user country. Optional parameters include terms and conditions URL, callback URL, user ID, language, callbacks for SDK events, currency configurations, and whitelabel options.
```javascript
const sdkConfiguration = {
clientUid: '0191db27-...', // Replace with your actual client UID
template: 'DVS',
containerId: 'sdk-container', // Make sure this
exists in your HTML
userCountry: 'FRA'
};
```
```javascript
const sdkConfiguration = {
clientUid: '0191db27-...',
template: 'DVS',
containerId: 'sdk-container',
termsAndConditionsUrl: '[https://yoursite.com/tc](https://yoursite.com/tc)',
callbackUrl: '[https://yoursite.com/callbackUrl](https://yoursite.com/callbackUrl)',
userId: 'customer-be-user-id',
userCountry: 'FRA',
language: 'en',
callbacks: {
onInit: () => { console.log('SDK was initialized'); },
onSubmit: (transaction, sessionId) => {
console.log('Transaction was created', transaction, sessionId);
console.log('Redirect to payment ...');
},
onError: (error) => { console.log('An error occurred while creating the transaction:', error); }
},
currencies: {
baseCurrency: 'SGD',
defaultCurrency: 'EUR',
quoteCurrencies: ['USD', 'EUR', 'PLN']
},
whitelabel: {
colors: {
// ... color customizations
}
}
};
```
--------------------------------
### POST /lookup/credit-party-status
Source: https://developers.dtone.com/reference/postlookupcreditpartystatus
Retrieve status for a given credit party. This endpoint is used to get the installation and activation dates for a specified credit party. You can identify the credit party using a mobile number or an account number and qualifier.
```APIDOC
## POST /lookup/credit-party-status
### Description
Retrieve status for a given credit party. This endpoint is used to get the installation and activation dates for a specified credit party. You can identify the credit party using a mobile number or an account number and qualifier.
### Method
POST
### Endpoint
/lookup/credit-party-status
### Parameters
#### Request Body
- **service_id** (integer) - Required - Service identifier. See [Services](#tags/Services) for more details.
- **credit_party_identifier** (object) - Required - Identifier for the credit party.
- **mobile_number** (string) - Optional - Mobile number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
- **account_number** (string) - Optional - Account number.
- **account_qualifier** (string) - Optional - Account qualifier.
### Request Example
```json
{
"service_id": 12345,
"credit_party_identifier": {
"mobile_number": "+15551234567"
}
}
```
### Response
#### Success Response (200)
- **installation_date** (string) - A `null` value denotes either the concept of installation does not apply for the given credit party or that the credit party has not yet been installed.
- **activation_date** (string) - A `null` value denotes that credit party has not yet been activated on the actual network.
#### Response Example
```json
{
"installation_date": "2023-01-15T10:30:00Z",
"activation_date": "2023-01-15T11:00:00Z"
}
```
#### Error Response (default)
- **errors** (array) - An array of error objects.
- **code** (integer) - The error code.
- **message** (string) - A description of the error.
```
--------------------------------
### Basic SDK Configuration Object (JavaScript)
Source: https://developers.dtone.com/docs/configure-solution-behavior
This snippet shows a basic sdkConfiguration object. It includes essential parameters like clientUid, template, containerId, and userCountry. Ensure you replace placeholder values with your actual credentials and settings.
```javascript
const sdkConfiguration = {
clientUid: '0191db27-...', // Replace with your actual Client UID
template: 'DVS', // Choose the appropriate template
containerId: 'sdk-container', // Match the ID of your container element
userCountry: 'FRA', // Replace with the user's country code
};
```
--------------------------------
### eSIM PIN and Serial Information
Source: https://developers.dtone.com/docs/esim-fixed_value_pin_purchase
Provides the activation code (PIN) for eSIM installation and the serial number (ICCID) used for eSIM management features like top-up and balance retrieval. The PIN is also used to generate QR codes for quick eSIM setup.
```json
{
"pin": {
"code": "LPA:1$smdp.io$K2-27D7HN-IP0UJ1",
"serial": "5865151648338875078"
}
}
```
--------------------------------
### POST /v1/sessions/{sessionID}/finalize
Source: https://developers.dtone.com/docs/initialization-flow
Create sessions with custom exchange rates for advanced initialization scenarios.
```APIDOC
## Create Sessions with Custom Exchange Rates
### Description
This endpoint allows you to create sessions with custom exchange rates, which is an advanced feature applicable to the Advanced Initialization use case. It enables fine-grained control over currency conversions.
### Method
`POST`
### Endpoint
`/v1/sessions/{sessionID}/finalize`
### Parameters
#### Path Parameters
* **sessionID** (string) - Required - The ID of the session to finalize.
#### Request Body
* **exchange_rates** (array) - Required - A list of custom exchange rate configurations.
* **base_currency** (string) - Required - The base currency for the exchange rate.
* **quote_currency** (string) - Required - The quote currency for the exchange rate.
* **rate** (number) - Required - The custom exchange rate.
### Request Example
```json
{
"exchange_rates": [
{
"base_currency": "USD",
"quote_currency": "SGD",
"rate": 1.3
},
{
"base_currency": "USD",
"quote_currency": "AED",
"rate": 3.6
}
]
}
```
### Response
#### Success Response (200 OK)
* **expires_at** (string) - The expiration time of the session.
* **id** (string) - The unique ID of the created session.
* **token** (string) - The token associated with the session.
#### Response Example
```json
{
"expires_at": "2023-10-23T10:00:00Z",
"id": "uuid-session-id",
"token": "session-token"
}
```
#### Errors
* `400`: Bad Request
* `401`: Unauthorized
* `403`: Forbidden
* `404`: Not Found
* `500`: Server Error
#### Schema - SessionCreateRequest
```json
{
"exchange_rates": [
{
"base_currency": "USD",
"quote_currency": "SGD",
"rate": 1.3
}
]
}
```
```
--------------------------------
### Initialize SDK with TransactionConfirmation Template and Session ID
Source: https://developers.dtone.com/docs/configure-solution-behavior
Initializes the SDK with the 'TransactionConfirmation' template and includes a 'sessionId' to display transaction status. The sessionId is crucial for retrieving specific transaction details.
```javascript
const sdkConfiguration = {
clientId: 'xxx-xxx-xxx-xxx',
template: 'TransactionConfirmation',
sessionId: '5f702ac5-8fa7-...'
};
```
--------------------------------
### Retrieve List of Services (cURL)
Source: https://developers.dtone.com/reference/services
This snippet demonstrates how to retrieve a list of services using a cURL request. It specifies the GET method and the API endpoint, along with the 'accept' header for JSON responses. This is a basic example and does not include any query parameters for filtering or pagination.
```shell
curl --request GET \
--url https://preprod-dvs-api.dtone.com/v1/services \
--header 'accept: application/json'
```
--------------------------------
### Product Retrieval API
Source: https://developers.dtone.com/docs/new-mobile-template
Endpoints for retrieving product information. Use GET /products/{id} to get a specific product or GET /products to list available products.
```APIDOC
## GET /products/{id}
### Description
Retrieves a specific product by its unique identifier.
### Method
GET
### Endpoint
`/products/{id}`
### Parameters
#### Path Parameters
- **id** (integer) - Required - The unique identifier of the product.
### Response
#### Success Response (200)
- **id** (integer) - The product's unique identifier.
- **name** (string) - The name of the product.
- **description** (string) - A description of the product.
- **operator** (object) - Information about the operator.
- **service** (object) - Information about the service.
- **destination** (object) - Details about the destination recharge parameters.
- **benefits** (array) - A list of benefits associated with the product.
- **prices** (object) - Pricing information for the product.
- **rates** (object) - Exchange rates for the product.
#### Response Example
```json
{
"accepted_calculation_modes": [
"SOURCE_AMOUNT",
"DESTINATION_AMOUNT"
],
"availability_zones": [
"INTERNATIONAL"
],
"benefits": [
{
"additional_information": null,
"amount": {
"base": {
"max": 1000,
"min": 0.5
},
"promotion_bonus": {
"max": 0,
"min": 0
},
"total_excluding_tax": {
"max": 1000,
"min": 0.5
},
"total_including_tax": {
"max": 1000,
"min": 0.5
}
},
"type": "CREDITS",
"unit": "GHS",
"unit_type": "CURRENCY"
}
],
"description": "",
"destination": {
"amount": {
"increment": 0.01,
"max": 1000,
"min": 0.5
},
"unit": "GHS",
"unit_type": "CURRENCY"
},
"id": 11874,
"name": "Open_Range",
"operator": {
"country": {
"iso_code": "GHA",
"name": "Ghana",
"regions": null
},
"id": 1613,
"name": "Vodafone Ghana",
"regions": null
},
"prices": {
"retail": null,
"wholesale": {
"amount": {
"max": 65.1759317171309,
"min": 0.0325879658585655
},
"fee": 0,
"unit": "USD",
"unit_type": "CURRENCY"
}
},
"promotions": null,
"rates": {
"base": 15.036225400709,
"retail": null,
"wholesale": 15.3430871435806
},
"regions": null,
"required_additional_identifier_fields": null,
"required_beneficiary_fields": null,
"required_credit_party_identifier_fields": [
[
"mobile_number"
]
],
"required_debit_party_identifier_fields": null,
"required_sender_fields": null,
"required_statement_identifier_fields": null,
"service": {
"id": 1,
"name": "Mobile",
"subservice": {
"id": 11,
"name": "Airtime"
}
},
"source": {
"amount": {
"increment": 0.01,
"max": 1000,
"min": 0.5
},
"unit": "GHS",
"unit_type": "CURRENCY"
}
}
```
## GET /products
### Description
Retrieves a list of available products.
### Method
GET
### Endpoint
`/products`
### Parameters
#### Query Parameters
- **service_id** (integer) - Optional - Filter products by service ID.
- **subservice_id** (integer) - Optional - Filter products by subservice ID.
### Response
#### Success Response (200)
- An array of product objects, each with the same structure as the response for `GET /products/{id}`.
#### Response Example
```json
[
{
"accepted_calculation_modes": [
"SOURCE_AMOUNT",
"DESTINATION_AMOUNT"
],
"availability_zones": [
"INTERNATIONAL"
],
"benefits": [
{
"additional_information": null,
"amount": {
"base": {
"max": 1000,
"min": 0.5
},
"promotion_bonus": {
"max": 0,
"min": 0
},
"total_excluding_tax": {
"max": 1000,
"min": 0.5
},
"total_including_tax": {
"max": 1000,
"min": 0.5
}
},
"type": "CREDITS",
"unit": "GHS",
"unit_type": "CURRENCY"
}
],
"description": "",
"destination": {
"amount": {
"increment": 0.01,
"max": 1000,
"min": 0.5
},
"unit": "GHS",
"unit_type": "CURRENCY"
},
"id": 11874,
"name": "Open_Range",
"operator": {
"country": {
"iso_code": "GHA",
"name": "Ghana",
"regions": null
},
"id": 1613,
"name": "Vodafone Ghana",
"regions": null
},
"prices": {
"retail": null,
"wholesale": {
"amount": {
"max": 65.1759317171309,
"min": 0.0325879658585655
},
"fee": 0,
"unit": "USD",
"unit_type": "CURRENCY"
}
},
"promotions": null,
"rates": {
"base": 15.036225400709,
"retail": null,
"wholesale": 15.3430871435806
},
"regions": null,
"required_additional_identifier_fields": null,
"required_beneficiary_fields": null,
"required_credit_party_identifier_fields": [
[
"mobile_number"
]
],
"required_debit_party_identifier_fields": null,
"required_sender_fields": null,
"required_statement_identifier_fields": null,
"service": {
"id": 1,
"name": "Mobile",
"subservice": {
"id": 11,
"name": "Airtime"
}
},
"source": {
"amount": {
"increment": 0.01,
"max": 1000,
"min": 0.5
},
"unit": "GHS",
"unit_type": "CURRENCY"
}
}
]
```
```
--------------------------------
### Minimum Payload Request Example
Source: https://developers.dtone.com/docs/new-mobile-template
An example of the minimum required payload for a transaction request.
```APIDOC
## Minimum Payload Request
### Description
This endpoint requires a minimum payload for processing a transaction request. Ensure all required fields are accurately provided.
### Method
POST
### Endpoint
/some/endpoint/for/transactions
### Request Body
- **external_id** (string) - Required - Unique ID per request generated from customer side.
- **product_id** (integer) - Required - The ID of the product for the transaction.
- **credit_party_identifier** (object) - Required - Identifies the recipient of the transaction.
- **mobile_number** (string) - Required - The mobile number of the recipient.
- **auto_confirm** (boolean) - Required - Specifies if the transaction should be automatically confirmed.
- **calculation_mode** (string) - Required - Mode for calculation (e.g., 'DESTINATION_AMOUNT').
- **destination** (object) - Required - Details of the transaction destination.
- **unit_type** (string) - Required - Type of unit (e.g., 'CURRENCY').
- **unit** (string) - Required - Currency unit (e.g., 'GHS').
- **amount** (number) - Required - The amount for the transaction.
- **callback_url** (string) - Required - URL to receive asynchronous callback notifications.
### Request Example
```json
{
"external_id": "TEST-0001",
"product_id": 11874,
"credit_party_identifier": {
"mobile_number": "+233173143100"
},
"auto_confirm": true,
"calculation_mode":"DESTINATION_AMOUNT",
"destination": {
"unit_type":"CURRENCY",
"unit":"GHS",
"amount":3
},
"callback_url": "https://testcallbackurl.com/"
}
```
```
--------------------------------
### Generate eSIM QR Code Provisioning Link
Source: https://developers.dtone.com/docs/esim-fixed_value_pin_purchase
Demonstrates how to construct a universal link to provision an eSIM QR code using the activation code. This link can be used for quick installation on compatible devices.
```html
https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA:1$smdp.io$K2-27D7HN-IP0UJ1
```
--------------------------------
### Initialize Dtone SDK - Advanced Configuration (JavaScript)
Source: https://developers.dtone.com/docs/initialization-flow
Shows an example of advanced initialization for the Dtone SDK, typically used when custom exchange rates or sensitive information need to be set. It requires a token, template, container ID, and user country.
```javascript
const sdkConfiguration = {
token: 'eyJhbGciOiJIUzUxMiIsI...',
template: 'DVS', // 'DVS' | 'GiftCards' | 'MobileTopUp'
containerId: 'sdk-container',
userCountry: 'FRA'
};
```
--------------------------------
### Get Product Details
Source: https://developers.dtone.com/docs/transaction-processing-steps-copy-copy-3
Retrieve detailed information for a product by its ID.
```APIDOC
## GET /v1/products
### Description
Retrieves detailed information about available products. This endpoint is used to select a product ID for further operations.
### Method
GET
### Endpoint
/v1/products
### Parameters
#### Query Parameters
- **id** (string) - Required - The unique identifier of the product to retrieve details for.
### Request Example
(No request body for GET requests)
### Response
#### Success Response (200)
- **type** (string) - The type of the product recharge.
- **validity** (object) - The validity period of the product.
- **quantity** (integer) - The quantity of the validity period.
- **unit** (string) - The unit of the validity period (e.g., "DAY").
- **required_credit_party_identifier_fields** (array) - A list of fields required for the recipient's identifier.
- **availability_zones** (array) - The availability zones for the product.
- **source** (object) - Details about the source currency.
- **amount** (number) - The amount in the source currency.
- **unit** (string) - The unit of the source currency (e.g., "SGD").
- **unit_type** (string) - The type of the source unit (e.g., "CURRENCY").
- **destination** (object) - Details about the destination currency.
- **amount** (number) - The amount in the destination currency.
- **unit** (string) - The unit of the destination currency (e.g., "PHP").
- **unit_type** (string) - The type of the destination unit (e.g., "CURRENCY").
- **prices** (object) - Pricing information for the product.
- **wholesale** (object) - Wholesale pricing details.
- **amount** (number) - The wholesale amount.
- **fee** (number) - The wholesale fee.
- **unit** (string) - The unit of the wholesale price.
- **unit_type** (string) - The type of the wholesale unit.
- **retail** (object) - Retail pricing details.
- **amount** (number) - The retail amount.
- **fee** (number) - The retail fee.
- **unit** (string) - The unit of the retail price.
- **unit_type** (string) - The type of the retail unit.
- **rates** (object) - Exchange rates for the product.
- **base** (number) - The base exchange rate.
- **retail** (number) - The retail exchange rate.
- **wholesale** (number) - The wholesale exchange rate.
- **benefits** (array) - A list of benefits included with the product.
- **additional_information** (string) - Additional details about the benefit.
- **amount** (object) - The amount of the benefit.
- **base** (number) - The base amount of the benefit.
- **promotion_bonus** (number) - Any promotional bonus amount.
- **total_excluding_tax** (number) - The total amount excluding tax.
- **type** (string) - The type of benefit (e.g., "DATA").
- **unit** (string) - The unit of the benefit (e.g., "MB").
- **unit_type** (string) - The type of the benefit unit (e.g., "DATA").
#### Response Example
```json
{
"type": "FIXED_VALUE_RECHARGE",
"validity": {
"quantity": 2,
"unit": "DAY"
},
"required_credit_party_identifier_fields": [
[
"mobile_number"
]
],
"availability_zones": [
"INTERNATIONAL"
],
"source": {
"amount": 0.48,
"unit": "SGD",
"unit_type": "CURRENCY"
},
"destination": {
"amount": 15,
"unit": "PHP",
"unit_type": "CURRENCY"
},
"prices": {
"wholesale": {
"amount": 0.48,
"fee": 0,
"unit": "SGD",
"unit_type": "CURRENCY"
},
"retail": {
"amount": 0.6,
"fee": 0,
"unit": "SGD",
"unit_type": "CURRENCY"
}
},
"rates": {
"base": 31.25,
"retail": 25,
"wholesale": 31.25
},
"benefits": [
{
"additional_information": "100MB consumable mobile internet + 50MB freebie",
"amount": {
"base": 100,
"promotion_bonus": 0,
"total_excluding_tax": 100
},
"type": "DATA",
"unit": "MB",
"unit_type": "DATA"
}
]
}
```
```
--------------------------------
### Callback Handling and Content
Source: https://developers.dtone.com/reference/transactions-1
This section details how to programmatically handle callback updates and the expected content for different product types.
```APIDOC
## Callback Handling and Content
### Description
Callbacks provide real-time updates on transaction status. The platform interprets these callbacks, but for programmatic handling, you must listen for updates and process the response accordingly. For PIN-based products, callbacks include PIN codes and redemption instructions.
### Method
N/A (Callback Mechanism)
### Endpoint
N/A (Configured Callback URL)
### Parameters
#### Callback Content:
- **Recharge Products**:
- `Transaction` status
- Relevant error code (if `DECLINED 9`)
- **PIN-Based Products**:
- PIN Code and Serial Number
- Redemption instructions (if applicable)
### Request Example
```json
{
"transaction_status": "COMPLETED",
"product_type": "RECHARGE",
"transaction_id": "txn_12345",
"external_id": "my_ref_67890"
}
```
### Response
#### Success Response (200)
Callbacks are typically processed by your system. The platform may also present a human-readable result.
#### Response Example
N/A (Callback content is structured data sent to your URL)
```
--------------------------------
### Example Benefits: Credits
Source: https://developers.dtone.com/docs/gift-card-ranged_value_recharge
Example JSON structure for 'benefits' when credits are offered, including amounts, types, and units.
```json
{
"benefits": [
{
"additional_information": null,
"amount": {
"base": {
"max": 150,
"min": 10
},
"promotion_bonus": {
"max": 0,
"min": 0
},
"total_excluding_tax": {
"max": 150,
"min": 10
},
"total_including_tax": {
"max": 150,
"min": 10
}
},
"type": "CREDITS",
"unit": "EUR",
"unit_type": "CURRENCY"
}
]
}
```
--------------------------------
### Get Product Details Response (JSON)
Source: https://developers.dtone.com/docs/transaction-processing-steps-copy-copy-3
This JSON snippet represents the response received when calling the `GET /v1/products` endpoint. It includes details about the product's type, validity, pricing, and benefits. These details are essential for understanding product offerings and their costs.
```json
{
"type": "FIXED_VALUE_RECHARGE",
"validity": {
"quantity": 2,
"unit": "DAY"
},
"required_credit_party_identifier_fields": [
[
"mobile_number"
]
],
"availability_zones": [
"INTERNATIONAL"
],
"source": {
"amount": 0.48,
"unit": "SGD",
"unit_type": "CURRENCY"
},
"destination": {
"amount": 15,
"unit": "PHP",
"unit_type": "CURRENCY"
},
"prices": {
"wholesale": {
"amount": 0.48,
"fee": 0,
"unit": "SGD",
"unit_type": "CURRENCY"
},
"retail": {
"amount": 0.6,
"fee": 0,
"unit": "SGD",
"unit_type": "CURRENCY"
}
},
"rates": {
"base": 31.25,
"retail": 25,
"wholesale": 31.25
},
"benefits": [
{
"additional_information": "100MB consumable mobile internet + 50MB freebie",
"amount": {
"base": 100,
"promotion_bonus": 0,
"total_excluding_tax": 100
},
"type": "DATA",
"unit": "MB",
"unit_type": "DATA"
}
]
}
```