NAV Navbar
cURL

Introduction

This website documents the WordPress Download Manager REST API. This REST API allows a HTTP client to create, read, update, and delete WordPress Download Manager data using requests in JSON format. WordPress Download Manager REST API uses standard HTTP verbs which are understood by most HTTP clients. This API is built on top of WordPress REST API and lives at /wpdm/v1 namespace.

You can view code examples in the dark area to the right; switch the programming language of the examples with the tabs in the top right.

If anything is missing or seems incorrect, please check the GitHub issues for existing known issues or create a new issue.

Authentication

# Here we are sending a GET request. Adjust the HTTP verb based on your request.
# Sending base64 encoded userrname:password.
curl -X GET \
  "api_endpoint_here" \
  -H 'Authorization: Basic YWRtaW46YWRtaW4='

# Sending API key as bearer token. We will use this Authorization in the rest of the examples.
curl -X GET \
  "api_endpoint_here" \
  -H 'Authorization: Bearer 613efe9acb0d5c2b'  

Authentication is done via the API key which you can find in your WPDM REST API settings. Pass the API key as a bearer token in an Authorization header.

Authorization: Bearer {key}

Alternatively you can also use Basic Auth over https by sending username, password.

Authorization: Basic {base64("username:password")}

In both Authentication procedure what you can do via API depends on the associated user capabilities. Unauthenticated requests will return an HTTP 401 response.

Packages

The packages API endpoint allows you to create, view, update, and delete packages.

Package Properties

Attribute Type Description
id integer Package id, the unique identifier for the resource.
title string Package title.
slug string Package slug.
description string Package details/description/content.
excerpt string Package excerpt.
author integer Package author id ( WordPress user id ).
status string Package status (post status). Options: draft, pending, private and publish. Default is publish.
parent string Package parent. Default is 0 ( no parent ).
tags array Array of tag terms.
categories array Array of category ids ( custom taxonomy term ids for wpdmcategory )
thumbnail string Featured image URL.
additional_previews array Array of additional preview image URLs.
version string Package version.
link_label string Package link label. It is the download button text.
quota integer Package quota. Default is 0 ( unlimited ).
download_limit_per_user integer Package download limit per user.
view_count integer Total views of the package.
download_count integer Total downloads of the package.
package_size string Total size of attached files.
access array Array of user roles who are allowed to access the package.
user_access array Array of usernames who are allowed to access the package ( this is related to Advanced Access Control add-on ).
individual_file_download string Single file download status. Options are -1( Global ), 1 ( Enable ), 0 ( Disable )
cache_zip string Cache Zip File status. Options are -1( Global ), 1 ( Enable ), 0 ( Disable )
template string Link template for the package.
page_template string Page template for the package.
files object Array of attached file names key by file ids.
fileinfo array Array of attached file info key by the file ids.
package_dir string The attached directory.
publish_date date-time Download Available From date.
expire_date date-time Download Expire on date.
terms_lock string Term lock status. Use value 1 to activate lock.
terms_title string Term lock title.
terms_conditions string Term lock terms and agreements text.
terms_check_label string Term lock agree button text.
password_lock string Password lock status. Use value 1 to activate lock.
password string Package passwords. If you are using multiple passwords then separate each password by []. [password1][password2]
password_usage_limit string Usage limit of each package password.
linkedin_lock string Linkedin lock status. Use value 1 to activate lock.
linkedin_message string Linkedin lock message.
linkedin_url string Linkedin URL.
tweet_lock string Tweet lock status. Use value 1 to activate lock.
tweet_message string Tweet lock mesage.
twitterfollow_lock string Twitter follow lock status. Use value 1 to activate lock.
twitter_handle string The Twitter handle to follow.
facebooklike_lock string Facebook like lock status. Use value 1 to activate lock.
facebook_like string Facebook URL to lock.
email_lock string Email lock status. Use value 1 to activate lock.
email_lock_title string Email lock title.
email_lock_msg string Email lock message.
email_lock_idl string Email lock download option. Options are 0 ( Mail Download Link ), 1 ( Download Instantly ), 2 ( Wait For Approval )
icon string Package icon URL.
base_price integer Package base price.
sales_price integer Package sales price.
sales_price_expire date-time Package sales price expire date. Format 2019-08-31 12:00 am
pay_as_you_want string Enable/disable pay as you want feature. Set 1 to enable.
license array Array of license with price and status info.
discount array Array of role based discount data.
enable_license string Enable license for the package using value 1
enable_license_key string License Key Required if value is set to 1
free_downloads array Array of files available for free download in a premium package.
meta_input array Array of custom meta values keyed to their keys.

Get All Packages

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/packages \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "number_of_posts": 5,
    "tag": "add-on,free"
}'

The JSON response looks like the following example:

[
  {
      "id": 241,
      "title": "The Quotable Einstein",
      "slug": "the-quotable-einstein",
      "description": "No problem can be solved from the same level of consciousness that created it.",
      "excerpt": "An A to Z Glossary of Quotations",
      "author": 1,
      "status": "publish",
      "parent": 0,
      "tags": [
          "books",
          "einstein"
      ],
      "categories": [
          16
      ],
      "thumbnail": "https://example.com/wp-content/uploads/2016/01/the-quotable-einstein.jpg",
      "additional_previews": [
          "https://example.com/wp-content/uploads/2019/04/the-quotable-einstein-front.jpg",
          "https://example.com/wp-content/uploads/2019/04/the-quotable-einstein-back.jpg"
      ],
      "version": "1.0.0",
      "link_label": "Download",
      "quota": 0,
      "download_limit_per_user": 100,
      "view_count": 80,
      "download_count": 14,
      "package_size": "811.84 KB",
      "access": [
          "subscriber",
          "administrator"
      ],
      "user_access": [
          "admin"
      ],
      "individual_file_download": "1",
      "cache_zip": "-1",
      "template": "link-template-calltoaction1",
      "page_template": "page-template-1col-flat",
      "files": {
          "1": "The Quotable Einstein.pdf"
      },
      "fileinfo": {
          "1": {
              "title": "The Quotable Einstein",
              "password": "",
              "license_price": {
                  "statdard": "",
                  "extended": "",
                  "unlimited": ""
              },
              "price": ""
          }
      },
      "package_dir": "",
      "publish_date": "2019-04-01 12:00 am",
      "expire_date": "2019-08-31 12:00 am",
      "terms_lock": "1",
      "terms_title": "Agree to terms",
      "terms_conditions": "You can't redistribute without prior authorization.",
      "terms_check_label": "I Agree",
      "password_lock": "1",
      "password": "[123][456]",
      "password_usage_limit": "2",
      "linkedin_lock": "1",
      "linkedin_message": "LinkedIn Share Lock message",
      "linkedin_url": "https://www.wpdownloadmanager.com/",
      "tweet_lock": "1",
      "tweet_message": "Custom tweet message",
      "twitterfollow_lock": "1",
      "twitter_handle": "AHMShahriarAlam",
      "facebooklike_lock": "1",
      "facebook_like": "",
      "email_lock": "1",
      "email_lock_title": "Subscribe To Download",
      "email_lock_msg": "",
      "email_lock_idl": "0",
      "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",

      "base_price": "12.00",
      "sales_price": "10.00",
      "sales_price_expire": "2019-08-31 12:00 am",
      "pay_as_you_want": "0",
      "license": {
          "statdard": {
              "active": "1"
          },
          "extended": {
              "price": "22",
              "active": "1"
          },
          "unlimited": {
              "price": "32",
              "active": "1"
          }
      },
      "discount": {
          "subscriber": "10",
          "contributor": "20",
          "author": "30",
          "editor": "40",
          "administrator": "50"
      },
      "enable_license": "1",
      "enable_license_key": "1",
      "free_downloads": [
              "/Applications/XAMPP/xamppfiles/htdocs/wpdm/wp-content/uploads/2019/04/sample.pdf"
          ],
      "meta_input":{
        "custom_meta" : "Hello There"
      }    
  },
  {
      "title": "The Alchemist",
      "slug": "the-alchemist",
      "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
      "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
      "author": 1,
      "status": "publish",
      "parent": 0,
      "tags": [
          "novel",
          "paulo-coelho"
      ],
      "categories": [
          16
      ],
      "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
      "additional_previews": [
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
      ],
      "version": "3.0.0",
      "link_label": "Download",
      "quota": 0,
      "download_limit_per_user": "100",
      "view_count": 80,
      "download_count": 14,
      "package_size": "811.84 KB",
      "access": [
          "guest",
          "subscriber",
          "administrator"
      ],
      "user_access": [
          "admin"
      ],
      "individual_file_download": "1",
      "cache_zip": "-1",
      "template": "link-template-calltoaction1",
      "page_template": "page-template-1col-flat",
      "files": {
          "1": "The Alchemist.pdf"
      },
      "fileinfo": {
          "1": {
              "title": "The Alchemist",
              "password": "",
              "license_price": {
                  "statdard": "",
                  "extended": "",
                  "unlimited": ""
              },
              "price": ""
          }
      },
      "package_dir": "",
      "publish_date": "2019-04-01 12:00 am",
      "expire_date": "2019-08-31 12:00 am",
      "terms_lock": "1",
      "terms_title": "Agree to terms",
      "terms_conditions": "You can't redistribute without prior authorization.",
      "terms_check_label": "Checkbox Label",
      "password_lock": "1",
      "password": "[123][456]",
      "password_usage_limit": "2",
      "linkedin_lock": "1",
      "linkedin_message": "LinkedIn Share Lock message",
      "linkedin_url": "https://www.wpdownloadmanager.com/",
      "tweet_lock": "1",
      "tweet_message": "Custom tweet message",
      "twitterfollow_lock": "1",
      "twitter_handle": "Shahriar",
      "facebooklike_lock": "1",
      "facebook_like": "",
      "email_lock": "1",
      "email_lock_title": "Subscribe To Download",
      "email_lock_msg": "",
      "email_lock_idl": "0",
      "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",

      "base_price": "12.00",
      "sales_price": "10.00",
      "sales_price_expire": "2019-08-31 12:00 am",
      "pay_as_you_want": "0",
      "license": {
          "statdard": {
              "active": "1"
          },
          "extended": {
              "price": "22",
              "active": "1"
          },
          "unlimited": {
              "price": "32",
              "active": "1"
          }
      },
      "discount": {
          "subscriber": "10",
          "contributor": "20",
          "author": "30",
          "editor": "40",
          "administrator": "50"
      },
      "enable_license": "1",
      "enable_license_key": "1",
      "free_downloads": [
              "/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf"
          ],
      "meta_input":{
        "meta_key" : "Hello"
      }    
  }
]

