Submit existing draft for approval
curl --request POST \
--url 'https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'nonce=<string>' \
--data action=sagescreen_submit_deal \
--data deal_id=123import requests
url = "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal"
payload = {
"nonce": "<string>",
"action": "sagescreen_submit_deal",
"deal_id": "123"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({nonce: '<string>', action: 'sagescreen_submit_deal', deal_id: '123'})
};
fetch('https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal', 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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal"
payload := strings.NewReader("nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "Deal submitted for approval",
"deal_id": 1042
}
}Deal AJAX
Submit existing draft for approval
Takes an existing draft deal and transitions it to ss_pending_approval
after validating required fields. Returns validation errors with
redirect_edit: true and edit_url when fields are missing, so the
front end can redirect the user to fix them.
Nonce: sagescreen_frontend_nonce
Capability: ss_sales or ss_sales_admin or ss_admin_all
POST
/
wp-admin
/
admin-ajax.php?action=sagescreen_submit_deal
Submit existing draft for approval
curl --request POST \
--url 'https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'nonce=<string>' \
--data action=sagescreen_submit_deal \
--data deal_id=123import requests
url = "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal"
payload = {
"nonce": "<string>",
"action": "sagescreen_submit_deal",
"deal_id": "123"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({nonce: '<string>', action: 'sagescreen_submit_deal', deal_id: '123'})
};
fetch('https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal', 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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal"
payload := strings.NewReader("nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_submit_deal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "nonce=%3Cstring%3E&action=sagescreen_submit_deal&deal_id=123"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "Deal submitted for approval",
"deal_id": 1042
}
}Authorizations
WordPress AJAX nonce — either sagescreen_frontend_nonce or
sagescreen_sales_calc depending on the endpoint (see each endpoint
description). Sent as a form field in the POST body.
Body
application/x-www-form-urlencoded
⌘I