Update the billing profile
Creates or updates the billing details of the account. Requires the administrator role.
PUT
/
enterprise
/
api
/
v1
/
accounts
/
{account_id}
/
billing
/
profile
Update the billing profile
curl --request PUT \
--url https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"profile": {
"legal_name": "Acme Atendimento LTDA",
"email": "financeiro@acme.example",
"phone": "+5511998877665",
"country": "BR",
"tax_id": "12.345.678/0001-99",
"tax_id_type": "cnpj",
"address": {
"street": "Av. Paulista 1000",
"city": "Sao Paulo",
"postal_code": "01310-100"
}
}
}
'const options = {
method: 'PUT',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
profile: {
legal_name: 'Acme Atendimento LTDA',
email: 'financeiro@acme.example',
phone: '+5511998877665',
country: 'BR',
tax_id: '12.345.678/0001-99',
tax_id_type: 'cnpj',
address: {street: 'Av. Paulista 1000', city: 'Sao Paulo', postal_code: '01310-100'}
}
})
};
fetch('https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile', 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/profile"
payload = { "profile": {
"legal_name": "Acme Atendimento LTDA",
"email": "financeiro@acme.example",
"phone": "+5511998877665",
"country": "BR",
"tax_id": "12.345.678/0001-99",
"tax_id_type": "cnpj",
"address": {
"street": "Av. Paulista 1000",
"city": "Sao Paulo",
"postal_code": "01310-100"
}
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, 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/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'profile' => [
'legal_name' => 'Acme Atendimento LTDA',
'email' => 'financeiro@acme.example',
'phone' => '+5511998877665',
'country' => 'BR',
'tax_id' => '12.345.678/0001-99',
'tax_id_type' => 'cnpj',
'address' => [
'street' => 'Av. Paulista 1000',
'city' => 'Sao Paulo',
'postal_code' => '01310-100'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile"
payload := strings.NewReader("{\n \"profile\": {\n \"legal_name\": \"Acme Atendimento LTDA\",\n \"email\": \"financeiro@acme.example\",\n \"phone\": \"+5511998877665\",\n \"country\": \"BR\",\n \"tax_id\": \"12.345.678/0001-99\",\n \"tax_id_type\": \"cnpj\",\n \"address\": {\n \"street\": \"Av. Paulista 1000\",\n \"city\": \"Sao Paulo\",\n \"postal_code\": \"01310-100\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("api_access_token", "<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(string(body))
}HttpResponse<String> response = Unirest.put("https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile\": {\n \"legal_name\": \"Acme Atendimento LTDA\",\n \"email\": \"financeiro@acme.example\",\n \"phone\": \"+5511998877665\",\n \"country\": \"BR\",\n \"tax_id\": \"12.345.678/0001-99\",\n \"tax_id_type\": \"cnpj\",\n \"address\": {\n \"street\": \"Av. Paulista 1000\",\n \"city\": \"Sao Paulo\",\n \"postal_code\": \"01310-100\"\n }\n }\n}")
.asString();{
"legal_name": "Acme Atendimento LTDA",
"email": "financeiro@acme.example",
"phone": "+5511998877665",
"country": "BR",
"tax_id": "12345678000199",
"tax_id_type": "cnpj",
"address": {
"street": "Av. Paulista 1000",
"city": "Sao Paulo",
"postal_code": "01310-100"
},
"required": true,
"complete": true
}{
"error": "Unauthorized"
}{
"error": "Resource not found"
}{
"message": "Validation failed",
"attributes": [
"name cannot be blank"
]
}Autorizações
Resposta
Success
Billing details of the account, used to issue invoices and, for some gateways, to create the customer.
⌘I
Update the billing profile
curl --request PUT \
--url https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"profile": {
"legal_name": "Acme Atendimento LTDA",
"email": "financeiro@acme.example",
"phone": "+5511998877665",
"country": "BR",
"tax_id": "12.345.678/0001-99",
"tax_id_type": "cnpj",
"address": {
"street": "Av. Paulista 1000",
"city": "Sao Paulo",
"postal_code": "01310-100"
}
}
}
'const options = {
method: 'PUT',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
profile: {
legal_name: 'Acme Atendimento LTDA',
email: 'financeiro@acme.example',
phone: '+5511998877665',
country: 'BR',
tax_id: '12.345.678/0001-99',
tax_id_type: 'cnpj',
address: {street: 'Av. Paulista 1000', city: 'Sao Paulo', postal_code: '01310-100'}
}
})
};
fetch('https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile', 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/profile"
payload = { "profile": {
"legal_name": "Acme Atendimento LTDA",
"email": "financeiro@acme.example",
"phone": "+5511998877665",
"country": "BR",
"tax_id": "12.345.678/0001-99",
"tax_id_type": "cnpj",
"address": {
"street": "Av. Paulista 1000",
"city": "Sao Paulo",
"postal_code": "01310-100"
}
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, 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/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'profile' => [
'legal_name' => 'Acme Atendimento LTDA',
'email' => 'financeiro@acme.example',
'phone' => '+5511998877665',
'country' => 'BR',
'tax_id' => '12.345.678/0001-99',
'tax_id_type' => 'cnpj',
'address' => [
'street' => 'Av. Paulista 1000',
'city' => 'Sao Paulo',
'postal_code' => '01310-100'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile"
payload := strings.NewReader("{\n \"profile\": {\n \"legal_name\": \"Acme Atendimento LTDA\",\n \"email\": \"financeiro@acme.example\",\n \"phone\": \"+5511998877665\",\n \"country\": \"BR\",\n \"tax_id\": \"12.345.678/0001-99\",\n \"tax_id_type\": \"cnpj\",\n \"address\": {\n \"street\": \"Av. Paulista 1000\",\n \"city\": \"Sao Paulo\",\n \"postal_code\": \"01310-100\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("api_access_token", "<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(string(body))
}HttpResponse<String> response = Unirest.put("https://chat.wiseapp360.com/enterprise/api/v1/accounts/{account_id}/billing/profile")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile\": {\n \"legal_name\": \"Acme Atendimento LTDA\",\n \"email\": \"financeiro@acme.example\",\n \"phone\": \"+5511998877665\",\n \"country\": \"BR\",\n \"tax_id\": \"12.345.678/0001-99\",\n \"tax_id_type\": \"cnpj\",\n \"address\": {\n \"street\": \"Av. Paulista 1000\",\n \"city\": \"Sao Paulo\",\n \"postal_code\": \"01310-100\"\n }\n }\n}")
.asString();{
"legal_name": "Acme Atendimento LTDA",
"email": "financeiro@acme.example",
"phone": "+5511998877665",
"country": "BR",
"tax_id": "12345678000199",
"tax_id_type": "cnpj",
"address": {
"street": "Av. Paulista 1000",
"city": "Sao Paulo",
"postal_code": "01310-100"
},
"required": true,
"complete": true
}{
"error": "Unauthorized"
}{
"error": "Resource not found"
}{
"message": "Validation failed",
"attributes": [
"name cannot be blank"
]
}