This endpoint retrieves all packages. Use query parameters to filter packages.

HTTP Request

GET/wp-json/wpdm/v1/packages

Query Parameters

Parameter Default Description
number_of_posts 10 Maximum number of items to be returned in result set.
author empty Send comma separated ids, not an array. "1,2,5"
tag empty Send comma separated tag slugs, not an array. "free,popular,new"
categories empty Send array of category terms. ["Business","Travel"]
search empty Limit results to those matching a string. keyword

Create a Package

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/packages \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "title": "The Alchemist",
     "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
     "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
     "status": "publish",
     "tags": [
        "novel",
        "paulo-coelho"
     ],
     "categories": [
        16
     ],
     "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
     "additional_previews": [
        "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
        "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
     ]
}'

The JSON response looks like the following example:

{
      "id": 6488,
      "title": "The Alchemist",
      "slug": "the-alchemist",
      "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
      "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
      "author": 1,
      "status": "publish",
      "parent": 0,
      "tags": [
          "novel",
          "paulo-coelho"
      ],
      "categories": [
          16
      ],
      "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
      "additional_previews": [
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
      ],
      "version": "3.0.0",
      "link_label": "Download",
      "quota": 0,
      "download_limit_per_user": "100",
      "view_count": 80,
      "download_count": 14,
      "package_size": "811.84 KB",
      "access": [
          "guest",
          "subscriber",
          "administrator"
      ],
      "user_access": [
          "admin"
      ],
      "individual_file_download": "1",
      "cache_zip": "-1",
      "template": "link-template-calltoaction1",
      "page_template": "page-template-1col-flat",
      "files": {
          "1": "The Alchemist.pdf"
      },
      "fileinfo": {
          "1": {
              "title": "The Alchemist",
              "password": "",
              "license_price": {
                  "statdard": "",
                  "extended": "",
                  "unlimited": ""
              },
              "price": ""
          }
      },
      "package_dir": "",
      "publish_date": "2019-04-01 12:00 am",
      "expire_date": "2019-08-31 12:00 am",
      "terms_lock": "1",
      "terms_title": "Agree to terms",
      "terms_conditions": "You can't redistribute without prior authorization.",
      "terms_check_label": "Checkbox Label",
      "password_lock": "1",
      "password": "[123][456]",
      "password_usage_limit": "2",
      "linkedin_lock": "1",
      "linkedin_message": "LinkedIn Share Lock message",
      "linkedin_url": "https://www.wpdownloadmanager.com/",
      "tweet_lock": "1",
      "tweet_message": "Custom tweet message",
      "twitterfollow_lock": "1",
      "twitter_handle": "Shahriar",
      "facebooklike_lock": "1",
      "facebook_like": "",
      "email_lock": "1",
      "email_lock_title": "Subscribe To Download",
      "email_lock_msg": "",
      "email_lock_idl": "0",
      "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",

      "base_price": "12.00",
      "sales_price": "10.00",
      "sales_price_expire": "2019-08-31 12:00 am",
      "pay_as_you_want": "0",
      "license": {
          "statdard": {
              "active": "1"
          },
          "extended": {
              "price": "22",
              "active": "1"
          },
          "unlimited": {
              "price": "32",
              "active": "1"
          }
      },
      "discount": {
          "subscriber": "10",
          "contributor": "20",
          "author": "30",
          "editor": "40",
          "administrator": "50"
      },
      "enable_license": "1",
      "enable_license_key": "1",
      "free_downloads": [
              "/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf"
          ],
      "meta_input":{
        "meta_key" : "Hello"
      }    
  }

This endpoint creates a new Package and sets package properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/packages

Get a Package

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/packages/23 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
      "id": 6488,
      "title": "The Alchemist",
      "slug": "the-alchemist",
      "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
      "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
      "author": 1,
      "status": "publish",
      "parent": 0,
      "tags": [
          "novel",
          "paulo-coelho"
      ],
      "categories": [
          16
      ],
      "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
      "additional_previews": [
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
      ],
      "version": "3.0.0",
      "link_label": "Download",
      "quota": 0,
      "download_limit_per_user": "100",
      "view_count": 80,
      "download_count": 14,
      "package_size": "811.84 KB",
      "access": [
          "guest",
          "subscriber",
          "administrator"
      ],
      "user_access": [
          "admin"
      ],
      "individual_file_download": "1",
      "cache_zip": "-1",
      "template": "link-template-calltoaction1",
      "page_template": "page-template-1col-flat",
      "files": {
          "1": "The Alchemist.pdf"
      },
      "fileinfo": {
          "1": {
              "title": "The Alchemist",
              "password": "",
              "license_price": {
                  "statdard": "",
                  "extended": "",
                  "unlimited": ""
              },
              "price": ""
          }
      },
      "package_dir": "",
      "publish_date": "2019-04-01 12:00 am",
      "expire_date": "2019-08-31 12:00 am",
      "terms_lock": "1",
      "terms_title": "Agree to terms",
      "terms_conditions": "You can't redistribute without prior authorization.",
      "terms_check_label": "Checkbox Label",
      "password_lock": "1",
      "password": "[123][456]",
      "password_usage_limit": "2",
      "linkedin_lock": "1",
      "linkedin_message": "LinkedIn Share Lock message",
      "linkedin_url": "https://www.wpdownloadmanager.com/",
      "tweet_lock": "1",
      "tweet_message": "Custom tweet message",
      "twitterfollow_lock": "1",
      "twitter_handle": "Shahriar",
      "facebooklike_lock": "1",
      "facebook_like": "",
      "email_lock": "1",
      "email_lock_title": "Subscribe To Download",
      "email_lock_msg": "",
      "email_lock_idl": "0",
      "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",

      "base_price": "12.00",
      "sales_price": "10.00",
      "sales_price_expire": "2019-08-31 12:00 am",
      "pay_as_you_want": "0",
      "license": {
          "statdard": {
              "active": "1"
          },
          "extended": {
              "price": "22",
              "active": "1"
          },
          "unlimited": {
              "price": "32",
              "active": "1"
          }
      },
      "discount": {
          "subscriber": "10",
          "contributor": "20",
          "author": "30",
          "editor": "40",
          "administrator": "50"
      },
      "enable_license": "1",
      "enable_license_key": "1",
      "free_downloads": [
              "/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf"
          ],
      "meta_input":{
        "meta_key" : "Hello"
      }    
  }

