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": "2023-07-26T12:36:56.58015Z",
"type": "ASSOCIATION",
"status": "PROPOSAL_ACTIVE",
"paymentMode": "PREPAID",
"associationOverride": {
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "2",
"monthOffset": "NIL"
},
"gracePeriod": 3,
"anniversaryCycle": false
}
},
"updatedAt": "2023-07-26T12:36:56.58015Z",
"effectiveFrom": "2023-06-30",
"effectiveUntil": "2023-08-30",
"comment": "Proposal Approved"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}(DEPRECATED) 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
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": "2023-07-26T12:36:56.58015Z",
"type": "ASSOCIATION",
"status": "PROPOSAL_ACTIVE",
"paymentMode": "PREPAID",
"associationOverride": {
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "2",
"monthOffset": "NIL"
},
"gracePeriod": 3,
"anniversaryCycle": false
}
},
"updatedAt": "2023-07-26T12:36:56.58015Z",
"effectiveFrom": "2023-06-30",
"effectiveUntil": "2023-08-30",
"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
512"purchase.20rqjgFJf2O.ejl25"
Body
Payload to approve or decline a proposal
Approve or decline a proposal of a billing plan for an account
APPROVE, DECLINE Response
Response to update proposal status request
Represents a Purchase
1Status of the purchase
SUCCESS, FAILURE, PENDING, IN_PROGRESS, PROPOSAL_ACTIVE, PROPOSAL_APPROVED, PROPOSAL_DECLINED, PROPOSAL_EXPIRED Specifies whether this purchase is for granting entitlements or for an association or for wallet topup or prepaid purchase. If left null, ENTITLEMENT_GRANT is taken as default
ENTITLEMENT_GRANT, ASSOCIATION, WALLET_TOPUP, PREPAID PREPAID, POSTPAID Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Information related to wallet topup purchase
Show child attributes
Show child attributes
