Make Draft
curl --request PATCH \
--url https://{defaultHost}/v1/invoices/{id}/make_draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/invoices/{id}/make_draft"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/invoices/{id}/make_draft', 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://{defaultHost}/v1/invoices/{id}/make_draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/invoices/{id}/make_draft"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/invoices/{id}/make_draft")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/invoices/{id}/make_draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "8128f849-31a4-4f2e-986c-3c9af87ee19f",
"object": "invoice",
"automatic_collection": false,
"due_date": null,
"footer": null,
"issue_date": 1795996800,
"live_mode": true,
"memo": null,
"metadata": {},
"notifications_enabled": true,
"order_number": "0001",
"status": "draft",
"portal_url": "http://app.example.com/portal_redirect/invoices/8128f849-31a4-4f2e-986c-3c9af87ee19f",
"notification_sent_at": 1796063939,
"reminder_notification_sent_at": null,
"checkout": "3a519c66-4a90-4112-b099-8ff97ec91d4d",
"created_at": 1796063939,
"updated_at": 1796063939
}Invoices
Make Draft
Revert an open invoice back to draft.
PATCH
/
v1
/
invoices
/
{id}
/
make_draft
Make Draft
curl --request PATCH \
--url https://{defaultHost}/v1/invoices/{id}/make_draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/invoices/{id}/make_draft"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/invoices/{id}/make_draft', 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://{defaultHost}/v1/invoices/{id}/make_draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/invoices/{id}/make_draft"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/invoices/{id}/make_draft")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/invoices/{id}/make_draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "8128f849-31a4-4f2e-986c-3c9af87ee19f",
"object": "invoice",
"automatic_collection": false,
"due_date": null,
"footer": null,
"issue_date": 1795996800,
"live_mode": true,
"memo": null,
"metadata": {},
"notifications_enabled": true,
"order_number": "0001",
"status": "draft",
"portal_url": "http://app.example.com/portal_redirect/invoices/8128f849-31a4-4f2e-986c-3c9af87ee19f",
"notification_sent_at": 1796063939,
"reminder_notification_sent_at": null,
"checkout": "3a519c66-4a90-4112-b099-8ff97ec91d4d",
"created_at": 1796063939,
"updated_at": 1796063939
}Authorizations
Response
200 - application/json
Success
Was this page helpful?