Ozibus Developer PlatformDeveloper Platform Developer guide
API base https://api.ozibus.com.au/v1 Billing Prepaid PAYG via Ozibus Account Balance API & Developer Terms
Developer guide

Translation API

Translate text and retrieve supported translation languages through Ozibus from an external merchant integration.

Ozibus Developer Platform

Use the dedicated Ozibus Translation API to translate text from your own server and retrieve supported translation languages. Translation uses the active Ozibus business workspace, its enabled language.translate feature, and the merchant wallet. The request key prevents a duplicate charge when the same translation request is replayed.

Available Endpoints

Method Endpoint Description
GET /v1/tx-languages Retrieve available translation languages and regional variants.
POST /v1/translate Translate text between supported languages.

Authentication

Both endpoints use the same server-side merchant authentication credentials as other Ozibus v1 APIs. Keep your secret API key and session token off client devices.

Header Required Description
Merchant-Id Yes Your Ozibus merchant identifier.
X-API-Key Yes Your secret merchant API key.
Authorization Yes Bearer session token associated with the authenticated merchant.
Accept Recommended Set to application/json.
Content-Type POST requests Set to application/json when submitting translation data.

1. Translation Languages API

Retrieve the list of available languages and regional language variants for use with the Ozibus Translation API.

This endpoint is useful for populating language selection dropdowns, validating language codes, and supporting multilingual applications.

Endpoint

GET https://api.ozibus.com.au/v1/tx-languages

Method: GET

Authentication: Merchant API credentials

Request body: Not required

Example Request — cURL

curl --request GET \
  'https://api.ozibus.com.au/v1/tx-languages' \
  --header 'Accept: application/json' \
  --header 'Merchant-Id: YOUR_MERCHANT_ID' \
  --header 'X-API-Key: YOUR_SECRET_API_KEY' \
  --header 'Authorization: Bearer YOUR_SESSION_TOKEN'

Request Parameters

No request body or query parameters are required. The endpoint returns the configured translation language list.

Successful Response

The following example shows a subset of the available languages. The actual response contains the complete configured language list.

{
  "response_code": 0,
  "response_message": "Translation languages retrieved successfully.",
  "data": [
    {
      "code": "af",
      "name": "Afrikaans"
    },
    {
      "code": "af-ZA",
      "name": "Afrikaans (South Africa)"
    },
    {
      "code": "ar",
      "name": "Arabic"
    },
    {
      "code": "ar-AE",
      "name": "Arabic (United Arab Emirates)"
    },
    {
      "code": "en",
      "name": "English"
    },
    {
      "code": "en-AU",
      "name": "English (Australia)"
    },
    {
      "code": "en-GB",
      "name": "English (United Kingdom)"
    },
    {
      "code": "en-US",
      "name": "English (United States)"
    },
    {
      "code": "fr",
      "name": "French"
    },
    {
      "code": "fr-CA",
      "name": "French (Canada)"
    },
    {
      "code": "ha",
      "name": "Hausa"
    },
    {
      "code": "ig",
      "name": "Igbo"
    },
    {
      "code": "yo",
      "name": "Yoruba"
    },
    {
      "code": "zh-Hans",
      "name": "Chinese (Simplified)"
    },
    {
      "code": "zh-Hant",
      "name": "Chinese (Traditional)"
    }
  ]
}

Response Fields

Field Type Description
response_code Integer Application response code. A value of 0 indicates success.
response_message String Human-readable description of the response.
data Array Collection of available translation languages.
data[].code String Language or regional language code used in translation requests.
data[].name String Human-readable language name.

Language Code Formats

Ozibus returns language identifiers based on widely used language and locale conventions, including base language codes, regional variants, and script variants.

Format Example Description
Base language en English
Language and region en-AU English (Australia)
Language and region fr-CA French (Canada)
Language and region ha-NG Hausa (Nigeria)
Language and script zh-Hans Chinese (Simplified)
Language and script zh-Hant Chinese (Traditional)

Preserve the exact language codes returned by the API when constructing translation requests. Do not assume that every regional or script variant is interchangeable with its base language code.

