Payment Links
Update payment link
Developer API operation for PATCH /dev/v1/payment-links/.
PATCH
/
dev
/
v1
/
payment-links
/
{id}
Update payment link
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/payment-links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated sale",
"type": "FIXED_PRICE",
"status": false,
"price": "29.99",
"currency": "USD",
"gateways": "stripe",
"products_ids": "",
"discount_code_allowed": false,
"customer_address_required": false,
"customer_phone_required": false,
"show_confirmation_page": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated sale',
type: 'FIXED_PRICE',
status: false,
price: '29.99',
currency: 'USD',
gateways: 'stripe',
products_ids: '',
discount_code_allowed: false,
customer_address_required: false,
customer_phone_required: false,
show_confirmation_page: true
})
};
fetch('https://api.shoppex.io/dev/v1/payment-links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/payment-links/{id}"
payload = {
"name": "Updated sale",
"type": "FIXED_PRICE",
"status": False,
"price": "29.99",
"currency": "USD",
"gateways": "stripe",
"products_ids": "",
"discount_code_allowed": False,
"customer_address_required": False,
"customer_phone_required": False,
"show_confirmation_page": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/payment-links/{id}",
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([
'name' => 'Updated sale',
'type' => 'FIXED_PRICE',
'status' => false,
'price' => '29.99',
'currency' => 'USD',
'gateways' => 'stripe',
'products_ids' => '',
'discount_code_allowed' => false,
'customer_address_required' => false,
'customer_phone_required' => false,
'show_confirmation_page' => true
]),
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.shoppex.io/dev/v1/payment-links/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated sale\",\n \"type\": \"FIXED_PRICE\",\n \"status\": false,\n \"price\": \"29.99\",\n \"currency\": \"USD\",\n \"gateways\": \"stripe\",\n \"products_ids\": \"\",\n \"discount_code_allowed\": false,\n \"customer_address_required\": false,\n \"customer_phone_required\": false,\n \"show_confirmation_page\": true\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))
}{
"data": {
"payment_link": {
"uniqid": "plink_1",
"name": "Updated sale",
"is_active": false,
"show_confirmation_page": true,
"url": "https://checkout.shoppex.io/pay/plink_1"
}
}
}⌘I
Update payment link
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/payment-links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated sale",
"type": "FIXED_PRICE",
"status": false,
"price": "29.99",
"currency": "USD",
"gateways": "stripe",
"products_ids": "",
"discount_code_allowed": false,
"customer_address_required": false,
"customer_phone_required": false,
"show_confirmation_page": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated sale',
type: 'FIXED_PRICE',
status: false,
price: '29.99',
currency: 'USD',
gateways: 'stripe',
products_ids: '',
discount_code_allowed: false,
customer_address_required: false,
customer_phone_required: false,
show_confirmation_page: true
})
};
fetch('https://api.shoppex.io/dev/v1/payment-links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/payment-links/{id}"
payload = {
"name": "Updated sale",
"type": "FIXED_PRICE",
"status": False,
"price": "29.99",
"currency": "USD",
"gateways": "stripe",
"products_ids": "",
"discount_code_allowed": False,
"customer_address_required": False,
"customer_phone_required": False,
"show_confirmation_page": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/payment-links/{id}",
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([
'name' => 'Updated sale',
'type' => 'FIXED_PRICE',
'status' => false,
'price' => '29.99',
'currency' => 'USD',
'gateways' => 'stripe',
'products_ids' => '',
'discount_code_allowed' => false,
'customer_address_required' => false,
'customer_phone_required' => false,
'show_confirmation_page' => true
]),
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.shoppex.io/dev/v1/payment-links/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated sale\",\n \"type\": \"FIXED_PRICE\",\n \"status\": false,\n \"price\": \"29.99\",\n \"currency\": \"USD\",\n \"gateways\": \"stripe\",\n \"products_ids\": \"\",\n \"discount_code_allowed\": false,\n \"customer_address_required\": false,\n \"customer_phone_required\": false,\n \"show_confirmation_page\": true\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))
}{
"data": {
"payment_link": {
"uniqid": "plink_1",
"name": "Updated sale",
"is_active": false,
"show_confirmation_page": true,
"url": "https://checkout.shoppex.io/pay/plink_1"
}
}
}