Create Mail Order
https://bll.titan.email/partner/createMailOrderAPI to provision a Mail Order on Titan.
Notes :
- A welcome email with Titan Control Panel login and set‑password details is sent to customerEmailAddress. To skip it on a specific order, pass sendWelcomeEmail: false. To disable it permanently for your account, contact Titan support.
Body
application/jsonCustomer mail order being provisioned The order provisioned in Titanmail is against the domainName provided by the partner within the API
The order ID stored on your end for this mail order, if any. If needed, You can use this data to correlate orders at your end and in Titan.The data is returned in listMailOrders call.
The customer ID stored on your end for each customer This is used to identify all the orders linked to a particular customer
Name of the customer as stored in the partner's system. It is recommended to send the full name as Titan utilizes this for any communication sent across to the customer.
The email address with which the customer registers on the partner website This email is used in order for Titan to send out the password setup email or any signup/usage nudges to get the customer to utilize the email This email will be used by the customer to login into Control Panel. This user will also be the primary admin for the domain
This email will be used to send emails, in case email delivery fails for customerEmailAddress
Password for signing into Domain Control Panel
Should be the 2 letter ISO Code, country from which the customer is accessing partner website/making the purchase. Titan will use this to identify the localized pricing based on the location of the customer in cases where Titan mail is managing the billing.
This is the Titan mail plan to be provisioned for the provided mail order. This would vary based on the plans being positioned with the partner. It is highly recommended to provide payment details in case this is a paid plan
Required for Paid Plans The number of accounts or mailboxes to be provisioned against the domain. This is used as a limiting parameter for the user to create accounts within the Control Panel. E.g. if this is set to 2, the user will not be allowed to create more than 2 mailboxes
Titan Reseller ID for reseller-level branding. If provided, the order will use the branding associated with this reseller. If null, falls back to partner's default branding.
In yyyy-MM-dd format.
Required for Paid and Trial Plans.
If the billing is managed by partner then partner should mark mail order suspended on expiry date. Titan does not suspend, expire, or delete the mail order on your behalf in this mode, except as a safety-net measure: Titan may suspend a mail order whose expiryDate has remained stale for an extended period with no partner action.
If the billing is managed by Titan, then Titan will mark mail order suspended on non-renewal on expiry day. And after 7 days of expiry, mail order will be marked deleted. The permanent deletion of mail order data happens after 30 days of deletion.
Partner should provide transactionId when the order is provisioned on paid plan or associated order is paid
Required for Paid Plans Total amount charged by the partner to the end customer in the customer's currency for this purchase including taxAmount. It is the actual cost that the user has paid while purchasing the order after any discount (which also includes tax if any). Precision upto 2 decimal places. Used primarily for reference and reporting on Titan's end. This is applicable only in the case of a paid plan. For free/trial plans, this should be passed as "0"
Should be 3 letter ISO code This is the currency in which the customer is being charged for Titan mail. Default USD (can be changed as for partner) . Used primarily for reference and reporting on Titan's end.
Total amount charged by the partner to the end customer in USD for this purchase including taxAmount. It is the actual cost that the user has paid in USD while purchasing the order after any discount (which also includes tax if any). Partner should provide this value, if the order is provisioned on paid plan. Open exchange rates will be used if the partner does not provide this value.
Any ad hoc discount given to the customer for this purchase. This should be passed in the original currency in which amount was charged to the customers. This field is just for book-keeping. Titan will use this as a placeholder to check if there are any discounts given to the customer.
Amount collected from the user as TAX amount in the customer's currency for this purchase. Titan will deduct this amount from the chargedAmount to get revenue sharing amount. Precision upto 2 decimal places.
This defines the period for which the customer has been billed for Titan mail by the partner. This is for Titan to track the billing cycle/details for that customer. Existing options are
Specifies the language to be set within the Email Control Panel. List of support Titan languages - link Default is set to en-us
The source from which the order is received - Refers to the kind of package provisioned on the partners end. Source field should be either of these values - domain, standalone, hosting, migrated. It will be validated against these values when the Api call is made
The purchase hook from where Titan plan has been purchased by the customer
Purpose - This is used by Titan for reference and analyse the efficacy of various purchase hooks within the partner ecosystem from where customers are purchasing Titan paid plans. Some examples for sourceContext can be "website", "hpanel_store", "cPanel_hosting_email_section", "cPanel_email_tab", "email_marketing", etc.
Details of associated partner order
Show propertiesHide properties
Expiry date of the associated package/service sold by the partner. Stored as metadata on Titan's end. Used primarily for reference. Only applicable for bundled purchases
The type of the plan of the associated order sold on the partners end. E.g. Shared Hosting plans as Small, Medium, Large etc. Stored as metadata on Titan's end. Used primarily for reference. Only applicable for bundled purchases
cPanel hostname where the user's hosting order has been provisioned/ Applicable only for hosting bundled Titan plans. Used at Titan's end to create mapping against appropriate cPanel server to provide user additional functionality inside cPanel. Only applicable for hosting bundled purchases. Enter the hostname, even if the hosting server is non-cPanel
cPanel username associated with this user's account. Applicable only for hosting bundled Titan plans. Used at Titan's end to create mapping against appropriate cPanel user account to provide user additional functionality inside cPanel. Only applicable for hosting bundled purchases. Enter the UserName, even if the hosting server is non-cPanel
partner brand using which order creation happened
payment method used during purchase, i.e : credit_card, paypal, etc
true/false, auto-renew value
The first email account that partner wants to create with mail order. email & password both are required for first email account creation. This email will be marked admin by default. Purpose - To allow partners provision first emailAccount along with order in 1 API call
Show propertiesHide properties
emailAddress of the email account to be created
password of the email account to be created, password should be at least 6 characters long
Set true if emailAccount holder is admin. Default value of this field is true.
Name of the email account holder
The first name of the customer for whom the email address is being created.
The last name of the customer for whom the email address is being created.
alternate email for this mail account, reset password tokens are sent to alternate email
Additional metadata for capturing information of account
Show propertiesHide properties
Specifies whether the account is free or not
Specifies whether or not to send email to customer for this newly created order. Default value of this flag is true
Responses
200OKapplication/json
- pending: when another domain already exists in active state, for current domain Titan provisions in this 'pending' state. Pending domain is activated when current active domain is deleted from Titan infra.
Show propertiesHide properties
This token can be used to auto login into titan webmail , token validity is 1 hour. Check here to see How to use this token
unique account id at Titan's end.
400BAD_REQUEST
- domain for email of firstEmailAccount does not match.
- Domain already exists with different details. happens multiple api calls, but with different data values.
- On multiple requests, if the data is same then, Titan returns success response with domain status and firstAccount details.
- If the firstEmail details is present in second api call and email is not created, then Titan creates the firstEmail with provided details and return webmail token.
/partner/createMailOrder#include <curl/curl.h>
int main(void) {
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
curl_global_cleanup();
return 1;
}
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://bll.titan.email/partner/createMailOrder");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: API.Key");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
"{\n"
" \"domainName\": \"xyz.com\",\n"
" \"orderId\": \"12431\",\n"
" \"customerId\": \"abcd123\",\n"
" \"customerName\": \"Adam Smith\",\n"
" \"customerEmailAddress\": \"adam@gmail.com\",\n"
" \"alternateEmailAddress\": \"abc@xyz.com\",\n"
" \"password\": \"asdfqwe\",\n"
" \"customerCountry\": \"US\",\n"
" \"planType\": \"pro\",\n"
" \"noOfAccounts\": 10,\n"
" \"titanResellerId\": 456,\n"
" \"expiryDate\": \"2020-02-20\",\n"
" \"paymentTxnId\": \"qweradsf\",\n"
" \"chargedAmount\": 1.1,\n"
" \"currency\": \"USD\",\n"
" \"chargedUSDAmount\": 1.1,\n"
" \"discountAmount\": 0.1,\n"
" \"taxAmount\": 0.1,\n"
" \"billingCycle\": \"monthly\",\n"
" \"locale\": \"en-gb\",\n"
" \"source\": \"hosting\",\n"
" \"sourceContext\": \"website\",\n"
" \"metadata\": {\n"
" \"associatedOrderExpiryDate\": \"string\",\n"
" \"associatedOrderPlanType\": \"string\",\n"
" \"cpanelHostName\": \"string\",\n"
" \"cpanelUserName\": \"string\",\n"
" \"partnerBrand\": \"string\",\n"
" \"paymentMethod\": \"string\",\n"
" \"autoRenew\": \"string\"\n"
" },\n"
" \"firstEmailAccount\": {\n"
" \"email\": \"james@xyz.com\",\n"
" \"password\": \"password\",\n"
" \"isAdmin\": true,\n"
" \"name\": \"James\",\n"
" \"firstName\": \"James\",\n"
" \"lastName\": \"Bond\",\n"
" \"alternateEmail\": \"james@gmail.com\",\n"
" \"metadata\": {\n"
" \"isFree\": true\n"
" }\n"
" },\n"
" \"sendWelcomeEmail\": true\n"
"}");
CURLcode res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
curl_slist_free_all(headers);
curl_global_cleanup();
return (int)res;
}using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://bll.titan.email/partner/createMailOrder");
request.Headers.TryAddWithoutValidation("Authorization", "API.Key");
request.Content = new StringContent(
"""
{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}
""",
System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);var client = new RestClient("https://bll.titan.email/partner/createMailOrder");
var request = new RestRequest("", Method.Post);
request.AddHeader("Authorization", "API.Key");
request.AddHeader("Content-Type", "application/json");
request.AddStringBody("""
{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}
""", ContentType.Json);
var response = await client.ExecuteAsync(request);(require '[clj-http.client :as client])
(client/post "https://bll.titan.email/partner/createMailOrder" {:headers {:Authorization "API.Key"}
:content-type :json
:form-params {:domainName "xyz.com"
:orderId "12431"
:customerId "abcd123"
:customerName "Adam Smith"
:customerEmailAddress "adam@gmail.com"
:alternateEmailAddress "abc@xyz.com"
:password "asdfqwe"
:customerCountry "US"
:planType "pro"
:noOfAccounts 10
:titanResellerId 456
:expiryDate "2020-02-20"
:paymentTxnId "qweradsf"
:chargedAmount 1.1
:currency "USD"
:chargedUSDAmount 1.1
:discountAmount 0.1
:taxAmount 0.1
:billingCycle "monthly"
:locale "en-gb"
:source "hosting"
:sourceContext "website"
:metadata {:associatedOrderExpiryDate "string"
:associatedOrderPlanType "string"
:cpanelHostName "string"
:cpanelUserName "string"
:partnerBrand "string"
:paymentMethod "string"
:autoRenew "string"}
:firstEmailAccount {:email "james@xyz.com"
:password "password"
:isAdmin true
:name "James"
:firstName "James"
:lastName "Bond"
:alternateEmail "james@gmail.com"
:metadata {:isFree true}}
:sendWelcomeEmail true}})import 'package:http/http.dart' as http;
void main() async {
final headers = <String,String>{
'Authorization': 'API.Key',
'Content-Type': 'application/json',
};
final body = r'{"domainName":"xyz.com","orderId":"12431","customerId":"abcd123","customerName":"Adam Smith","customerEmailAddress":"adam@gmail.com","alternateEmailAddress":"abc@xyz.com","password":"asdfqwe","customerCountry":"US","planType":"pro","noOfAccounts":10,"titanResellerId":456,"expiryDate":"2020-02-20","paymentTxnId":"qweradsf","chargedAmount":1.1,"currency":"USD","chargedUSDAmount":1.1,"discountAmount":0.1,"taxAmount":0.1,"billingCycle":"monthly","locale":"en-gb","source":"hosting","sourceContext":"website","metadata":{"associatedOrderExpiryDate":"string","associatedOrderPlanType":"string","cpanelHostName":"string","cpanelUserName":"string","partnerBrand":"string","paymentMethod":"string","autoRenew":"string"},"firstEmailAccount":{"email":"james@xyz.com","password":"password","isAdmin":true,"name":"James","firstName":"James","lastName":"Bond","alternateEmail":"james@gmail.com","metadata":{"isFree":true}},"sendWelcomeEmail":true}';
final response = await http.post(Uri.parse('https://bll.titan.email/partner/createMailOrder'), headers: headers, body: body);
print(response.body);
}let httpRequestMessage = new HttpRequestMessage(
HttpMethod("POST"),
new Uri("https://bll.titan.email/partner/createMailOrder")
)
httpRequestMessage.Headers.Add("Authorization", "API.Key")
httpRequestMessage.Headers.Add("Content-Type", "application/json")
let content = new StringContent("""{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}""", Encoding.UTF8, "application/json")
httpRequestMessage.Content <- content
let client = new HttpClient()
let! result = client.SendAsync(httpRequestMessage)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
requestUrl := "https://bll.titan.email/partner/createMailOrder"
payload := strings.NewReader(`{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}`)
req, _ := http.NewRequest("POST", requestUrl, payload)
req.Header.Add("Authorization", "API.Key")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}POST /partner/createMailOrder HTTP/1.1
Host: bll.titan.email
Authorization: API.Key
Content-Type: application/json
{"domainName":"xyz.com","orderId":"12431","customerId":"abcd123","customerName":"Adam Smith","customerEmailAddress":"adam@gmail.com","alternateEmailAddress":"abc@xyz.com","password":"asdfqwe","customerCountry":"US","planType":"pro","noOfAccounts":10,"titanResellerId":456,"expiryDate":"2020-02-20","paymentTxnId":"qweradsf","chargedAmount":1.1,"currency":"USD","chargedUSDAmount":1.1,"discountAmount":0.1,"taxAmount":0.1,"billingCycle":"monthly","locale":"en-gb","source":"hosting","sourceContext":"website","metadata":{"associatedOrderExpiryDate":"string","associatedOrderPlanType":"string","cpanelHostName":"string","cpanelUserName":"string","partnerBrand":"string","paymentMethod":"string","autoRenew":"string"},"firstEmailAccount":{"email":"james@xyz.com","password":"password","isAdmin":true,"name":"James","firstName":"James","lastName":"Bond","alternateEmail":"james@gmail.com","metadata":{"isFree":true}},"sendWelcomeEmail":true}POST /bll/partner/createMailOrder HTTP/1.1
Host: api-euc1.titan.email
Authorization: API.Key
Content-Type: application/json
{"domainName":"xyz.com","orderId":"12431","customerId":"abcd123","customerName":"Adam Smith","customerEmailAddress":"adam@gmail.com","alternateEmailAddress":"abc@xyz.com","password":"asdfqwe","customerCountry":"US","planType":"pro","noOfAccounts":10,"titanResellerId":456,"expiryDate":"2020-02-20","paymentTxnId":"qweradsf","chargedAmount":1.1,"currency":"USD","chargedUSDAmount":1.1,"discountAmount":0.1,"taxAmount":0.1,"billingCycle":"monthly","locale":"en-gb","source":"hosting","sourceContext":"website","metadata":{"associatedOrderExpiryDate":"string","associatedOrderPlanType":"string","cpanelHostName":"string","cpanelUserName":"string","partnerBrand":"string","paymentMethod":"string","autoRenew":"string"},"firstEmailAccount":{"email":"james@xyz.com","password":"password","isAdmin":true,"name":"James","firstName":"James","lastName":"Bond","alternateEmail":"james@gmail.com","metadata":{"isFree":true}},"sendWelcomeEmail":true}java.io.ByteArrayOutputStream body = new java.io.ByteArrayOutputStream();
body.write("{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}".getBytes(java.nio.charset.StandardCharsets.UTF_8));
try (AsyncHttpClient client = new DefaultAsyncHttpClient()) {
Response response = client.prepare("POST", "https://bll.titan.email/partner/createMailOrder")
.addHeader("Authorization", "API.Key")
.addHeader("Content-Type", "application/json")
.setBody(body.toByteArray())
.execute()
.get();
System.out.println(response.getResponseBody());
}java.io.ByteArrayOutputStream body = new java.io.ByteArrayOutputStream();
body.write("{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}".getBytes(java.nio.charset.StandardCharsets.UTF_8));
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(java.net.URI.create("https://bll.titan.email/partner/createMailOrder"))
.header("Authorization", "API.Key")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofByteArray(body.toByteArray()))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(MediaType.parse("application/json"), "{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}");
Request request = new Request.Builder()
.url("https://bll.titan.email/partner/createMailOrder")
.method("POST", body)
.addHeader("Authorization", "API.Key")
.addHeader("Content-Type", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
}java.io.ByteArrayOutputStream body = new java.io.ByteArrayOutputStream();
body.write("{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}".getBytes(java.nio.charset.StandardCharsets.UTF_8));
HttpResponse<String> response = Unirest.request("POST", "https://bll.titan.email/partner/createMailOrder")
.header("Authorization", "API.Key")
.header("Content-Type", "application/json")
.body(body.toByteArray())
.asString();
System.out.println(response.getBody());fetch('https://bll.titan.email/partner/createMailOrder', {
method: 'POST',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
})
})import axios from 'axios'
const options = {
method: 'POST',
url: 'https://bll.titan.email/partner/createMailOrder',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
data: {
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
}
}
try {
const { data } = await axios.request(options)
console.log(data)
} catch (error) {
console.error(error)
}import { ofetch } from 'ofetch'
ofetch('https://bll.titan.email/partner/createMailOrder', {
method: 'POST',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
body: {
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
}
})$.ajax({
url: "https://bll.titan.email/partner/createMailOrder",
method: "POST",
processData: false,
contentType: false,
beforeSend(xhr) {
xhr.setRequestHeader("Authorization", "API.Key");
xhr.setRequestHeader("Content-Type", "application/json");
},
data: "{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}"
}).done((response) => console.log(response));const xhr = new XMLHttpRequest();
xhr.open("POST", "https://bll.titan.email/partner/createMailOrder");
xhr.withCredentials = true;
xhr.setRequestHeader("Authorization", "API.Key");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.addEventListener("load", () => console.log(xhr.responseText));
xhr.send("{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}");using HTTP
using JSON
response = HTTP.post(
"https://bll.titan.email/partner/createMailOrder",
[
"Authorization" => "API.Key",
"Content-Type" => "application/json"
],
JSON.json(Dict(
"domainName" => "xyz.com",
"orderId" => "12431",
"customerId" => "abcd123",
"customerName" => "Adam Smith",
"customerEmailAddress" => "adam@gmail.com",
"alternateEmailAddress" => "abc@xyz.com",
"password" => "asdfqwe",
"customerCountry" => "US",
"planType" => "pro",
"noOfAccounts" => 10,
"titanResellerId" => 456,
"expiryDate" => "2020-02-20",
"paymentTxnId" => "qweradsf",
"chargedAmount" => 1.1,
"currency" => "USD",
"chargedUSDAmount" => 1.1,
"discountAmount" => 0.1,
"taxAmount" => 0.1,
"billingCycle" => "monthly",
"locale" => "en-gb",
"source" => "hosting",
"sourceContext" => "website",
"metadata" => Dict(
"associatedOrderExpiryDate" => "string",
"associatedOrderPlanType" => "string",
"cpanelHostName" => "string",
"cpanelUserName" => "string",
"partnerBrand" => "string",
"paymentMethod" => "string",
"autoRenew" => "string"
),
"firstEmailAccount" => Dict(
"email" => "james@xyz.com",
"password" => "password",
"isAdmin" => true,
"name" => "James",
"firstName" => "James",
"lastName" => "Bond",
"alternateEmail" => "james@gmail.com",
"metadata" => Dict("isFree" => true)
),
"sendWelcomeEmail" => true
))
)
println(String(response.body))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}")
val request = Request.Builder()
.url("https://bll.titan.email/partner/createMailOrder")
.post(body)
.addHeader("Authorization", "API.Key")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()fetch('https://bll.titan.email/partner/createMailOrder', {
method: 'POST',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
})
})import axios from 'axios'
const options = {
method: 'POST',
url: 'https://bll.titan.email/partner/createMailOrder',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
data: {
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
}
}
try {
const { data } = await axios.request(options)
console.log(data)
} catch (error) {
console.error(error)
}import { ofetch } from 'ofetch'
ofetch('https://bll.titan.email/partner/createMailOrder', {
method: 'POST',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
body: {
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
}
})import { request } from 'undici'
const { statusCode, body } = await request('https://bll.titan.email/partner/createMailOrder', {
method: 'POST',
headers: {
Authorization: 'API.Key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
domainName: 'xyz.com',
orderId: '12431',
customerId: 'abcd123',
customerName: 'Adam Smith',
customerEmailAddress: 'adam@gmail.com',
alternateEmailAddress: 'abc@xyz.com',
password: 'asdfqwe',
customerCountry: 'US',
planType: 'pro',
noOfAccounts: 10,
titanResellerId: 456,
expiryDate: '2020-02-20',
paymentTxnId: 'qweradsf',
chargedAmount: 1.1,
currency: 'USD',
chargedUSDAmount: 1.1,
discountAmount: 0.1,
taxAmount: 0.1,
billingCycle: 'monthly',
locale: 'en-gb',
source: 'hosting',
sourceContext: 'website',
metadata: {
associatedOrderExpiryDate: 'string',
associatedOrderPlanType: 'string',
cpanelHostName: 'string',
cpanelUserName: 'string',
partnerBrand: 'string',
paymentMethod: 'string',
autoRenew: 'string'
},
firstEmailAccount: {
email: 'james@xyz.com',
password: 'password',
isAdmin: true,
name: 'James',
firstName: 'James',
lastName: 'Bond',
alternateEmail: 'james@gmail.com',
metadata: {
isFree: true
}
},
sendWelcomeEmail: true
})
})#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"Authorization": @"API.Key",
@"Content-Type": @"application/json" };
NSDictionary *parameters = @{ @"domainName": @"xyz.com",
@"orderId": @"12431",
@"customerId": @"abcd123",
@"customerName": @"Adam Smith",
@"customerEmailAddress": @"adam@gmail.com",
@"alternateEmailAddress": @"abc@xyz.com",
@"password": @"asdfqwe",
@"customerCountry": @"US",
@"planType": @"pro",
@"noOfAccounts": @10,
@"titanResellerId": @456,
@"expiryDate": @"2020-02-20",
@"paymentTxnId": @"qweradsf",
@"chargedAmount": @1.1,
@"currency": @"USD",
@"chargedUSDAmount": @1.1,
@"discountAmount": @0.1,
@"taxAmount": @0.1,
@"billingCycle": @"monthly",
@"locale": @"en-gb",
@"source": @"hosting",
@"sourceContext": @"website",
@"metadata": @{ @"associatedOrderExpiryDate": @"string", @"associatedOrderPlanType": @"string", @"cpanelHostName": @"string", @"cpanelUserName": @"string", @"partnerBrand": @"string", @"paymentMethod": @"string", @"autoRenew": @"string" },
@"firstEmailAccount": @{ @"email": @"james@xyz.com", @"password": @"password", @"isAdmin": @YES, @"name": @"James", @"firstName": @"James", @"lastName": @"Bond", @"alternateEmail": @"james@gmail.com", @"metadata": @{ @"isFree": @YES } },
@"sendWelcomeEmail": @YES };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://bll.titan.email/partner/createMailOrder"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];open Lwt.Infix
let () =
Lwt_main.run (
let uri = Uri.of_string "https://bll.titan.email/partner/createMailOrder" in
let headers = Cohttp.Header.of_list [
("Authorization", "API.Key");
("Content-Type", "application/json");
] in
let part0 = "{\"domainName\":\"xyz.com\",\"orderId\":\"12431\",\"customerId\":\"abcd123\",\"customerName\":\"Adam Smith\",\"customerEmailAddress\":\"adam@gmail.com\",\"alternateEmailAddress\":\"abc@xyz.com\",\"password\":\"asdfqwe\",\"customerCountry\":\"US\",\"planType\":\"pro\",\"noOfAccounts\":10,\"titanResellerId\":456,\"expiryDate\":\"2020-02-20\",\"paymentTxnId\":\"qweradsf\",\"chargedAmount\":1.1,\"currency\":\"USD\",\"chargedUSDAmount\":1.1,\"discountAmount\":0.1,\"taxAmount\":0.1,\"billingCycle\":\"monthly\",\"locale\":\"en-gb\",\"source\":\"hosting\",\"sourceContext\":\"website\",\"metadata\":{\"associatedOrderExpiryDate\":\"string\",\"associatedOrderPlanType\":\"string\",\"cpanelHostName\":\"string\",\"cpanelUserName\":\"string\",\"partnerBrand\":\"string\",\"paymentMethod\":\"string\",\"autoRenew\":\"string\"},\"firstEmailAccount\":{\"email\":\"james@xyz.com\",\"password\":\"password\",\"isAdmin\":true,\"name\":\"James\",\"firstName\":\"James\",\"lastName\":\"Bond\",\"alternateEmail\":\"james@gmail.com\",\"metadata\":{\"isFree\":true}},\"sendWelcomeEmail\":true}" in
let body = Cohttp_lwt.Body.of_string (String.concat "" [part0]) in
Cohttp_lwt_unix.Client.call ~headers ~body (Cohttp.Code.method_of_string "POST") uri
>>= fun (_response, body) ->
Cohttp_lwt.Body.to_string body >>= Lwt_io.printl
)$ch = curl_init("https://bll.titan.email/partner/createMailOrder");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: API.Key', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'domainName' => 'xyz.com',
'orderId' => '12431',
'customerId' => 'abcd123',
'customerName' => 'Adam Smith',
'customerEmailAddress' => 'adam@gmail.com',
'alternateEmailAddress' => 'abc@xyz.com',
'password' => 'asdfqwe',
'customerCountry' => 'US',
'planType' => 'pro',
'noOfAccounts' => 10,
'titanResellerId' => 456,
'expiryDate' => '2020-02-20',
'paymentTxnId' => 'qweradsf',
'chargedAmount' => 1.1,
'currency' => 'USD',
'chargedUSDAmount' => 1.1,
'discountAmount' => 0.1,
'taxAmount' => 0.1,
'billingCycle' => 'monthly',
'locale' => 'en-gb',
'source' => 'hosting',
'sourceContext' => 'website',
'metadata' => [
'associatedOrderExpiryDate' => 'string',
'associatedOrderPlanType' => 'string',
'cpanelHostName' => 'string',
'cpanelUserName' => 'string',
'partnerBrand' => 'string',
'paymentMethod' => 'string',
'autoRenew' => 'string'
],
'firstEmailAccount' => [
'email' => 'james@xyz.com',
'password' => 'password',
'isAdmin' => true,
'name' => 'James',
'firstName' => 'James',
'lastName' => 'Bond',
'alternateEmail' => 'james@gmail.com',
'metadata' => [
'isFree' => true
]
],
'sendWelcomeEmail' => true
]));
curl_exec($ch);
curl_close($ch);$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://bll.titan.email/partner/createMailOrder', [
'headers' => [
'Authorization' => 'API.Key',
'Content-Type' => 'application/json'
],
'json' => [
'domainName' => 'xyz.com',
'orderId' => '12431',
'customerId' => 'abcd123',
'customerName' => 'Adam Smith',
'customerEmailAddress' => 'adam@gmail.com',
'alternateEmailAddress' => 'abc@xyz.com',
'password' => 'asdfqwe',
'customerCountry' => 'US',
'planType' => 'pro',
'noOfAccounts' => 10,
'titanResellerId' => 456,
'expiryDate' => '2020-02-20',
'paymentTxnId' => 'qweradsf',
'chargedAmount' => 1.1,
'currency' => 'USD',
'chargedUSDAmount' => 1.1,
'discountAmount' => 0.1,
'taxAmount' => 0.1,
'billingCycle' => 'monthly',
'locale' => 'en-gb',
'source' => 'hosting',
'sourceContext' => 'website',
'metadata' => [
'associatedOrderExpiryDate' => 'string',
'associatedOrderPlanType' => 'string',
'cpanelHostName' => 'string',
'cpanelUserName' => 'string',
'partnerBrand' => 'string',
'paymentMethod' => 'string',
'autoRenew' => 'string'
],
'firstEmailAccount' => [
'email' => 'james@xyz.com',
'password' => 'password',
'isAdmin' => true,
'name' => 'James',
'firstName' => 'James',
'lastName' => 'Bond',
'alternateEmail' => 'james@gmail.com',
'metadata' => [
'isFree' => true
]
],
'sendWelcomeEmail' => true
]
]);use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Authorization' => 'API.Key',
'Content-Type' => 'application/json'
])
->post('https://bll.titan.email/partner/createMailOrder', [
'domainName' => 'xyz.com',
'orderId' => '12431',
'customerId' => 'abcd123',
'customerName' => 'Adam Smith',
'customerEmailAddress' => 'adam@gmail.com',
'alternateEmailAddress' => 'abc@xyz.com',
'password' => 'asdfqwe',
'customerCountry' => 'US',
'planType' => 'pro',
'noOfAccounts' => 10,
'titanResellerId' => 456,
'expiryDate' => '2020-02-20',
'paymentTxnId' => 'qweradsf',
'chargedAmount' => 1.1,
'currency' => 'USD',
'chargedUSDAmount' => 1.1,
'discountAmount' => 0.1,
'taxAmount' => 0.1,
'billingCycle' => 'monthly',
'locale' => 'en-gb',
'source' => 'hosting',
'sourceContext' => 'website',
'metadata' => [
'associatedOrderExpiryDate' => 'string',
'associatedOrderPlanType' => 'string',
'cpanelHostName' => 'string',
'cpanelUserName' => 'string',
'partnerBrand' => 'string',
'paymentMethod' => 'string',
'autoRenew' => 'string'
],
'firstEmailAccount' => [
'email' => 'james@xyz.com',
'password' => 'password',
'isAdmin' => true,
'name' => 'James',
'firstName' => 'James',
'lastName' => 'Bond',
'alternateEmail' => 'james@gmail.com',
'metadata' => [
'isFree' => true
]
],
'sendWelcomeEmail' => true
]);$headers = @{
'Authorization' = 'API.Key'
'Content-Type' = 'application/json'
}
$body = [System.IO.MemoryStream]::new()
$bytes = [System.Text.Encoding]::UTF8.GetBytes('{"domainName":"xyz.com","orderId":"12431","customerId":"abcd123","customerName":"Adam Smith","customerEmailAddress":"adam@gmail.com","alternateEmailAddress":"abc@xyz.com","password":"asdfqwe","customerCountry":"US","planType":"pro","noOfAccounts":10,"titanResellerId":456,"expiryDate":"2020-02-20","paymentTxnId":"qweradsf","chargedAmount":1.1,"currency":"USD","chargedUSDAmount":1.1,"discountAmount":0.1,"taxAmount":0.1,"billingCycle":"monthly","locale":"en-gb","source":"hosting","sourceContext":"website","metadata":{"associatedOrderExpiryDate":"string","associatedOrderPlanType":"string","cpanelHostName":"string","cpanelUserName":"string","partnerBrand":"string","paymentMethod":"string","autoRenew":"string"},"firstEmailAccount":{"email":"james@xyz.com","password":"password","isAdmin":true,"name":"James","firstName":"James","lastName":"Bond","alternateEmail":"james@gmail.com","metadata":{"isFree":true}},"sendWelcomeEmail":true}')
$body.Write($bytes, 0, $bytes.Length)
$response = Invoke-WebRequest -Uri 'https://bll.titan.email/partner/createMailOrder' -Method 'POST' -Headers $headers -Body $body.ToArray()
$body.Dispose()
$response$headers = @{
'Authorization' = 'API.Key'
'Content-Type' = 'application/json'
}
$body = [System.IO.MemoryStream]::new()
$bytes = [System.Text.Encoding]::UTF8.GetBytes('{"domainName":"xyz.com","orderId":"12431","customerId":"abcd123","customerName":"Adam Smith","customerEmailAddress":"adam@gmail.com","alternateEmailAddress":"abc@xyz.com","password":"asdfqwe","customerCountry":"US","planType":"pro","noOfAccounts":10,"titanResellerId":456,"expiryDate":"2020-02-20","paymentTxnId":"qweradsf","chargedAmount":1.1,"currency":"USD","chargedUSDAmount":1.1,"discountAmount":0.1,"taxAmount":0.1,"billingCycle":"monthly","locale":"en-gb","source":"hosting","sourceContext":"website","metadata":{"associatedOrderExpiryDate":"string","associatedOrderPlanType":"string","cpanelHostName":"string","cpanelUserName":"string","partnerBrand":"string","paymentMethod":"string","autoRenew":"string"},"firstEmailAccount":{"email":"james@xyz.com","password":"password","isAdmin":true,"name":"James","firstName":"James","lastName":"Bond","alternateEmail":"james@gmail.com","metadata":{"isFree":true}},"sendWelcomeEmail":true}')
$body.Write($bytes, 0, $bytes.Length)
$response = Invoke-RestMethod -Uri 'https://bll.titan.email/partner/createMailOrder' -Method 'POST' -Headers $headers -Body $body.ToArray()
$body.Dispose()
$responseimport http.client
import json
conn = http.client.HTTPSConnection("bll.titan.email")
payload = json.dumps({
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": True,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": True
}
},
"sendWelcomeEmail": True
})
headers = {
"Authorization": "API.Key",
"Content-Type": "application/json"
}
conn.request(
"POST",
"/partner/createMailOrder",
body=payload,
headers=headers,
)
response = conn.getresponse()
print(response.read().decode())
conn.close()import http.client
import json
conn = http.client.HTTPSConnection("api-euc1.titan.email")
payload = json.dumps({
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": True,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": True
}
},
"sendWelcomeEmail": True
})
headers = {
"Authorization": "API.Key",
"Content-Type": "application/json"
}
conn.request(
"POST",
"/bll/partner/createMailOrder",
body=payload,
headers=headers,
)
response = conn.getresponse()
print(response.read().decode())
conn.close()requests.post(
"https://bll.titan.email/partner/createMailOrder",
headers={
"Authorization": "API.Key",
"Content-Type": "application/json"
},
json={
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": True,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": True
}
},
"sendWelcomeEmail": True
}
)async with aiohttp.ClientSession() as session:
await session.post(
"https://bll.titan.email/partner/createMailOrder",
headers={
"Authorization": "API.Key",
"Content-Type": "application/json"
},
json={
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": True,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": True
}
},
"sendWelcomeEmail": True
}
)httpx.post(
"https://bll.titan.email/partner/createMailOrder",
headers={
"Authorization": "API.Key",
"Content-Type": "application/json"
},
json={
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": True,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": True
}
},
"sendWelcomeEmail": True
}
)async with httpx.AsyncClient() as client:
await client.post(
"https://bll.titan.email/partner/createMailOrder",
headers={
"Authorization": "API.Key",
"Content-Type": "application/json"
},
json={
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": True,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": True
}
},
"sendWelcomeEmail": True
}
)library(httr2)
response <- request("https://bll.titan.email/partner/createMailOrder") |>
req_method("POST") |>
req_headers(
"Authorization" = "API.Key",
"Content-Type" = "application/json"
) |>
req_body_json(list(
domainName = "xyz.com",
orderId = "12431",
customerId = "abcd123",
customerName = "Adam Smith",
customerEmailAddress = "adam@gmail.com",
alternateEmailAddress = "abc@xyz.com",
password = "asdfqwe",
customerCountry = "US",
planType = "pro",
noOfAccounts = 10,
titanResellerId = 456,
expiryDate = "2020-02-20",
paymentTxnId = "qweradsf",
chargedAmount = 1.1,
currency = "USD",
chargedUSDAmount = 1.1,
discountAmount = 0.1,
taxAmount = 0.1,
billingCycle = "monthly",
locale = "en-gb",
source = "hosting",
sourceContext = "website",
metadata = list(
associatedOrderExpiryDate = "string",
associatedOrderPlanType = "string",
cpanelHostName = "string",
cpanelUserName = "string",
partnerBrand = "string",
paymentMethod = "string",
autoRenew = "string"
),
firstEmailAccount = list(
email = "james@xyz.com",
password = "password",
isAdmin = TRUE,
name = "James",
firstName = "James",
lastName = "Bond",
alternateEmail = "james@gmail.com",
metadata = list(
isFree = TRUE
)
),
sendWelcomeEmail = TRUE
)) |>
req_perform()
resp_body_string(response)require 'uri'
require 'net/http'
url = URI("https://bll.titan.email/partner/createMailOrder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'API.Key'
request["Content-Type"] = 'application/json'
request.body = <<~JSON
{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}
JSON
response = http.request(request)
puts response.read_bodylet client = reqwest::Client::new();
let request = client
.post("https://bll.titan.email/partner/createMailOrder")
.header("Authorization", "API.Key")
.header("Content-Type", "application/json")
.json(&serde_json::json!({
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}));
let response = request.send().await?;curl https://bll.titan.email/partner/createMailOrder \
--request POST \
--header 'Authorization: API.Key' \
--header 'Content-Type: application/json' \
--data '{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}'wget --quiet \
--method POST \
--header 'Authorization: API.Key' \
--header 'Content-Type: application/json' \
--body-data '{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}' \
--output-document \
- https://bll.titan.email/partner/createMailOrderhttp --ignore-stdin 'POST' 'https://bll.titan.email/partner/createMailOrder' \
'Authorization:API.Key' \
'Content-Type:application/json' \
--raw='{"domainName":"xyz.com","orderId":"12431","customerId":"abcd123","customerName":"Adam Smith","customerEmailAddress":"adam@gmail.com","alternateEmailAddress":"abc@xyz.com","password":"asdfqwe","customerCountry":"US","planType":"pro","noOfAccounts":10,"titanResellerId":456,"expiryDate":"2020-02-20","paymentTxnId":"qweradsf","chargedAmount":1.1,"currency":"USD","chargedUSDAmount":1.1,"discountAmount":0.1,"taxAmount":0.1,"billingCycle":"monthly","locale":"en-gb","source":"hosting","sourceContext":"website","metadata":{"associatedOrderExpiryDate":"string","associatedOrderPlanType":"string","cpanelHostName":"string","cpanelUserName":"string","partnerBrand":"string","paymentMethod":"string","autoRenew":"string"},"firstEmailAccount":{"email":"james@xyz.com","password":"password","isAdmin":true,"name":"James","firstName":"James","lastName":"Bond","alternateEmail":"james@gmail.com","metadata":{"isFree":true}},"sendWelcomeEmail":true}'import Foundation
var request = URLRequest(url: URL(string: "https://bll.titan.email/partner/createMailOrder")!)
request.httpMethod = "POST"
request.setValue("API.Key", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let jsonBody = #"""
{
"domainName": "xyz.com",
"orderId": "12431",
"customerId": "abcd123",
"customerName": "Adam Smith",
"customerEmailAddress": "adam@gmail.com",
"alternateEmailAddress": "abc@xyz.com",
"password": "asdfqwe",
"customerCountry": "US",
"planType": "pro",
"noOfAccounts": 10,
"titanResellerId": 456,
"expiryDate": "2020-02-20",
"paymentTxnId": "qweradsf",
"chargedAmount": 1.1,
"currency": "USD",
"chargedUSDAmount": 1.1,
"discountAmount": 0.1,
"taxAmount": 0.1,
"billingCycle": "monthly",
"locale": "en-gb",
"source": "hosting",
"sourceContext": "website",
"metadata": {
"associatedOrderExpiryDate": "string",
"associatedOrderPlanType": "string",
"cpanelHostName": "string",
"cpanelUserName": "string",
"partnerBrand": "string",
"paymentMethod": "string",
"autoRenew": "string"
},
"firstEmailAccount": {
"email": "james@xyz.com",
"password": "password",
"isAdmin": true,
"name": "James",
"firstName": "James",
"lastName": "Bond",
"alternateEmail": "james@gmail.com",
"metadata": {
"isFree": true
}
},
"sendWelcomeEmail": true
}
"""#
request.httpBody = jsonBody.data(using: .utf8)
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse,
200..<300 ~= httpResponse.statusCode else {
throw URLError(.badServerResponse)
}
print(String(data: data, encoding: .utf8) ?? ""){
"reqID": "server.req.id",
"titanOrderId": 1,
"status": "active",
"firstEmailAccountDetails": {
"webmailAutoLoginToken": "string",
"titanAccountId": 1
}
}