This endpoint retrieves a specific Package by ID.

HTTP Request

GET/wp-json/wpdm/v1/packages/:id

Update a Package

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/packages/6488 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "title": "The Alchemist",
     "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
     "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
     "status": "publish",
     "tags": [
        "novel",
        "paulo-coelho"
     ],
     "categories": [
        16
     ],
     "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
     "additional_previews": [
        "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
        "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
     ]
}'

The JSON response looks like the following example:

{
      "id": 6488,
      "title": "The Alchemist",
      "slug": "the-alchemist",
      "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
      "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
      "author": 1,
      "status": "publish",
      "parent": 0,
      "tags": [
          "novel",
          "paulo-coelho"
      ],
      "categories": [
          16
      ],
      "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
      "additional_previews": [
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
      ],
      "version": "3.0.0",
      "link_label": "Download",
      "quota": 0,
      "download_limit_per_user": "100",
      "view_count": 80,
      "download_count": 14,
      "package_size": "811.84 KB",
      "access": [
          "guest",
          "subscriber",
          "administrator"
      ],
      "user_access": [
          "admin"
      ],
      "individual_file_download": "1",
      "cache_zip": "-1",
      "template": "link-template-calltoaction1",
      "page_template": "page-template-1col-flat",
      "files": {
          "1": "The Alchemist.pdf"
      },
      "fileinfo": {
          "1": {
              "title": "The Alchemist",
              "password": "",
              "license_price": {
                  "statdard": "",
                  "extended": "",
                  "unlimited": ""
              },
              "price": ""
          }
      },
      "package_dir": "",
      "publish_date": "2019-04-01 12:00 am",
      "expire_date": "2019-08-31 12:00 am",
      "terms_lock": "1",
      "terms_title": "Agree to terms",
      "terms_conditions": "You can't redistribute without prior authorization.",
      "terms_check_label": "Checkbox Label",
      "password_lock": "1",
      "password": "[123][456]",
      "password_usage_limit": "2",
      "linkedin_lock": "1",
      "linkedin_message": "LinkedIn Share Lock message",
      "linkedin_url": "https://www.wpdownloadmanager.com/",
      "tweet_lock": "1",
      "tweet_message": "Custom tweet message",
      "twitterfollow_lock": "1",
      "twitter_handle": "Shahriar",
      "facebooklike_lock": "1",
      "facebook_like": "",
      "email_lock": "1",
      "email_lock_title": "Subscribe To Download",
      "email_lock_msg": "",
      "email_lock_idl": "0",
      "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",

      "base_price": "12.00",
      "sales_price": "10.00",
      "sales_price_expire": "2019-08-31 12:00 am",
      "pay_as_you_want": "0",
      "license": {
          "statdard": {
              "active": "1"
          },
          "extended": {
              "price": "22",
              "active": "1"
          },
          "unlimited": {
              "price": "32",
              "active": "1"
          }
      },
      "discount": {
          "subscriber": "10",
          "contributor": "20",
          "author": "30",
          "editor": "40",
          "administrator": "50"
      },
      "enable_license": "1",
      "enable_license_key": "1",
      "free_downloads": [
              "/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf"
          ],
      "meta_input":{
        "meta_key" : "Hello"
      }    
  }

This endpoint updates a specific Package by ID.

HTTP Request

PUT/wp-json/wpdm/v1/packages/:id

Delete a Package

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/packages/6488 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
      "id": 6488,
      "title": "The Alchemist",
      "slug": "the-alchemist",
      "description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
      "excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
      "author": 1,
      "status": "publish",
      "parent": 0,
      "tags": [
          "novel",
          "paulo-coelho"
      ],
      "categories": [
          16
      ],
      "thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
      "additional_previews": [
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
          "https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
      ],
      "version": "3.0.0",
      "link_label": "Download",
      "quota": 0,
      "download_limit_per_user": "100",
      "view_count": 80,
      "download_count": 14,
      "package_size": "811.84 KB",
      "access": [
          "guest",
          "subscriber",
          "administrator"
      ],
      "user_access": [
          "admin"
      ],
      "individual_file_download": "1",
      "cache_zip": "-1",
      "template": "link-template-calltoaction1",
      "page_template": "page-template-1col-flat",
      "files": {
          "1": "The Alchemist.pdf"
      },
      "fileinfo": {
          "1": {
              "title": "The Alchemist",
              "password": "",
              "license_price": {
                  "statdard": "",
                  "extended": "",
                  "unlimited": ""
              },
              "price": ""
          }
      },
      "package_dir": "",
      "publish_date": "2019-04-01 12:00 am",
      "expire_date": "2019-08-31 12:00 am",
      "terms_lock": "1",
      "terms_title": "Agree to terms",
      "terms_conditions": "You can't redistribute without prior authorization.",
      "terms_check_label": "Checkbox Label",
      "password_lock": "1",
      "password": "[123][456]",
      "password_usage_limit": "2",
      "linkedin_lock": "1",
      "linkedin_message": "LinkedIn Share Lock message",
      "linkedin_url": "https://www.wpdownloadmanager.com/",
      "tweet_lock": "1",
      "tweet_message": "Custom tweet message",
      "twitterfollow_lock": "1",
      "twitter_handle": "Shahriar",
      "facebooklike_lock": "1",
      "facebook_like": "",
      "email_lock": "1",
      "email_lock_title": "Subscribe To Download",
      "email_lock_msg": "",
      "email_lock_idl": "0",
      "icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",

      "base_price": "12.00",
      "sales_price": "10.00",
      "sales_price_expire": "2019-08-31 12:00 am",
      "pay_as_you_want": "0",
      "license": {
          "statdard": {
              "active": "1"
          },
          "extended": {
              "price": "22",
              "active": "1"
          },
          "unlimited": {
              "price": "32",
              "active": "1"
          }
      },
      "discount": {
          "subscriber": "10",
          "contributor": "20",
          "author": "30",
          "editor": "40",
          "administrator": "50"
      },
      "enable_license": "1",
      "enable_license_key": "1",
      "free_downloads": [
              "/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf"
          ],
      "meta_input":{
        "meta_key" : "Hello"
      }    
  }

This endpoint deletes a specific Package by ID.

HTTP Request

DELETE/wp-json/wpdm/v1/packages/:id

Package Categories

The categories API endpoint allows you to create, view, update, and delete package categories.

Package Category Properties

Attribute Type Description
term_id integer Category id, the unique identifier for the resource.
name string Category name.
slug string Category slug.
description string Category details/description/content.
taxonomy string Taxonomy name. Readonly Attribute.
icon string Category icon URL.
parent integer Category parent. Default is 0 ( no parent ).
count integer Number of packages in this Category.
role_access array Array of user roles who has access to this category.
user_access array Array of usernames who has access to this category.

Get All Categories

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/categories \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "orderby": "name",
    "number": "10"
}'

The JSON response looks like the following example:

[
    {
        "term_id": 16,
        "name": "Flat UI",
        "slug": "flat-ui",
        "term_group": 0,
        "term_taxonomy_id": 16,
        "taxonomy": "wpdmcategory",
        "description": "Best UI resources for free.",
        "parent": 0,
        "count": 9,
        "filter": "raw",
        "term_order": "4",
        "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
        "role_access": [
            "subscriber",
            "contributor",
            "administrator"
        ],
        "user_access": [
            "admin"
        ]
    },
    {
        "term_id": 11,
        "name": "Free PSD",
        "slug": "free-psd",
        "term_group": 0,
        "term_taxonomy_id": 11,
        "taxonomy": "wpdmcategory",
        "description": "Unlimited PSD files.",
        "parent": 0,
        "count": 3,
        "filter": "raw",
        "term_order": "5",
        "icon": "http://example.com/wp-content/uploads/2019/02/free-psd.jpg",
        "role_access": [
             "contributor",
             "administrator"
        ],
        "user_access": ""
    }
]

This endpoint retrieves all Categories. Use query parameters to filter result.

HTTP Request

GET/wp-json/wpdm/v1/categories

Query Parameters

