White Label Payment Process - 3rd Party Payment
To add a custom payment process follow these steps:
-
Log in to your Tier3 account.
-
Once logged in, open your workspace
-
Navigate through White Label->Payment Settings
-
Payment Gateway Switch Options
- AI Agent Automation Payment : Use the payment system provided by newoaks
- 3rd Party Payment: Using other third-party payment systems
- No Payment: Hide Pricing in the Navigation Bar
-
Select “3rd Party Payment”
-
Configure the request settings as needed. Fill in the necessary request information, including the URL, parameters, and authentication details.
Call this api with the parameters OrderID, UserId, ProductName, Price, SuccessUrl, and CancelUrl. expect a response containing the payment page url and the OrderID.
Tips:
Price is in cents.
SuccessUrl is the URL to redirect to upon successful payment
CancelUrl is the URL to redirect to if the payment is canceled. -
Note that the response from this interface should follow the structure below.
{
"Data": {
"URL": "https://checkout.stripe.com/xxxxxxxxxxxxx", // payment page url
"OrderID": 1234567890
},
"Version": "1.0.0",
"Success": true,
"Code": 200,
"Message": ""
}
- Click the “Verify Payment API” button. If the interface operates correctly and returns the expected response, the validation will pass.
- Click the “Save” button.
- Go to your white label site Pricing page to make a purchase to verify that your configuration in the above steps is effective.
Payment WebHook API
The webhook API should be notified every time a deduction is successful, both for the first successful subscription and for subsequent recurring automatic deductions.
Endpoint
Request URL: https://usapi.hottask.comundefined
Method: POST
Request Headers
The API request must include the following headers:
Authorization: <Your-Secret-Key>
- string, required - The secret key for authenticating the API requestContent-Type: application/json
- string, required - The content type of the request payload (must be application/json)
Request Body
The request body should contain the following parameters:
{
// string, required - Value should be one of ["subscription_create", "subscription_cycle"]. First subscription value is: "subscription_create", Renewal value is: "subscription_cycle"
"Type": "subscription_create",
// int, required - Refers to the unique number of the order, this parameter has been passed to the other server when calling the Generate Payment Links API
"OrderID": "<The Order ID>",
// int, required - Refers to the unique number of the user of the order, this parameter has been passed to the other server when calling the Generate Payment Link API
"UserID": "<The order owner's ID>"
}
Type
- string, required - Value should be one of ["subscription_create", "subscription_cycle"]. First subscription value is: "subscription_create", Renewal value is: "subscription_cycle"OrderID
- int, required - Refers to the unique number of the order, this parameter has been passed to the other server when calling the Generate Payment Links APIUserID
- int, required - Refers to the unique number of the user of the order, this parameter has been passed to the other server when calling the Generate Payment Link API
Example Request
JavaScript (Fetch API)
const res = await fetch('https://usapi.hottask.com/chat/Chatbot/PaymentWebHook', {
method: 'POST',
headers: {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"Type": "subscription_create",
"OrderID": "<The Order ID>",
"UserID": "<The order owner's ID>"
})
});
const data = await res.json();
console.log(data);
Python (Requests Library)
import requests
import json
url = 'https://usapi.hottask.com/chat/Chatbot/PaymentWebHook'
headers = {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
}
data = {
"Type": "subscription_create",
"OrderID": "<The Order ID>",
"UserID": "<The order owner's ID>"
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)
cURL
curl 'https://usapi.hottask.com/chat/Chatbot/PaymentWebHook' \
-X POST \
-H 'Authorization: <Your-Secret-Key>' \
-H 'Content-Type: application/json' \
-d '{"Type":"subscription_create","OrderID":"<The Order ID>","UserID":"<The order owner's ID>"}'
HTTP Request
POST /chat/Chatbot/PaymentWebHook HTTP/1.1
Host: usapi.hottask.com
Authorization: <Your-Secret-Key>
Content-Type: application/json
{
"Type": "subscription_create",
"OrderID": "<The Order ID>",
"UserID": "<The order owner's ID>"
}
Response
The API response will be a JSON object with the following structure:
{
// string - Response data
"Data": "ok",
// string - API version
"Version": "1.0.0",
// boolean - Operation success status
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if any
"Message": ""
}
Error Handling
That's it! You should now be able to third party pay.