Update shop coupon
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10,
"applyAutomatically": true,
"applyOn": "products",
"code": "APRILEASTEREGGS",
"code_type": "percentage",
"created": "2022-01-14T23:00:00.000Z",
"description": "Easter coupons for your lovely use",
"expires": "2022-12-19T22:59:59.999Z",
"isActive": true,
"isPublic": false,
"mediaType": "VIDEO",
"min_order": 3500,
"starts": "2022-01-14T23:00:00.000Z",
"uuid": "aa84053e-8de5-4ffb-a9c8-f53202e2fb27"
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c"
payload = {
"amount": 10,
"applyAutomatically": True,
"applyOn": "products",
"code": "APRILEASTEREGGS",
"code_type": "percentage",
"created": "2022-01-14T23:00:00.000Z",
"description": "Easter coupons for your lovely use",
"expires": "2022-12-19T22:59:59.999Z",
"isActive": True,
"isPublic": False,
"mediaType": "VIDEO",
"min_order": 3500,
"starts": "2022-01-14T23:00:00.000Z",
"uuid": "aa84053e-8de5-4ffb-a9c8-f53202e2fb27"
}
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({
amount: 10,
applyAutomatically: true,
applyOn: 'products',
code: 'APRILEASTEREGGS',
code_type: 'percentage',
created: '2022-01-14T23:00:00.000Z',
description: 'Easter coupons for your lovely use',
expires: '2022-12-19T22:59:59.999Z',
isActive: true,
isPublic: false,
mediaType: 'VIDEO',
min_order: 3500,
starts: '2022-01-14T23:00:00.000Z',
uuid: 'aa84053e-8de5-4ffb-a9c8-f53202e2fb27'
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c', 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/{shopId}/coupons/627e1b7d514f2d760748f68c",
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([
'amount' => 10,
'applyAutomatically' => true,
'applyOn' => 'products',
'code' => 'APRILEASTEREGGS',
'code_type' => 'percentage',
'created' => '2022-01-14T23:00:00.000Z',
'description' => 'Easter coupons for your lovely use',
'expires' => '2022-12-19T22:59:59.999Z',
'isActive' => true,
'isPublic' => false,
'mediaType' => 'VIDEO',
'min_order' => 3500,
'starts' => '2022-01-14T23:00:00.000Z',
'uuid' => 'aa84053e-8de5-4ffb-a9c8-f53202e2fb27'
]),
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/{shopId}/coupons/627e1b7d514f2d760748f68c"
payload := strings.NewReader("{\n \"amount\": 10,\n \"applyAutomatically\": true,\n \"applyOn\": \"products\",\n \"code\": \"APRILEASTEREGGS\",\n \"code_type\": \"percentage\",\n \"created\": \"2022-01-14T23:00:00.000Z\",\n \"description\": \"Easter coupons for your lovely use\",\n \"expires\": \"2022-12-19T22:59:59.999Z\",\n \"isActive\": true,\n \"isPublic\": false,\n \"mediaType\": \"VIDEO\",\n \"min_order\": 3500,\n \"starts\": \"2022-01-14T23:00:00.000Z\",\n \"uuid\": \"aa84053e-8de5-4ffb-a9c8-f53202e2fb27\"\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/{shopId}/coupons/627e1b7d514f2d760748f68c")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"applyAutomatically\": true,\n \"applyOn\": \"products\",\n \"code\": \"APRILEASTEREGGS\",\n \"code_type\": \"percentage\",\n \"created\": \"2022-01-14T23:00:00.000Z\",\n \"description\": \"Easter coupons for your lovely use\",\n \"expires\": \"2022-12-19T22:59:59.999Z\",\n \"isActive\": true,\n \"isPublic\": false,\n \"mediaType\": \"VIDEO\",\n \"min_order\": 3500,\n \"starts\": \"2022-01-14T23:00:00.000Z\",\n \"uuid\": \"aa84053e-8de5-4ffb-a9c8-f53202e2fb27\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"applyAutomatically\": true,\n \"applyOn\": \"products\",\n \"code\": \"APRILEASTEREGGS\",\n \"code_type\": \"percentage\",\n \"created\": \"2022-01-14T23:00:00.000Z\",\n \"description\": \"Easter coupons for your lovely use\",\n \"expires\": \"2022-12-19T22:59:59.999Z\",\n \"isActive\": true,\n \"isPublic\": false,\n \"mediaType\": \"VIDEO\",\n \"min_order\": 3500,\n \"starts\": \"2022-01-14T23:00:00.000Z\",\n \"uuid\": \"aa84053e-8de5-4ffb-a9c8-f53202e2fb27\"\n}"
response = http.request(request)
puts response.read_bodyCoupons
Update shop coupon
PATCH
/
{shopId}
/
coupons
/
627e1b7d514f2d760748f68c
Update shop coupon
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10,
"applyAutomatically": true,
"applyOn": "products",
"code": "APRILEASTEREGGS",
"code_type": "percentage",
"created": "2022-01-14T23:00:00.000Z",
"description": "Easter coupons for your lovely use",
"expires": "2022-12-19T22:59:59.999Z",
"isActive": true,
"isPublic": false,
"mediaType": "VIDEO",
"min_order": 3500,
"starts": "2022-01-14T23:00:00.000Z",
"uuid": "aa84053e-8de5-4ffb-a9c8-f53202e2fb27"
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c"
payload = {
"amount": 10,
"applyAutomatically": True,
"applyOn": "products",
"code": "APRILEASTEREGGS",
"code_type": "percentage",
"created": "2022-01-14T23:00:00.000Z",
"description": "Easter coupons for your lovely use",
"expires": "2022-12-19T22:59:59.999Z",
"isActive": True,
"isPublic": False,
"mediaType": "VIDEO",
"min_order": 3500,
"starts": "2022-01-14T23:00:00.000Z",
"uuid": "aa84053e-8de5-4ffb-a9c8-f53202e2fb27"
}
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({
amount: 10,
applyAutomatically: true,
applyOn: 'products',
code: 'APRILEASTEREGGS',
code_type: 'percentage',
created: '2022-01-14T23:00:00.000Z',
description: 'Easter coupons for your lovely use',
expires: '2022-12-19T22:59:59.999Z',
isActive: true,
isPublic: false,
mediaType: 'VIDEO',
min_order: 3500,
starts: '2022-01-14T23:00:00.000Z',
uuid: 'aa84053e-8de5-4ffb-a9c8-f53202e2fb27'
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c', 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/{shopId}/coupons/627e1b7d514f2d760748f68c",
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([
'amount' => 10,
'applyAutomatically' => true,
'applyOn' => 'products',
'code' => 'APRILEASTEREGGS',
'code_type' => 'percentage',
'created' => '2022-01-14T23:00:00.000Z',
'description' => 'Easter coupons for your lovely use',
'expires' => '2022-12-19T22:59:59.999Z',
'isActive' => true,
'isPublic' => false,
'mediaType' => 'VIDEO',
'min_order' => 3500,
'starts' => '2022-01-14T23:00:00.000Z',
'uuid' => 'aa84053e-8de5-4ffb-a9c8-f53202e2fb27'
]),
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/{shopId}/coupons/627e1b7d514f2d760748f68c"
payload := strings.NewReader("{\n \"amount\": 10,\n \"applyAutomatically\": true,\n \"applyOn\": \"products\",\n \"code\": \"APRILEASTEREGGS\",\n \"code_type\": \"percentage\",\n \"created\": \"2022-01-14T23:00:00.000Z\",\n \"description\": \"Easter coupons for your lovely use\",\n \"expires\": \"2022-12-19T22:59:59.999Z\",\n \"isActive\": true,\n \"isPublic\": false,\n \"mediaType\": \"VIDEO\",\n \"min_order\": 3500,\n \"starts\": \"2022-01-14T23:00:00.000Z\",\n \"uuid\": \"aa84053e-8de5-4ffb-a9c8-f53202e2fb27\"\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/{shopId}/coupons/627e1b7d514f2d760748f68c")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"applyAutomatically\": true,\n \"applyOn\": \"products\",\n \"code\": \"APRILEASTEREGGS\",\n \"code_type\": \"percentage\",\n \"created\": \"2022-01-14T23:00:00.000Z\",\n \"description\": \"Easter coupons for your lovely use\",\n \"expires\": \"2022-12-19T22:59:59.999Z\",\n \"isActive\": true,\n \"isPublic\": false,\n \"mediaType\": \"VIDEO\",\n \"min_order\": 3500,\n \"starts\": \"2022-01-14T23:00:00.000Z\",\n \"uuid\": \"aa84053e-8de5-4ffb-a9c8-f53202e2fb27\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/coupons/627e1b7d514f2d760748f68c")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"applyAutomatically\": true,\n \"applyOn\": \"products\",\n \"code\": \"APRILEASTEREGGS\",\n \"code_type\": \"percentage\",\n \"created\": \"2022-01-14T23:00:00.000Z\",\n \"description\": \"Easter coupons for your lovely use\",\n \"expires\": \"2022-12-19T22:59:59.999Z\",\n \"isActive\": true,\n \"isPublic\": false,\n \"mediaType\": \"VIDEO\",\n \"min_order\": 3500,\n \"starts\": \"2022-01-14T23:00:00.000Z\",\n \"uuid\": \"aa84053e-8de5-4ffb-a9c8-f53202e2fb27\"\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Example:
10
Example:
true
Example:
"products"
Example:
"APRILEASTEREGGS"
Example:
"percentage"
Example:
"2022-01-14T23:00:00.000Z"
Example:
"Easter coupons for your lovely use"
Example:
"2022-12-19T22:59:59.999Z"
Example:
true
Example:
false
Example:
"VIDEO"
Example:
3500
Example:
"2022-01-14T23:00:00.000Z"
Example:
"aa84053e-8de5-4ffb-a9c8-f53202e2fb27"
Response
200 - undefined
Was this page helpful?
⌘I