Update subscription plans
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5 \
--header 'Content-Type: application/json' \
--data '
{
"__v": 0,
"amount": 50,
"applyAutomatically": false,
"code": "50% DISCOUNT",
"created": "2022-08-10T23:02:01.737Z",
"description": "50 percent discount on subscriptions",
"expires": null,
"isActive": true,
"starts": "2022-08-10T00:00:00.000Z",
"type": "percentage",
"usableOn": "subscription",
"usageCount": 0
}
'import requests
url = "http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5"
payload = {
"__v": 0,
"amount": 50,
"applyAutomatically": False,
"code": "50% DISCOUNT",
"created": "2022-08-10T23:02:01.737Z",
"description": "50 percent discount on subscriptions",
"expires": None,
"isActive": True,
"starts": "2022-08-10T00:00:00.000Z",
"type": "percentage",
"usableOn": "subscription",
"usageCount": 0
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
__v: 0,
amount: 50,
applyAutomatically: false,
code: '50% DISCOUNT',
created: '2022-08-10T23:02:01.737Z',
description: '50 percent discount on subscriptions',
expires: null,
isActive: true,
starts: '2022-08-10T00:00:00.000Z',
type: 'percentage',
usableOn: 'subscription',
usageCount: 0
})
};
fetch('http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5', 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 => "http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'__v' => 0,
'amount' => 50,
'applyAutomatically' => false,
'code' => '50% DISCOUNT',
'created' => '2022-08-10T23:02:01.737Z',
'description' => '50 percent discount on subscriptions',
'expires' => null,
'isActive' => true,
'starts' => '2022-08-10T00:00:00.000Z',
'type' => 'percentage',
'usableOn' => 'subscription',
'usageCount' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5"
payload := strings.NewReader("{\n \"__v\": 0,\n \"amount\": 50,\n \"applyAutomatically\": false,\n \"code\": \"50% DISCOUNT\",\n \"created\": \"2022-08-10T23:02:01.737Z\",\n \"description\": \"50 percent discount on subscriptions\",\n \"expires\": null,\n \"isActive\": true,\n \"starts\": \"2022-08-10T00:00:00.000Z\",\n \"type\": \"percentage\",\n \"usableOn\": \"subscription\",\n \"usageCount\": 0\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5")
.header("Content-Type", "application/json")
.body("{\n \"__v\": 0,\n \"amount\": 50,\n \"applyAutomatically\": false,\n \"code\": \"50% DISCOUNT\",\n \"created\": \"2022-08-10T23:02:01.737Z\",\n \"description\": \"50 percent discount on subscriptions\",\n \"expires\": null,\n \"isActive\": true,\n \"starts\": \"2022-08-10T00:00:00.000Z\",\n \"type\": \"percentage\",\n \"usableOn\": \"subscription\",\n \"usageCount\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"__v\": 0,\n \"amount\": 50,\n \"applyAutomatically\": false,\n \"code\": \"50% DISCOUNT\",\n \"created\": \"2022-08-10T23:02:01.737Z\",\n \"description\": \"50 percent discount on subscriptions\",\n \"expires\": null,\n \"isActive\": true,\n \"starts\": \"2022-08-10T00:00:00.000Z\",\n \"type\": \"percentage\",\n \"usableOn\": \"subscription\",\n \"usageCount\": 0\n}"
response = http.request(request)
puts response.read_bodyQDiscounts
Update subscription plans
PATCH
/
62f438e98dbce15ea4dac7e5
Update subscription plans
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5 \
--header 'Content-Type: application/json' \
--data '
{
"__v": 0,
"amount": 50,
"applyAutomatically": false,
"code": "50% DISCOUNT",
"created": "2022-08-10T23:02:01.737Z",
"description": "50 percent discount on subscriptions",
"expires": null,
"isActive": true,
"starts": "2022-08-10T00:00:00.000Z",
"type": "percentage",
"usableOn": "subscription",
"usageCount": 0
}
'import requests
url = "http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5"
payload = {
"__v": 0,
"amount": 50,
"applyAutomatically": False,
"code": "50% DISCOUNT",
"created": "2022-08-10T23:02:01.737Z",
"description": "50 percent discount on subscriptions",
"expires": None,
"isActive": True,
"starts": "2022-08-10T00:00:00.000Z",
"type": "percentage",
"usableOn": "subscription",
"usageCount": 0
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
__v: 0,
amount: 50,
applyAutomatically: false,
code: '50% DISCOUNT',
created: '2022-08-10T23:02:01.737Z',
description: '50 percent discount on subscriptions',
expires: null,
isActive: true,
starts: '2022-08-10T00:00:00.000Z',
type: 'percentage',
usableOn: 'subscription',
usageCount: 0
})
};
fetch('http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5', 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 => "http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'__v' => 0,
'amount' => 50,
'applyAutomatically' => false,
'code' => '50% DISCOUNT',
'created' => '2022-08-10T23:02:01.737Z',
'description' => '50 percent discount on subscriptions',
'expires' => null,
'isActive' => true,
'starts' => '2022-08-10T00:00:00.000Z',
'type' => 'percentage',
'usableOn' => 'subscription',
'usageCount' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5"
payload := strings.NewReader("{\n \"__v\": 0,\n \"amount\": 50,\n \"applyAutomatically\": false,\n \"code\": \"50% DISCOUNT\",\n \"created\": \"2022-08-10T23:02:01.737Z\",\n \"description\": \"50 percent discount on subscriptions\",\n \"expires\": null,\n \"isActive\": true,\n \"starts\": \"2022-08-10T00:00:00.000Z\",\n \"type\": \"percentage\",\n \"usableOn\": \"subscription\",\n \"usageCount\": 0\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5")
.header("Content-Type", "application/json")
.body("{\n \"__v\": 0,\n \"amount\": 50,\n \"applyAutomatically\": false,\n \"code\": \"50% DISCOUNT\",\n \"created\": \"2022-08-10T23:02:01.737Z\",\n \"description\": \"50 percent discount on subscriptions\",\n \"expires\": null,\n \"isActive\": true,\n \"starts\": \"2022-08-10T00:00:00.000Z\",\n \"type\": \"percentage\",\n \"usableOn\": \"subscription\",\n \"usageCount\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/62f438e98dbce15ea4dac7e5")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"__v\": 0,\n \"amount\": 50,\n \"applyAutomatically\": false,\n \"code\": \"50% DISCOUNT\",\n \"created\": \"2022-08-10T23:02:01.737Z\",\n \"description\": \"50 percent discount on subscriptions\",\n \"expires\": null,\n \"isActive\": true,\n \"starts\": \"2022-08-10T00:00:00.000Z\",\n \"type\": \"percentage\",\n \"usableOn\": \"subscription\",\n \"usageCount\": 0\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Example:
0
Example:
50
Example:
false
Example:
"50% DISCOUNT"
Example:
"2022-08-10T23:02:01.737Z"
Example:
"50 percent discount on subscriptions"
Example:
true
Example:
"2022-08-10T00:00:00.000Z"
Example:
"percentage"
Example:
"subscription"
Example:
0
Response
200 - undefined
Was this page helpful?
⌘I