Parameter Default Description
orderby name Field(s) to order terms by. Accepts term fields name, slug, term_id.
order ASC Whether to order terms in ascending or descending order. Accepts ASC (ascending) or DESC (descending).
hide_empty false Whether to hide terms not assigned to any posts. Accepts true or false.
number 0 Maximum number of terms to return. Accepts 0 (all) or any positive number
offset empty The number by which to offset the terms query.
parent 0 Parent term ID to retrieve direct-child terms of.
include empty Array or comma/space-separated string of term ids to include. Default empty array.
exclude empty Array or comma/space-separated string of term ids to exclude. If include is non-empty, exclude is ignored. Default empty array.

Create a Category

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/categories \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "name": "Flat UI",
     "slug": "flat-ui",
     "description": "Best UI resources for free.",
     "parent": 0,
     "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
     "role_access": [
         "subscriber",
         "contributor",
         "administrator"
     ],
     "user_access": [
         "admin"
     ]
}'

The JSON response looks like the following example:

{
    "term_id": 16,
    "name": "Flat UI",
    "slug": "flat-ui",
    "term_group": 0,
    "term_taxonomy_id": 16,
    "taxonomy": "wpdmcategory",
    "description": "Best UI resources for free.",
    "parent": 0,
    "count": 9,
    "filter": "raw",
    "term_order": "4",
    "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
    "role_access": [
        "subscriber",
        "contributor",
        "administrator"
    ],
    "user_access": [
        "admin"
    ]
}

This endpoint creates a new Category and sets Category properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/categories

Get a Category

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/categories/16 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "term_id": 16,
    "name": "Flat UI",
    "slug": "flat-ui",
    "term_group": 0,
    "term_taxonomy_id": 16,
    "taxonomy": "wpdmcategory",
    "description": "Best UI resources for free.",
    "parent": 0,
    "count": 9,
    "filter": "raw",
    "term_order": "4",
    "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
    "role_access": [
        "subscriber",
        "contributor",
        "administrator"
    ],
    "user_access": [
        "admin"
    ]
}

This endpoint retrieves a specific Category by ID (term_id ).

HTTP Request

GET/wp-json/wpdm/v1/categories/:id

Update a Category

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/categories/16 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "name": "Flat UI",
     "slug": "flat-ui",
     "description": "Best UI resources for free.",
     "parent": 0,
     "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
     "role_access": [
         "subscriber",
         "contributor",
         "administrator"
     ],
     "user_access": [
         "admin"
     ]
}'

The JSON response looks like the following example:

{
    "term_id": 16,
    "name": "Flat UI",
    "slug": "flat-ui",
    "term_group": 0,
    "term_taxonomy_id": 16,
    "taxonomy": "wpdmcategory",
    "description": "Best UI resources for free.",
    "parent": 0,
    "count": 9,
    "filter": "raw",
    "term_order": "4",
    "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
    "role_access": [
        "subscriber",
        "contributor",
        "administrator"
    ],
    "user_access": [
        "admin"
    ]
}

This endpoint updates a specific Category by ID (term_id ).

HTTP Request

PUT/wp-json/wpdm/v1/categories/:id

Delete a Category

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/categories/16 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "term_id": 16,
    "name": "Flat UI",
    "slug": "flat-ui",
    "term_group": 0,
    "term_taxonomy_id": 16,
    "taxonomy": "wpdmcategory",
    "description": "Best UI resources for free.",
    "parent": 0,
    "count": 9,
    "filter": "raw",
    "term_order": "4",
    "icon": "http://example.com/wp-content/uploads/2019/02/flat-ui.jpg",
    "role_access": [
        "subscriber",
        "contributor",
        "administrator"
    ],
    "user_access": [
        "admin"
    ]
}

This endpoint deletes a specific Category by ID (term_id ).

HTTP Request

DELETE/wp-json/wpdm/v1/categories/:id

Package Tags

The tags API endpoint allows you to create, view, update, and delete package tags.

Package Tag Properties

Attribute Type Description
term_id integer Tag id, the unique identifier for the resource.
name string Tag name.
slug string Tag slug.
description string Tag details/description/content.
taxonomy string Taxonomy name. Readonly Attribute.
parent integer Tag parent. Always is 0 ( non-hierarchical taxonomy ).
count integer Number of packages under this Tag.

Get All Tags

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/tags \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "orderby": "name",
    "number": "10"
}'

The JSON response looks like the following example:

[
    {
        "term_id": 1496,
        "name": "add-on",
        "slug": "add-on",
        "term_group": 0,
        "term_taxonomy_id": 1496,
        "taxonomy": "post_tag",
        "description": "",
        "parent": 0,
        "count": 5,
        "filter": "raw",
        "term_order": "0"
    },
    {
        "term_id": 1502,
        "name": "locked",
        "slug": "locked",
        "term_group": 0,
        "term_taxonomy_id": 1502,
        "taxonomy": "post_tag",
        "description": "",
        "parent": 0,
        "count": 2,
        "filter": "raw",
        "term_order": "0"
    }
]

This endpoint retrieves all Tags. Use query parameters to filter result.

HTTP Request

GET/wp-json/wpdm/v1/tags

Query Parameters

Parameter Default Description
orderby name Field(s) to order terms by. Accepts term fields name, slug, term_id.
order ASC Whether to order terms in ascending or descending order. Accepts ASC (ascending) or DESC (descending).
hide_empty false Whether to hide terms not assigned to any posts. Accepts true or false.
number 0 Maximum number of terms to return. Accepts 0 (all) or any positive number
offset empty The number by which to offset the terms query.
include empty Array or comma/space-separated string of term ids to include. Default empty array.
exclude empty Array or comma/space-separated string of term ids to exclude. If include is non-empty, exclude is ignored. Default empty array.

Create a Tag

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/tags \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "name": "add-on",
     "slug": "add-on",
     "description": ""
}'

The JSON response looks like the following example:

{
    "term_id": 1496,
    "name": "add-on",
    "slug": "add-on",
    "term_group": 0,
    "term_taxonomy_id": 1496,
    "taxonomy": "post_tag",
    "description": "",
    "parent": 0,
    "count": 5,
    "filter": "raw",
    "term_order": "0"
}

This endpoint creates a new Tag and sets Tag properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/tags

Get a Tag

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/tags/1496 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "term_id": 1496,
    "name": "add-on",
    "slug": "add-on",
    "term_group": 0,
    "term_taxonomy_id": 1496,
    "taxonomy": "post_tag",
    "description": "",
    "parent": 0,
    "count": 5,
    "filter": "raw",
    "term_order": "0"
}

This endpoint retrieves a specific Tag by ID (term_id ).

HTTP Request

GET/wp-json/wpdm/v1/tags/:id

Update a Tag

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/tags/1496 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "name": "add-on",
     "slug": "add-on",
     "description": ""
}'

The JSON response looks like the following example:

{
    "term_id": 1496,
    "name": "add-on",
    "slug": "add-on",
    "term_group": 0,
    "term_taxonomy_id": 1496,
    "taxonomy": "post_tag",
    "description": "",
    "parent": 0,
    "count": 5,
    "filter": "raw",
    "term_order": "0"
}

This endpoint updates a specific Tag by ID (term_id ).

HTTP Request

PUT/wp-json/wpdm/v1/tags/:id

Delete a Tag

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/tags/1496 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "term_id": 1496,
    "name": "add-on",
    "slug": "add-on",
    "term_group": 0,
    "term_taxonomy_id": 1496,
    "taxonomy": "post_tag",
    "description": "",
    "parent": 0,
    "count": 5,
    "filter": "raw",
    "term_order": "0"
}

This endpoint deletes a specific Tag by ID (term_id ).

HTTP Request

DELETE/wp-json/wpdm/v1/tags/:id

Download Stats

The stats API endpoint allows you to create, view, update, and delete package download stats.

Download Stat Properties

Attribute Type Description
id integer Download Stat id, the unique identifier for the resource.
post_title string Downloaded Package name.
pid integer Downloaded Package id.
uid integer The id of the user if downloaded as logged in user, otherwise empty.
oid string Order id if the stat is associated with a premium package order.
year integer Downloaded year.
month integer Downloaded month.
day integer Downloaded day.
day integer Downloaded day.
timestamp string Unix timestamp of the download time.
ip string The IP from whre the download was initiated.

Get All Stats

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/stats \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "items_per_page": 10,
    "page": 2
}'

The JSON response looks like the following example:

