Get order downloads
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads \
--header 'Authorization: Basic <encoded-value>'import requests
url = "{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads', 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 => "{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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 := "{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"product_name": "Premium E-Book",
"download_name": "premium-ebook.pdf",
"file": "https://example.com/wp-content/uploads/woocommerce_uploads/premium-ebook.pdf",
"downloads_remaining": "5",
"download_expires": "January 30, 2025"
},
{
"product_name": "Video Course",
"download_name": "course-video-1.mp4",
"file": "https://example.com/wp-content/uploads/woocommerce_uploads/course-video-1.mp4",
"downloads_remaining": "Unlimited",
"download_expires": "Never"
}
]{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}My Orders - Single Order - Downloads
Retrieve downloadable items from a specific order
GET
/
my-account
/
orders
/
{id}
/
downloads
Get order downloads
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads \
--header 'Authorization: Basic <encoded-value>'import requests
url = "{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads', 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 => "{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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 := "{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{host}/wp-json/cocart/preview/my-account/orders/{id}/downloads")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"product_name": "Premium E-Book",
"download_name": "premium-ebook.pdf",
"file": "https://example.com/wp-content/uploads/woocommerce_uploads/premium-ebook.pdf",
"downloads_remaining": "5",
"download_expires": "January 30, 2025"
},
{
"product_name": "Video Course",
"download_name": "course-video-1.mp4",
"file": "https://example.com/wp-content/uploads/woocommerce_uploads/course-video-1.mp4",
"downloads_remaining": "Unlimited",
"download_expires": "Never"
}
]{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}This endpoint is currently shown as a preview of what’s currently in development and is subject to change.
Authorizations
basicAuthbearerAuth
WordPress username and password
Path Parameters
Unique identifier for the order
Query Parameters
The orders billing email address