Update Policy
curl --request PATCH \
--url https://api.launchmystore.io/policies/update-policies/{policyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policyType": "<string>",
"policyContent": "<string>"
}
'import requests
url = "https://api.launchmystore.io/policies/update-policies/{policyId}"
payload = {
"policyType": "<string>",
"policyContent": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({policyType: '<string>', policyContent: '<string>'})
};
fetch('https://api.launchmystore.io/policies/update-policies/{policyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/policies/update-policies/{policyId}",
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([
'policyType' => '<string>',
'policyContent' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.launchmystore.io/policies/update-policies/{policyId}"
payload := strings.NewReader("{\n \"policyType\": \"<string>\",\n \"policyContent\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://api.launchmystore.io/policies/update-policies/{policyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policyType\": \"<string>\",\n \"policyContent\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/policies/update-policies/{policyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyType\": \"<string>\",\n \"policyContent\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"state": "success",
"message": "Policy updated successfully",
"data": {
"policyId": "b2f7c1a4-9d3e-4a2b-8f10-6c5e9d7a1b34",
"policyType": "Refund Policy",
"policyContent": "<p>Updated refund policy content...</p>",
"storeId": "f73049dc-b4d4-4f85-99c2-681a5e351a8a",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-25T10:00:00.000Z"
},
"count": null,
"pagination": null
}
Policies
Update Policy
Update a store policy
PATCH
/
policies
/
update-policies
/
{policyId}
Update Policy
curl --request PATCH \
--url https://api.launchmystore.io/policies/update-policies/{policyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policyType": "<string>",
"policyContent": "<string>"
}
'import requests
url = "https://api.launchmystore.io/policies/update-policies/{policyId}"
payload = {
"policyType": "<string>",
"policyContent": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({policyType: '<string>', policyContent: '<string>'})
};
fetch('https://api.launchmystore.io/policies/update-policies/{policyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/policies/update-policies/{policyId}",
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([
'policyType' => '<string>',
'policyContent' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.launchmystore.io/policies/update-policies/{policyId}"
payload := strings.NewReader("{\n \"policyType\": \"<string>\",\n \"policyContent\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://api.launchmystore.io/policies/update-policies/{policyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policyType\": \"<string>\",\n \"policyContent\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/policies/update-policies/{policyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyType\": \"<string>\",\n \"policyContent\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"state": "success",
"message": "Policy updated successfully",
"data": {
"policyId": "b2f7c1a4-9d3e-4a2b-8f10-6c5e9d7a1b34",
"policyType": "Refund Policy",
"policyContent": "<p>Updated refund policy content...</p>",
"storeId": "f73049dc-b4d4-4f85-99c2-681a5e351a8a",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-25T10:00:00.000Z"
},
"count": null,
"pagination": null
}
This endpoint is part of the merchant API and is authenticated with a
merchant access token (not an app OAuth token). The policy to update is
identified by its
If no policy matches the given
policyId.
Path Parameters
The unique ID of the policy to update
Body Parameters
Both fields are optional; send only the ones you want to change.Policy type label (free-form text, e.g.
Refund Policy,
Privacy Policy, Terms and Conditions)Policy content (HTML)
Response
On success the endpoint returns the standard response envelope with the updated policy indata.
{
"status": 200,
"state": "success",
"message": "Policy updated successfully",
"data": {
"policyId": "b2f7c1a4-9d3e-4a2b-8f10-6c5e9d7a1b34",
"policyType": "Refund Policy",
"policyContent": "<p>Updated refund policy content...</p>",
"storeId": "f73049dc-b4d4-4f85-99c2-681a5e351a8a",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-25T10:00:00.000Z"
},
"count": null,
"pagination": null
}
policyId, the endpoint returns:
{
"status": 404,
"state": "info",
"message": "Policy not found.",
"data": null
}
⌘I