[
    {
        "post_title": "Premium WordPress Theme",
        "id": "393",
        "pid": "5209",
        "uid": "1",
        "oid": "",
        "year": "2019",
        "month": "4",
        "day": "5",
        "timestamp": "1554477927",
        "ip": "127.0.0.1"
    },
    {
        "post_title": "Stock Photos",
        "id": "392",
        "pid": "5185",
        "uid": "1",
        "oid": "",
        "year": "2019",
        "month": "4",
        "day": "5",
        "timestamp": "1554476883",
        "ip": "127.0.0.1"
    },
    {
        "post_title": "Web Fonts",
        "id": "391",
        "pid": "5185",
        "uid": "1",
        "oid": "",
        "year": "2019",
        "month": "4",
        "day": "5",
        "timestamp": "1554476337",
        "ip": "127.0.0.1"
    }
]

This endpoint retrieves all Download Stats. Use query parameters to filter result.

HTTP Request

GET/wp-json/wpdm/v1/stats

Query Parameters

Parameter Default Description
items_per_page 10 Number of records to retrive.
page 0 The page number.
start_date empty Filter stats by date.
end_date empty Filter stats by date.
package_id empty Filter stats by Package. Set package_id to get download stats of a specific package.
user_id empty Filter stats by user. Set user_id to get download history of a user.

Create a Download Stat

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/stats \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "post_title": "Stock Photos",
     "pid": "5209",
     "uid": "1",
     "oid": "",
     "year": "2019",
     "month": "4",
     "day": "5",
     "timestamp": "1554477927",
     "ip": "127.0.0.1"
}'

The JSON response looks like the following example:

{
    "post_title": "Stock Photos",
    "id": "393",
    "pid": "5209",
    "uid": "1",
    "oid": "",
    "year": "2019",
    "month": "4",
    "day": "5",
    "timestamp": "1554477927",
    "ip": "127.0.0.1"
}

This endpoint creates a new Download Stat and sets Download Stat properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/stats

Get a Download Stat

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/stats/393 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "post_title": "Stock Photos",
    "id": "393",
    "pid": "5209",
    "uid": "1",
    "oid": "",
    "year": "2019",
    "month": "4",
    "day": "5",
    "timestamp": "1554477927",
    "ip": "127.0.0.1"
}

This endpoint retrieves a specific Download Stat by ID.

HTTP Request

GET/wp-json/wpdm/v1/stats/:id

Update a Download Stat

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/stats/393 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "post_title": "Stock Photos",
     "pid": "5209",
     "uid": "1",
     "oid": "",
     "year": "2019",
     "month": "4",
     "day": "5",
     "timestamp": "1554477927",
     "ip": "127.0.0.1"
}'

The JSON response looks like the following example:

{
    "post_title": "Stock Photos",
    "id": "393",
    "pid": "5209",
    "uid": "1",
    "oid": "",
    "year": "2019",
    "month": "4",
    "day": "5",
    "timestamp": "1554477927",
    "ip": "127.0.0.1"
}

This endpoint updates a specific Download Stat by ID.

HTTP Request

PUT/wp-json/wpdm/v1/stats/:id

Delete a Download Stat

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/stats/393 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "post_title": "Stock Photos",
    "id": "393",
    "pid": "5209",
    "uid": "1",
    "oid": "",
    "year": "2019",
    "month": "4",
    "day": "5",
    "timestamp": "1554477927",
    "ip": "127.0.0.1"
}

This endpoint deletes a specific Download Stat by ID.

HTTP Request

DELETE/wp-json/wpdm/v1/stats/:id

Subscribers

The subscribers API endpoint allows you to create, view, update, and delete subscribers.

Subscriber Properties

Attribute Type Description
id integer Subscriber id, the unique identifier for the resource.
post_title string The Package name from where the email was captured.
pid integer The Package id from where the email was captured.
email string User's email address.
date date The date of the download.
custom_data array Additiona custom fileds data added by the Quick Form.
request_status string Download link request status.

Get All Subscribers

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/subscribers \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "items_per_page": 10,
    "page": 2,
    "package_id": 12
}'

The JSON response looks like the following example:

[
    {
        "post_title": "Multiple Locks",
        "id": "3",
        "email": "username@example.com",
        "pid": "30",
        "date": "March 29, 2019",
        "custom_data": {
            "name": "Shahriar Alam",
            "country": "Bangladesh",
            "Company": "W3 Eden, Inc.",
            "phone": "01720000001"
        },
        "request_status": "1"
    },
    {
        "post_title": "PDF Stamper",
        "id": "2",
        "email": "imwpdm@example.com",
        "pid": "12",
        "date": "March 29, 2019",
        "custom_data": {
            "name": "Shafaet Alam",
            "country": "Bangladesh",
            "Company": "W3 Eden, Inc.",
            "phone": "01120000001"
        },
        "request_status": "1"
    },
    {
        "post_title": "Directory Add-on",
        "id": "11",
        "email": "restapi@example.com",
        "pid": "30",
        "date": "March 29, 2019",
        "custom_data": {
            "name": "Shahnur Alam",
            "country": "Bangladesh",
            "Company": "W3 Eden, Inc.",
            "phone": "09120000001"
        },
        "request_status": "1"
    }
]

This endpoint retrieves all Subscribers. Use query parameters to filter result.

HTTP Request

GET/wp-json/wpdm/v1/subscribers

Query Parameters

Parameter Default Description
items_per_page 10 Number of records to retrive.
page 0 The page number.
start_date empty Filter subscribers by date.
end_date empty Filter subscribers by date.
package_id empty Filter subscribers by Package. Set package_id to get subscribers of a specific package.

Create a Subscriber

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/subscribers \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "post_title": "Multiple Locks",
     "email": "shahriar@example.com",
     "pid": "30",
     "date": "March 29, 2019",
     "custom_data": {
         "name": "Shahriar Alam",
         "country": "Bangladesh",
         "Company": "W3 Eden, Inc.",
         "phone": "01700007911"
     },
     "request_status": "1"
}'

The JSON response looks like the following example:

{
    "post_title": "Multiple Locks",
    "id": "1",
    "email": "shahriar@example.com",
    "pid": "30",
    "date": "March 29, 2019",
    "custom_data": {
        "name": "Shahriar Alam",
        "country": "Bangladesh",
        "Company": "W3 Eden, Inc.",
        "phone": "01700007911"
    },
    "request_status": "1"
}

This endpoint creates a new Subscriber and sets Subscriber properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/subscribers

Get a Subscriber

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/subscribers/1 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "post_title": "Multiple Locks",
    "id": "1",
    "email": "shahriar@example.com",
    "pid": "30",
    "date": "March 29, 2019",
    "custom_data": {
        "name": "Shahriar Alam",
        "country": "Bangladesh",
        "Company": "W3 Eden, Inc.",
        "phone": "01700007911"
    },
    "request_status": "1"
}

This endpoint retrieves a specific Subscriber by ID.

HTTP Request

GET/wp-json/wpdm/v1/subscribers/:id

Update a Subscriber

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/subscribers/1 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "post_title": "Multiple Locks",
     "email": "shahriar@example.com",
     "pid": "30",
     "date": "March 29, 2019",
     "custom_data": {
         "name": "Shahriar Alam",
         "country": "Bangladesh",
         "Company": "W3 Eden, Inc.",
         "phone": "01700007911"
     },
     "request_status": "1"
}'

The JSON response looks like the following example:

{
    "post_title": "Multiple Locks",
    "id": "1",
    "email": "shahriar@example.com",
    "pid": "30",
    "date": "March 29, 2019",
    "custom_data": {
        "name": "Shahriar Alam",
        "country": "Bangladesh",
        "Company": "W3 Eden, Inc.",
        "phone": "01700007911"
    },
    "request_status": "1"
}

This endpoint updates a specific Subscriber by ID.

HTTP Request

PUT/wp-json/wpdm/v1/subscribers/:id

Delete a Subscriber

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/subscribers/1 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "post_title": "Multiple Locks",
    "id": "1",
    "email": "shahriar@example.com",
    "pid": "30",
    "date": "March 29, 2019",
    "custom_data": {
        "name": "Shahriar Alam",
        "country": "Bangladesh",
        "Company": "W3 Eden, Inc.",
        "phone": "01700007911"
    },
    "request_status": "1"
}

This endpoint deletes a specific Subscriber by ID.

HTTP Request

DELETE/wp-json/wpdm/v1/subscribers/:id

Orders

The orders API endpoint allows you to create, view, update, and delete Premium Package Orders.

Order Properties