Example — PHP cURL

<?php

$url = 'https://api.ozibus.com.au/v1/tx-languages';

$ch = curl_init($url);

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPGET => true,
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'Merchant-Id: YOUR_MERCHANT_ID',
        'X-API-Key: YOUR_SECRET_API_KEY',
        'Authorization: Bearer YOUR_SESSION_TOKEN'
    ]
]);

$response = curl_exec($ch);

$httpCode = curl_getinfo(
    $ch,
    CURLINFO_HTTP_CODE
);

if ($response === false) {
    $error = curl_error($ch);
    curl_close($ch);

    throw new RuntimeException($error);
}

curl_close($ch);

$result = json_decode($response, true);

if (json_last_error() !== JSON_ERROR_NONE) {
    throw new RuntimeException(
        'Invalid JSON response.'
    );
}

if (
    $httpCode >= 200 &&
    $httpCode 

Example — Dynamic Language Dropdown

Use the returned language collection to populate a dropdown instead of maintaining a hardcoded list.

<?php

// $languages contains the decoded API response.

$languages = $result['data'] ?? [];

echo '<select name="target_language" class="form-select">';

foreach ($languages as $language) {
    if (
        !isset($language['code']) ||
        !isset($language['name'])
    ) {
        continue;
    }

    $code = htmlspecialchars(
        $language['code'],
        ENT_QUOTES,
        'UTF-8'
    );

    $name = htmlspecialchars(
        $language['name'],
        ENT_QUOTES,
        'UTF-8'
    );

    $selected = $language['code'] === 'en-AU'
        ? ' selected'
        : '';

    echo '<option value="' . $code . '"' . $selected . '>'
        . $name
        . '</option>';
}

echo '</select>';

Integration Recommendations

  • Dynamic selection: Retrieve language codes from the endpoint when building source and target language dropdowns.
  • Validation: Validate selected languages against the returned language list before submitting translation requests.
  • Caching: Cache the language collection where appropriate to minimise repeated API requests.
  • Security: Retrieve language information through your server when merchant credentials are required. Never expose secret credentials in frontend applications.
  • Regional localisation: Use regional codes such as en-AU when the desired output should follow regional spelling and language conventions.

Note: Retrieving the language list does not itself submit text for translation. Translation processing, wallet reservations, and applicable usage fees are handled by the Translation API endpoint.

2. Translate Text API

Translate text between supported languages using the active Ozibus business workspace.

Translation requests require the language.translate feature to be enabled. Translation charges are applied to the merchant wallet based on the configured feature rate.

Endpoint

POST https://api.ozibus.com.au/v1/translate

Authenticate using the same server-side merchant credentials used by other Ozibus v1 endpoints. Keep the secret API key and session token off client devices.

Example Request — cURL

curl --request POST \
  'https://api.ozibus.com.au/v1/translate' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Merchant-Id: YOUR_MERCHANT_ID' \
  --header 'X-API-Key: YOUR_SECRET_API_KEY' \
  --header 'Authorization: Bearer YOUR_SESSION_TOKEN' \
  --data '{
    "business_id": "YOUR_BUSINESS_ID",
    "request_key": "translation-order-0001",
    "text": "Hello, how are you?",
    "source_language": "en",
    "target_language": "fr"
  }'

Request Fields

Field Required Purpose
business_id No Active business workspace owned by the authenticated merchant. If omitted, the active default business is used.
request_key Yes Unique idempotency key, 16–80 letters, digits, underscores, or hyphens. Reuse the same key only with exactly the same content and language pair.
text Yes 1–10,000 UTF-8 characters to translate.
source_language No Source language code such as en, or auto for automatic language detection. Defaults to auto.
target_language Yes Target language code such as fr or en-AU. Retrieve available codes using GET /v1/tx-languages.

Example — Automatic Source Language Detection

Set source_language to auto or omit it when the source language is unknown.

{
  "business_id": "YOUR_BUSINESS_ID",
  "request_key": "translation-order-0002",
  "text": "Good morning, welcome to Ozibus.",
  "source_language": "auto",
  "target_language": "es"
}

Example — Australian English Localisation

Use a regional target code to request localisation into a specific variety of a language.

{
  "business_id": "YOUR_BUSINESS_ID",
  "request_key": "translation-order-0003",
  "text": "Please update the color of the item.",
  "source_language": "en",
  "target_language": "en-AU"
}

In this example, en-AU requests Australian English conventions, where words such as "color" are generally written as "colour".

Successful Response

{
  "response_code": 0,
  "response_message": "Translation completed.",
  "data": {
    "translation": {
      "status": "completed",
      "request_key": "translation-order-0001",
      "original_text": "Hello, how are you?",
      "translated_text": "Bonjour, comment allez-vous ?",
      "amount_minor": 1,
      "currency": "AUD",
      "target_language": "fr"
    }
  }
}

Response Fields

Field Type Description
response_code Integer Application response code. A value of 0 indicates success.
response_message String Human-readable result description.
data.translation.status String Translation processing status.
data.translation.request_key String Unique request key used for idempotency.
data.translation.original_text String Original submitted text.
data.translation.translated_text String Translated text returned by the provider.
data.translation.amount_minor Integer Wallet reservation amount in Australian cents.
data.translation.currency String Billing currency, such as AUD.
data.translation.target_language String Requested target language code.

3. Response and Billing

amount_minor is the wallet reservation in Australian cents. The configured feature rate is applied to the source character count.

If the provider fails, Ozibus marks the request failed and refunds that reservation.

Retain the request key on an uncertain response. A completed replay returns the stored result without a second charge.

A failed replay returns translation_request_failed and does not call the provider again. After confirming the original wallet transaction was refunded, submit a new request with a new key.

Enable Translation and review its rate in Features & usage fees in the Ozibus merchant app.

Translation text is sent to the configured translation provider. Do not submit content you cannot share with that provider.

4. Error Handling

If a fresh request fails after its wallet reservation, the response includes a safe translation_provider_* code for connection, authentication, quota, rate limiting, rejected request configuration, upstream availability, or invalid response.

Ozibus refunds the reservation before returning that code.

A replay of a failed key remains terminal and cannot reproduce the original provider error. Check the original response or the server log for its cause.

Common Error Conditions

Condition Description Recommended Action
Authentication failure Missing, invalid, or expired merchant credentials. Verify the merchant ID, API key, and session token.
Invalid language code Requested source or target language is not accepted. Retrieve available codes using GET /v1/tx-languages.
Invalid request key Request key does not satisfy the required format. Use a unique 16–80 character key containing permitted characters.
Insufficient Account Balance Merchant wallet cannot cover the translation reservation. Fund the merchant wallet before submitting a new request.
translation_request_failed A previously failed translation request was replayed. Confirm the original refund and submit a new request key.
translation_provider_* Translation provider encountered a processing or integration failure. Review the original response or server logs and retry with a new request key only when appropriate.
  1. Authenticate using your Ozibus merchant API credentials.
  2. Retrieve supported languages using GET /v1/tx-languages.
  3. Cache and display the returned languages in your application.
  4. Allow users to select source and target languages.
  5. Validate the selected language codes against the available language list.
  6. Generate a unique translation request key.
  7. Submit the translation using POST /v1/translate.
  8. Handle the translation result and applicable wallet reservation.
  9. Preserve request keys to prevent duplicate billing during retries.

6. Security and Best Practices

  • Always communicate with Ozibus API endpoints over HTTPS.
  • Store merchant API credentials in secure server-side configuration.
  • Do not embed secret merchant API keys in publicly accessible JavaScript.
  • Use the Translation Languages API to maintain accurate language selection options.
  • Validate translation request fields before submission.
  • Use a new request key for each distinct translation request.
  • Do not reuse an existing request key with different content or language pairs.
  • Handle uncertain responses carefully to prevent duplicate charges.
  • Review merchant Account Balances and translation rates before processing large translation workloads.
  • Avoid submitting confidential text unless the configured provider is authorised to process it.
Was this page useful?Your response helps us improve the developer journey.
Report a docs issue