Approve or decline a purchase of a billing plan
curl --request POST \
--url https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "APPROVE"
}
'import requests
url = "https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status"
payload = { "status": "APPROVE" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'APPROVE'})
};
fetch('https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'APPROVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status"
payload := strings.NewReader("{\n \"status\": \"APPROVE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"APPROVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"APPROVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "purchase.20rvWRxQcQK.0ZwPG",
"accountId": "account2394",
"pricePlanId": "pp.20rqb4MK9ia.TD0eG",
"createdAt": {},
"status": "PROPOSAL_ACTIVE",
"pricePlanOverride": {
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": 2,
"monthOffset": "NIL"
},
"gracePeriod": 3,
"anniversaryCycle": false
}
},
"updatedAt": {},
"effectiveFrom": {},
"effectiveUntil": {},
"comment": "Proposal Approved"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Proposals
Approve or decline a purchase of a billing plan
This API let’s you to approve or decline a proposal of a billing plan for an account
POST
/
purchase_proposals
/
{purchase_proposal_id}
/
update_status
Approve or decline a purchase of a billing plan
curl --request POST \
--url https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "APPROVE"
}
'import requests
url = "https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status"
payload = { "status": "APPROVE" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'APPROVE'})
};
fetch('https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'APPROVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status"
payload := strings.NewReader("{\n \"status\": \"APPROVE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"APPROVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/purchase_proposals/{purchase_proposal_id}/update_status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"APPROVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "purchase.20rvWRxQcQK.0ZwPG",
"accountId": "account2394",
"pricePlanId": "pp.20rqb4MK9ia.TD0eG",
"createdAt": {},
"status": "PROPOSAL_ACTIVE",
"pricePlanOverride": {
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": 2,
"monthOffset": "NIL"
},
"gracePeriod": 3,
"anniversaryCycle": false
}
},
"updatedAt": {},
"effectiveFrom": {},
"effectiveUntil": {},
"comment": "Proposal Approved"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Maximum string length:
512Example:
"purchase.20rqjgFJf2O.ejl25"
Body
application/json
Payload to approve or decline a proposal
Approve or decline a proposal of a billing plan for an account
Available options:
APPROVE, DECLINE Response
Response to update proposal status request
Represents a Purchase
Minimum string length:
1Minimum string length:
1Status of the purchase
Available options:
SUCCESS, FAILURE, PENDING, IN_PROGRESS, PROPOSAL_ACTIVE, PROPOSAL_APPROVED, PROPOSAL_DECLINED, PROPOSAL_EXPIRED Available options:
ENTITLEMENT_GRANT, ASSOCIATION Available options:
PREPAID, POSTPAID Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