Attribute Type Description
order_id string Order id, the unique identifier for the resource.
trans_id string Transaction id, unique identifier for this order in Payment platform.
title string Order title
date date The date the order was created.
items array Array of package IDs that are included in this order.
cart_data object Detailed information about cart/order items. Check the response JSON to get a clear idea how data are fomatted in this attribute.
total string Grand total of the order. The amount paid by the customer.
order_status string Order status. Options are Pending, Processing, Completed, Expired, Cancelled
payment_status string Payment status. Options are Pending, Processing, Completed, Expired, Cancelled, Gifted, Disputed, Refunded
uid string User id of the customer associated with this order.
order_notes object All notes added to this order.
payment_method string The payment method used to place this order.
tax string Total tax for this order.
cart_discount string Total cart discount.
coupon_discount string Total coupon discount.
currency object The object contains the currency sign and code
IP string The IP address from where the order was placed.
billing_info object The object contains the Billing details of the customer.
expire_date date The date when the order will be expired.
auto_renew int Order auto renew status. Default 0
coupon_code string The coupon code applied to theis order.
subtotal string The subtotal of the order before applying discounts.

Get All Orders

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/orders \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "items_per_page": 10,
    "payment_status": "Completed"
}'

The JSON response looks like the following example:

[
    {
        "order_id": "5c9f89523c467",
        "trans_id": "250140068332",
        "title": "WPDM Order# 5c9f89523c467",
        "date": "March 30, 2019",
        "items": [
            3901,
            5649
        ],
        "cart_data": {
            "3901": {
                "quantity": "1",
                "variation": [],
                "price": "10.00",
                "files": [],
                "license": {
                    "id": "statdard",
                    "info": {
                        "name": "Standard",
                        "description": "",
                        "use": "1"
                    }
                },
                "ID": 3901,
                "post_title": "Premium Package ( WPPM Free Trial Item )",
                "prices": 0,
                "variations": [],
                "discount_amount": 0
            },
            "5649": {
                "quantity": "1",
                "variation": [],
                "price": "12.00",
                "files": [],
                "license": {
                    "id": "",
                    "info": ""
                },
                "ID": 5649,
                "post_title": "Einstein, Quote",
                "prices": 0,
                "variations": [],
                "discount_amount": 0
            }
        },
        "total": "11",
        "order_status": "Completed",
        "payment_status": "Completed",
        "uid": "1",
        "order_notes": {
            "messages": {
                "1": {
                    "note": "Send me the documentation link.",
                    "by": "Customer"
                },
                "2": {
                    "note": "Here is the doc https://www.wpdownloadmanager.com/",
                    "by": "Customer"
                }
            }
        },
        "payment_method": "TestPay",
        "tax": "0",
        "cart_discount": "0",
        "discount": "0",
        "coupon_discount": "11",
        "currency": {
            "sign": "$",
            "code": "USD"
        },
        "download": "1",
        "IP": "::1",
        "ipn": "",
        "unit_prices": "",
        "billing_info": {
            "first_name": "Shahriar",
            "last_name": "Alam",
            "company": "W3 Eden",
            "country": "BD",
            "state": "A",
            "address_1": "Chittagong",
            "address_2": "Chnadgaon",
            "city": "Chittagong",
            "postcode": "4212",
            "phone": "+0101725111222",
            "order_email": "shahriar@wpdm.com"
        },
        "expire_date": "March 29, 2020",
        "auto_renew": "0",
        "coupon_code": "50off",
        "subtotal": "22"
    },
    {
        "order_id": "5c9fc5bada534",
        "trans_id": "250140068399",
        "title": "Hello There",
        "date": "March 30, 2019",
        "items": [
            3901,
            5649
        ],
        "cart_data": {
            "3901": {
                "quantity": "1",
                "variation": [],
                "price": "10.00",
                "files": [],
                "license": {
                    "id": "statdard",
                    "info": {
                        "name": "Standard",
                        "description": "",
                        "use": "1"
                    }
                },
                "ID": 3901,
                "post_title": "Premium Package ( WPPM Free Trial Item )",
                "prices": 0,
                "variations": [],
                "discount_amount": 0
            },
            "5649": {
                "quantity": "1",
                "variation": [],
                "price": "12.00",
                "files": [],
                "license": {
                    "id": "",
                    "info": ""
                },
                "ID": 5649,
                "post_title": "WPDM Pro",
                "prices": 0,
                "variations": [],
                "discount_amount": 0
            }
        },
        "total": "11",
        "order_status": "Completed",
        "payment_status": "Completed",
        "uid": "1",
        "order_notes": {
            "messages": {
                "1": {
                    "note": "Where can I download the invoice?",
                    "by": "Customer"
                }
            }
        },
        "payment_method": "TestPay",
        "tax": "0",
        "cart_discount": "0",
        "discount": "0",
        "coupon_discount": "11",
        "currency": {
            "sign": "$",
            "code": "USD"
        },
        "download": "1",
        "IP": "::1",
        "ipn": "",
        "unit_prices": "",
        "billing_info": {
            "first_name": "Shahriar",
            "last_name": "Alam",
            "company": "W3 Eden",
            "country": "BD",
            "state": "A",
            "address_1": "Chittagong",
            "address_2": "Chnadgaon",
            "city": "Chittagong",
            "postcode": "4212",
            "phone": "+0101725111222",
            "order_email": "shahriar@wpdm.com"
        },
        "expire_date": "March 29, 2020",
        "auto_renew": "0",
        "coupon_code": "50off",
        "subtotal": "22"
    }
]

This endpoint retrieves all Orders. Use query parameters to limit the response.

HTTP Request

GET/wp-json/wpdm/v1/orders

Query Parameters

Parameter Default Description
items_per_page 10 Number of orders to retrive.
page 0 The page number.
start_date empty Limit response to orders created after a given date-time. Example, 2019-01-31 12:00 am
end_date empty Limit response to orders created before a given date-time. Example, 2019-03-22 12:00 am
order_status empty Limit response to orders by a provided status. Options are Pending, Processing, Completed, Expired, Cancelled
payment_status empty Filter orders by payment status. Options are Pending, Processing, Completed, Expired, Cancelled, Gifted, Disputed, Refunded
payment_method empty Filter orders by payment method.
uid empty Get all orders owned by a specific user.

Create a Order

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/orders \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "date": "April 7, 2019",
     "items": [
         3901
     ],
     "cart_data": {
        "3901": {
            "quantity": 1,
            "variation": [],
            "price": "10.00",
            "files": [],
            "license": {
                "id": "",
                "info": ""
            },
            "ID": 3901,
            "post_title": "Premium Package ( WPPM Free Trial Item )",
            "prices": 0,
            "variations": [],
            "discount_amount": 0
        }
     },
     "total": "10",
     "order_status": "Completed",
     "payment_status": "Completed",
     "uid": "1",
     "order_notes": "",
     "payment_method": "TestPay",
     "tax": "0",
     "cart_discount": "0",
     "discount": "0",
     "coupon_discount": "0",
     "currency": {
        "sign": "$",
        "code": "USD"
     },
     "download": "0",
     "IP": "::1",
     "ipn": "",
     "unit_prices": "",
     "billing_info": {
        "first_name": "Shahriar",
        "last_name": "Alam",
        "company": "W3 Eden",
        "country": "BD",
        "state": "A",
        "address_1": "Chittagong",
        "address_2": "Chnadgaon",
        "city": "Chittagong",
        "postcode": "4212",
        "phone": "+8801720000000",
        "order_email": "shahriar@wpdm.com"
     },
     "expire_date": "April 6, 2020",
     "auto_renew": "0",
     "coupon_code": "",
     "subtotal": "10"
}'

The JSON response looks like the following example:

{
    "order_id": "5caa1c94aaf0f",
    "trans_id": "",
    "title": "WPDM Order# 5caa1c94aaf0f",
    "date": "April 7, 2019",
    "items": [
        3901
    ],
    "cart_data": {
        "3901": {
            "quantity": 1,
            "variation": [],
            "price": "10.00",
            "files": [],
            "license": {
                "id": "",
                "info": ""
            },
            "ID": 3901,
            "post_title": "Premium Package ( WPPM Free Trial Item )",
            "prices": 0,
            "variations": [],
            "discount_amount": 0
        }
    },
    "total": "10",
    "order_status": "Completed",
    "payment_status": "Completed",
    "uid": "1",
    "order_notes": "",
    "payment_method": "TestPay",
    "tax": "0",
    "cart_discount": "0",
    "discount": "0",
    "coupon_discount": "0",
    "currency": {
        "sign": "$",
        "code": "USD"
    },
    "download": "0",
    "IP": "::1",
    "ipn": "",
    "unit_prices": "",
    "billing_info": {
        "first_name": "Shahriar",
        "last_name": "Alam",
        "company": "W3 Eden",
        "country": "BD",
        "state": "A",
        "address_1": "Chittagong",
        "address_2": "Chnadgaon",
        "city": "Chittagong",
        "postcode": "4212",
        "phone": "+8801720000000",
        "order_email": "shahriar@wpdm.com"
    },
    "expire_date": "April 6, 2020",
    "auto_renew": "0",
    "coupon_code": "",
    "subtotal": "10"
}

