API Documentation Download OpenAPI specification

Complete Purchase

POSThttps://bll.titan.email/partner/completePurchase

API to confirm payment for complete purchase of a Mail Order on the Titan Mail Cloud infra

API consumers can use Create Mail Order/Modify Mail Order APIs for order provisioning and upgrades/renewals.

This API serves a different (and more deeply integrated) case where partner is handling payments for some purchases user initiated in Titan's Domain Control Panel.

Flow:

  1. User initiates a payment action (adds some addon to cart, increases mailboxes, upgrades plan) on Control Panel.
  2. For payment Titan redirects user to a payment url partners provide, passing on a trackingId as part of jwt
  3. Partner takes payment from user and triggers this API (Complete Purchase) with the same trackingId
  4. Titan records the payment and makes the purchases associated with that trackingId.

Body

application/json
titanOrderIdnumberrequired

The unique order ID against each domain provisioned with Titan

Example: 1
domainNamestringoptional

[Deprecated] The mail order name associated to the Titan order ID

Example: xyz.com
customerIdstringoptional

[Deprecated] unique id stored on your end for each customer

Example: abcd123
trackingIdstringrequired

Payment tracking token fetched from Titan's control panel

Example: qwe-123-asd-321
currencystringoptional

This is the currency in which the customer is being charged for Titan mail. also updates domain to this currency

Example: USD
chargedAmountnumberrequired

Total amount charged by the partner to the end customer in the customer's currency for this purchase including taxAmount. Precision upto 2 decimal places.

Example: 12.2
chargedUSDAmountnumberoptional

The value of chargedAmount in USD. If this field is null then open-exchange rates are used to calculate this field

Example: 12.2
discountAmountnumberoptional

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.

Example: 1.5
taxAmountnumberoptional

Amount collected from the user as TAX amount in the customer's currency for this purchase. Precision upto 2 decimal places.

Example: 0.2
paymentTxnIdstringoptional

Payment Transaction ID in your system.

Example: txnId

Responses

200OKapplication/json
reqIDstringrequired
Example: server.req.id
409ConflictRequest
  • domain not in same state as during initiating purchase or no change applied on the domain.

PAYMENT_EXPIRED

  • if trackingId has already been used to complete purchase.
See General Errors for other errors that this API can return.
POST/partner/completePurchase
curl https://bll.titan.email/partner/completePurchase \
  --request POST \
  --header 'Authorization: API.Key' \
  --header 'Content-Type: application/json' \
  --data '{
  "titanOrderId": 1,
  "domainName": "xyz.com",
  "customerId": "abcd123",
  "trackingId": "qwe-123-asd-321",
  "currency": "USD",
  "chargedAmount": 12.2,
  "chargedUSDAmount": 12.2,
  "discountAmount": 1.5,
  "taxAmount": 0.2,
  "paymentTxnId": "txnId"
}'
Response
{
  "reqID": "server.req.id"
}