Buy an AI Action package
Starts the one-off purchase of an AI Action package. The credits are granted when the payment is confirmed by the gateway webhook, not when this endpoint returns. Requires an active subscription and the administrator role.
POST
/
enterprise
/
api
/
v1
/
accounts
/
{account_id}
/
billing
/
credit_packages
/
{package_id}
/
checkout
Buy an AI Action package
curl --request POST \
--url https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout \
--header 'api_access_token: <api-key>'const options = {method: 'POST', headers: {api_access_token: '<api-key>'}};
fetch('https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout"
headers = {"api_access_token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"api_access_token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("api_access_token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout")
.header("api_access_token", "<api-key>")
.asString();{
"redirect_url": "https://checkout.stripe.com/c/pay/cs_test_a1B2c3D4"
}{
"error": "Unauthorized"
}{
"error": "Resource not found"
}{
"message": "Validation failed",
"attributes": [
"name cannot be blank"
]
}Autorizações
Parâmetros de caminho
⌘I
Buy an AI Action package
curl --request POST \
--url https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout \
--header 'api_access_token: <api-key>'const options = {method: 'POST', headers: {api_access_token: '<api-key>'}};
fetch('https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout"
headers = {"api_access_token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"api_access_token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("api_access_token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/credit_packages/{package_id}/checkout")
.header("api_access_token", "<api-key>")
.asString();{
"redirect_url": "https://checkout.stripe.com/c/pay/cs_test_a1B2c3D4"
}{
"error": "Unauthorized"
}{
"error": "Resource not found"
}{
"message": "Validation failed",
"attributes": [
"name cannot be blank"
]
}