This endpoint creates a new Order and sets Order properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/orders

Get an Order

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/orders/5caa1c94aaf0f \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "order_id": "5caa1c94aaf0f",
    "trans_id": "",
    "title": "WPDM Order# 5caa1c94aaf0f",
    "date": "April 7, 2019",
    "items": [
        3901
    ],
    "cart_data": {
        "3901": {
            "quantity": 1,
            "variation": [],
            "price": "10.00",
            "files": [],
            "license": {
                "id": "",
                "info": ""
            },
            "ID": 3901,
            "post_title": "Premium Package ( WPPM Free Trial Item )",
            "prices": 0,
            "variations": [],
            "discount_amount": 0
        }
    },
    "total": "10",
    "order_status": "Completed",
    "payment_status": "Completed",
    "uid": "1",
    "order_notes": "",
    "payment_method": "TestPay",
    "tax": "0",
    "cart_discount": "0",
    "discount": "0",
    "coupon_discount": "0",
    "currency": {
        "sign": "$",
        "code": "USD"
    },
    "download": "0",
    "IP": "::1",
    "ipn": "",
    "unit_prices": "",
    "billing_info": {
        "first_name": "Shahriar",
        "last_name": "Alam",
        "company": "W3 Eden",
        "country": "BD",
        "state": "A",
        "address_1": "Chittagong",
        "address_2": "Chnadgaon",
        "city": "Chittagong",
        "postcode": "4212",
        "phone": "+8801720000000",
        "order_email": "shahriar@wpdm.com"
    },
    "expire_date": "April 6, 2020",
    "auto_renew": "0",
    "coupon_code": "",
    "subtotal": "10"
}

This endpoint retrieves a specific Order by ID.

HTTP Request

GET/wp-json/wpdm/v1/orders/:id

Update an Order

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/orders/5caa1c94aaf0f \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "order_status": "Completed",
     "payment_status": "Completed"
}'

The JSON response looks like the following example:

{
    "order_id": "5caa1c94aaf0f",
    "trans_id": "",
    "title": "WPDM Order# 5caa1c94aaf0f",
    "date": "April 7, 2019",
    "items": [
        3901
    ],
    "cart_data": {
        "3901": {
            "quantity": 1,
            "variation": [],
            "price": "10.00",
            "files": [],
            "license": {
                "id": "",
                "info": ""
            },
            "ID": 3901,
            "post_title": "Premium Package ( WPPM Free Trial Item )",
            "prices": 0,
            "variations": [],
            "discount_amount": 0
        }
    },
    "total": "10",
    "order_status": "Completed",
    "payment_status": "Completed",
    "uid": "1",
    "order_notes": "",
    "payment_method": "TestPay",
    "tax": "0",
    "cart_discount": "0",
    "discount": "0",
    "coupon_discount": "0",
    "currency": {
        "sign": "$",
        "code": "USD"
    },
    "download": "0",
    "IP": "::1",
    "ipn": "",
    "unit_prices": "",
    "billing_info": {
        "first_name": "Shahriar",
        "last_name": "Alam",
        "company": "W3 Eden",
        "country": "BD",
        "state": "A",
        "address_1": "Chittagong",
        "address_2": "Chnadgaon",
        "city": "Chittagong",
        "postcode": "4212",
        "phone": "+8801720000000",
        "order_email": "shahriar@wpdm.com"
    },
    "expire_date": "April 6, 2020",
    "auto_renew": "0",
    "coupon_code": "",
    "subtotal": "10"
}

This endpoint updates a specific Order by ID.

HTTP Request

PUT/wp-json/wpdm/v1/orders/:id

Delete an Order

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/orders/5c9f89523c467 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "order_id": "5c9f89523c467",
    "trans_id": "",
    "title": "WPDM Order# 5c9f89523c467",
    "date": "March 30, 2019",
    "items": [
        3901,
        5649
    ],
    "cart_data": {
        "3901": {
            "quantity": "1",
            "variation": [],
            "price": "59.00",
            "files": [],
            "license": {
                "id": "statdard",
                "info": {
                    "name": "Standard",
                    "description": "",
                    "use": "1"
                }
            },
            "ID": 3901,
            "post_title": "WordPress Download Manager Pro",
            "prices": 0,
            "variations": [],
            "discount_amount": 0
        },
        "5649": {
            "quantity": "1",
            "variation": [],
            "price": "49.00",
            "files": [],
            "license": {
                "id": "",
                "info": ""
            },
            "ID": 5649,
            "post_title": "WPDM MailChimp",
            "prices": 0,
            "variations": [],
            "discount_amount": 0
        }
    },
    "total": "54",
    "order_status": "Completed",
    "payment_status": "Completed",
    "uid": "1",
    "order_notes": {
        "messages": {
            "1": {
                "note": "Please send me the documentation link.",
                "by": "Customer"
            },
            "2": {
                "note": "Here is the doc https://www.wpdownloadmanager.com/docsfor/download-manager-pro/",
                "by": "Admin"
            }
        }
    },
    "payment_method": "TestPay",
    "tax": "0",
    "cart_discount": "0",
    "discount": "0",
    "coupon_discount": "54",
    "currency": {
        "sign": "$",
        "code": "USD"
    },
    "download": "1",
    "IP": "127.0.0.1",
    "ipn": "",
    "unit_prices": "",
    "billing_info": {
        "first_name": "Shahriar",
        "last_name": "Alam",
        "company": "W3 Eden",
        "country": "BD",
        "state": "A",
        "address_1": "Chittagong",
        "address_2": "Chnadgaon",
        "city": "Chittagong",
        "postcode": "4212",
        "phone": "+8801711111111",
        "order_email": "shahriar@wpdm.com"
    },
    "expire_date": "March 29, 2020",
    "auto_renew": "0",
    "coupon_code": "50off",
    "subtotal": "108"
}

This endpoint deletes a specific Order by ID.

HTTP Request

DELETE/wp-json/wpdm/v1/orders/:id

Coupons

The coupons API endpoint allows you to create, view, update, and delete coupons.

Coupon Properties

Attribute Type Description
ID integer Coupon id, the unique identifier for the resource.
code string The coupon code.
description string The coupon description.
type string Coupon type. Options are percent and fixed
discount string The discount amount.
min_order_amount string The required min order amount for this coupon.
max_order_amount string The limit of maximun order total for this coupon.
product string Associated product id. If set to 0 the coupon is global, applicable to any product.
allowed_emails string Limit the coupon only to specified email addresses.
expire_date date Coupon expiration date. After this date the coupon will be invalid.
usage_limit integer Maximum usage of the copuon.
used integer The number of times this coupon has been used.

Get All Coupons

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/coupons \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "items_per_page": 10,
    "type": "percent"
}'

The JSON response looks like the following example:

[
    {
        "ID": "9",
        "code": "wc2019",
        "description": "Happy New Year!",
        "type": "percent",
        "discount": "19",
        "min_order_amount": "10",
        "max_order_amount": "0",
        "product": "0",
        "allowed_emails": "",
        "expire_date": "May 12, 2019",
        "usage_limit": "50",
        "used": "5"
    },
    {
        "ID": "6",
        "code": "50off",
        "description": "USD $50 discount!",
        "type": "fixed",
        "discount": "50",
        "min_order_amount": "0",
        "max_order_amount": "0",
        "product": "0",
        "allowed_emails": "",
        "expire_date": "December 12, 2019",
        "usage_limit": "0",
        "used": "7"
    }
]

This endpoint retrieves all Coupons. Use query parameters to filter result.

HTTP Request

GET/wp-json/wpdm/v1/coupons

Query Parameters

Parameter Default Description
items_per_page 10 Number of coupons to retrive.
page 0 The page number.
product empty Filter coupons of a specific product.
type empty Filter coupons by copuon type. Options are percent and fixed

Create a Coupon

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/coupons \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "code": "wc2019",
     "description": "Happy New Year 2019! Grab the offer!",
     "type": "percent",
     "discount": "19",
     "min_order_amount": "10",
     "max_order_amount": "0",
     "product": "0",
     "allowed_emails": "lazy@one.com",
     "expire_date": "October 12, 2019",
     "usage_limit": "5",
     "used": "0"
}'

The JSON response looks like the following example:

{
    "ID": "5",
    "code": "wc2019",
    "description": "Happy New Year 2019! Grab the offer!",
    "type": "percent",
    "discount": "19",
    "min_order_amount": "10",
    "max_order_amount": "0",
    "product": "0",
    "allowed_emails": "lazy@one.com",
    "expire_date": "October 12, 2019",
    "usage_limit": "5",
    "used": "0"
}

This endpoint creates a new Coupon and sets Coupon properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/coupons

Get a Coupon

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/coupons/5 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "ID": "5",
    "code": "wc2019",
    "description": "Happy New Year 2019! Grab the offer!",
    "type": "percent",
    "discount": "19",
    "min_order_amount": "10",
    "max_order_amount": "0",
    "product": "0",
    "allowed_emails": "lazy@one.com",
    "expire_date": "October 12, 2019",
    "usage_limit": "5",
    "used": "0"
}

This endpoint retrieves a specific Coupon by ID.

HTTP Request

GET/wp-json/wpdm/v1/coupons/:id

Update a Coupon

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/coupons/5 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "code": "wc2019",
     "description": "Happy New Year 2019! Grab the offer!",
     "type": "percent",
     "discount": "19",
     "min_order_amount": "10",
     "max_order_amount": "0",
     "product": "0",
     "allowed_emails": "lazy@one.com",
     "expire_date": "October 12, 2019",
     "usage_limit": "5",
     "used": "0"
}'

The JSON response looks like the following example:

{
    "ID": "5",
    "code": "wc2019",
    "description": "Happy New Year 2019! Grab the offer!",
    "type": "percent",
    "discount": "19",
    "min_order_amount": "10",
    "max_order_amount": "0",
    "product": "0",
    "allowed_emails": "lazy@one.com",
    "expire_date": "October 12, 2019",
    "usage_limit": "5",
    "used": "0"
}

This endpoint updates a specific Coupon by ID.

HTTP Request

PUT/wp-json/wpdm/v1/coupons/:id

Delete a Coupon

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/coupons/5 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "ID": "5",
    "code": "wc2019",
    "description": "Happy New Year 2019! Grab the offer!",
    "type": "percent",
    "discount": "19",
    "min_order_amount": "10",
    "max_order_amount": "0",
    "product": "0",
    "allowed_emails": "lazy@one.com",
    "expire_date": "October 12, 2019",
    "usage_limit": "5",
    "used": "0"
}

This endpoint deletes a specific Coupon by ID.

HTTP Request

DELETE/wp-json/wpdm/v1/coupons/:id

Licenses

The licenses API endpoint allows you to create, view, update, and delete licenses.

License Properties

Attribute Type Description
id integer License id, the unique identifier for the resource.
domain array Array of domains where the license key has been applied.
licenseno string The license key.
status string Is the license INVALID or VALID.
oid string The order id associated with this license key.
pid string The package id associated with this license key.
activation_date date License activation date.
expire_date date License expire date.
domain_limit integer Maximum number of domains this license can be linked to.

Get All Licenses

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/licenses \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
    "items_per_page": 10,
    "pid": 34
}'

The JSON response looks like the following example:

[
    {
        "id": "13",
        "domain": [
            "wpfanatic.com",
            "profiles.io"
        ],
        "licenseno": "02813-16550-26999-54314",
        "status": "1",
        "oid": "5a682a4e1e492",
        "pid": "804",
        "activation_date": "May 1, 2019",
        "expire_date": "May 1, 2020",
        "domain_limit": "10"
    },
    {
        "id": "9",
        "domain": [
            "wpdm.info"
        ],
        "licenseno": "02813-16550-26999-54314",
        "status": "1",
        "oid": "5a682a4e1e494",
        "pid": "804",
        "activation_date": "April 1, 2019",
        "expire_date": "April 30, 2019",
        "domain_limit": "5"
    }    
]

This endpoint retrieves all Licenses. Use query parameters to filter result.

HTTP Request

GET/wp-json/wpdm/v1/licenses

Query Parameters

Parameter Default Description
items_per_page 10 Number of licenses to retrive.
page 0 The page number.
pid empty Retrieve licenses of a specific package.
licenseno empty Get the license details using the key.
oid empty Get license key assciated with an order id.

Create a License

curl -X POST \
  https://yorusite.com/wp-json/wpdm/v1/licenses \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "domain": [
         "wpdownloadmanager.com",
         "example.io"
     ],
     "licenseno": "02813-16550-26999-54314",
     "status": "1",
     "oid": "5a682a4e1e494",
     "pid": "804",
     "activation_date": "April 1, 2019",
     "expire_date": "April 1, 2020",
     "expire_period": "0",
     "domain_limit": "5"
}'

The JSON response looks like the following example:

{
    "id": "9",
    "domain": [
        "wpdownloadmanager.com",
        "example.io"
    ],
    "licenseno": "02813-16550-26999-54314",
    "status": "1",
    "oid": "5a682a4e1e494",
    "pid": "804",
    "activation_date": "April 1, 2019",
    "expire_date": "April 1, 2020",
    "expire_period": "0",
    "domain_limit": "5"
}

This endpoint creates a new License and sets License properties based on POST data.

HTTP Request

POST/wp-json/wpdm/v1/licenses

Get a License

curl -X GET \
  https://yorusite.com/wp-json/wpdm/v1/licenses/9 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "id": "9",
    "domain": [
        "wpdownloadmanager.com",
        "example.io"
    ],
    "licenseno": "02813-16550-26999-54314",
    "status": "1",
    "oid": "5a682a4e1e494",
    "pid": "804",
    "activation_date": "April 1, 2019",
    "expire_date": "April 1, 2020",
    "expire_period": "0",
    "domain_limit": "5"
}

This endpoint retrieves a specific License by ID.

HTTP Request

GET/wp-json/wpdm/v1/licenses/:id

Update a License

curl -X PUT \
  https://yorusite.com/wp-json/wpdm/v1/licenses/9 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json' \
  -d '{
     "domain": [
         "wpdownloadmanager.com",
         "example.io"
     ],
     "licenseno": "02813-16550-26999-54314",
     "status": "1",
     "oid": "5a682a4e1e494",
     "pid": "804",
     "activation_date": "April 1, 2019",
     "expire_date": "April 1, 2020",
     "expire_period": "0",
     "domain_limit": "5"
}'

The JSON response looks like the following example:

{
    "id": "9",
    "domain": [
        "wpdownloadmanager.com",
        "example.io"
    ],
    "licenseno": "02813-16550-26999-54314",
    "status": "1",
    "oid": "5a682a4e1e494",
    "pid": "804",
    "activation_date": "April 1, 2019",
    "expire_date": "April 1, 2020",
    "expire_period": "0",
    "domain_limit": "5"
}

This endpoint updates a specific License by ID.

HTTP Request

PUT/wp-json/wpdm/v1/licenses/:id

Delete a License

curl -X DELETE \
  https://yorusite.com/wp-json/wpdm/v1/licenses/9 \
  -H 'Authorization: Bearer 613efe9acb0d5c2b' \
  -H 'Content-Type: application/json'

The JSON response looks like the following example:

{
    "id": "9",
    "domain": [
        "wpdownloadmanager.com",
        "example.io"
    ],
    "licenseno": "02813-16550-26999-54314",
    "status": "1",
    "oid": "5a682a4e1e494",
    "pid": "804",
    "activation_date": "April 1, 2019",
    "expire_date": "April 1, 2020",
    "expire_period": "0",
    "domain_limit": "5"
}

This endpoint deletes a specific License by ID.

HTTP Request

DELETE/wp-json/wpdm/v1/licenses/:id

Errors

The WordPress Download Manager REST API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid. YOu SHOULD NOT repeat the request without modifications.
401 Unauthorized -- Your API key/Username/Password is wrong.
403 Forbidden -- The resource requested is hidden for administrators only.
404 Not Found -- The specified resource could not be found.
429 Too Many Requests -- You're requesting too many resources! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.