Payment Links
Update a Payment Link
Updates the information of a payment link by defining the values for the passed parameters. Any parameters not supplied will remain unaltered.
POST
/
payment-links
/
{id}
Update a Payment Link
curl --request POST \
--url https://pay.chargily.net/test/api/v2/payment-links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"items": [
{
"price": "<string>",
"quantity": 123,
"adjustable_quantity": true
}
],
"after_completion_message": "<string>",
"locale": "<string>",
"pass_fees_to_customer": true,
"collect_shipping_address": true,
"metadata": {}
}
'import requests
url = "https://pay.chargily.net/test/api/v2/payment-links/{id}"
payload = {
"name": "<string>",
"items": [
{
"price": "<string>",
"quantity": 123,
"adjustable_quantity": True
}
],
"after_completion_message": "<string>",
"locale": "<string>",
"pass_fees_to_customer": True,
"collect_shipping_address": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
items: [{price: '<string>', quantity: 123, adjustable_quantity: true}],
after_completion_message: '<string>',
locale: '<string>',
pass_fees_to_customer: true,
collect_shipping_address: true,
metadata: {}
})
};
fetch('https://pay.chargily.net/test/api/v2/payment-links/{id}', 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://pay.chargily.net/test/api/v2/payment-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'items' => [
[
'price' => '<string>',
'quantity' => 123,
'adjustable_quantity' => true
]
],
'after_completion_message' => '<string>',
'locale' => '<string>',
'pass_fees_to_customer' => true,
'collect_shipping_address' => true,
'metadata' => [
]
]),
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://pay.chargily.net/test/api/v2/payment-links/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"price\": \"<string>\",\n \"quantity\": 123,\n \"adjustable_quantity\": true\n }\n ],\n \"after_completion_message\": \"<string>\",\n \"locale\": \"<string>\",\n \"pass_fees_to_customer\": true,\n \"collect_shipping_address\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://pay.chargily.net/test/api/v2/payment-links/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"price\": \"<string>\",\n \"quantity\": 123,\n \"adjustable_quantity\": true\n }\n ],\n \"after_completion_message\": \"<string>\",\n \"locale\": \"<string>\",\n \"pass_fees_to_customer\": true,\n \"collect_shipping_address\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay.chargily.net/test/api/v2/payment-links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"price\": \"<string>\",\n \"quantity\": 123,\n \"adjustable_quantity\": true\n }\n ],\n \"after_completion_message\": \"<string>\",\n \"locale\": \"<string>\",\n \"pass_fees_to_customer\": true,\n \"collect_shipping_address\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "01hhhtvg4w7gk4mcaxmgzb2ynw",
"entity": "payment_link",
"livemode": false,
"name": "Payment Link for Facebook page.",
"active": 1,
"after_completion_message": "The product will arrive in 03 days.",
"locale": "ar",
"pass_fees_to_customer": false,
"metadata": [],
"created_at": 1702479380,
"updated_at": 1702479380,
"collect_shipping_address": 0,
"url": "https://pay.chargily.dz/test/payment-links/01hhhtvg4w7gk4mcaxmgzb2ynw"
}
Path parameters
The ID of the payment link.
Body parameters
A String representing the name of the payment link, it will not be shown to
customers, it helps you to organize payment links.
A message which will be displayed to the customer after a successful payment.
The language of the checkout page, accepted values are: ‘ar’, ‘en’ or ‘fr’.
A Boolean value indicating whether the Chargily Pay fees will be paid by you,
the merchant, or by your customers.
A Boolean value indicates whether the shipping address should be collected
from the customer.
A Set of key-value pairs that can be used to store additional information
about the payment link.
Returns
If the update is successful, it returns a payment link object with the updated information.{
"id": "01hhhtvg4w7gk4mcaxmgzb2ynw",
"entity": "payment_link",
"livemode": false,
"name": "Payment Link for Facebook page.",
"active": 1,
"after_completion_message": "The product will arrive in 03 days.",
"locale": "ar",
"pass_fees_to_customer": false,
"metadata": [],
"created_at": 1702479380,
"updated_at": 1702479380,
"collect_shipping_address": 0,
"url": "https://pay.chargily.dz/test/payment-links/01hhhtvg4w7gk4mcaxmgzb2ynw"
}
Previous
Retrieve a payment linkRetrieves all the information of an already-existing payment link by providing it's unique identifier (ID).
Next
⌘I
Update a Payment Link
curl --request POST \
--url https://pay.chargily.net/test/api/v2/payment-links/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"items": [
{
"price": "<string>",
"quantity": 123,
"adjustable_quantity": true
}
],
"after_completion_message": "<string>",
"locale": "<string>",
"pass_fees_to_customer": true,
"collect_shipping_address": true,
"metadata": {}
}
'import requests
url = "https://pay.chargily.net/test/api/v2/payment-links/{id}"
payload = {
"name": "<string>",
"items": [
{
"price": "<string>",
"quantity": 123,
"adjustable_quantity": True
}
],
"after_completion_message": "<string>",
"locale": "<string>",
"pass_fees_to_customer": True,
"collect_shipping_address": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
items: [{price: '<string>', quantity: 123, adjustable_quantity: true}],
after_completion_message: '<string>',
locale: '<string>',
pass_fees_to_customer: true,
collect_shipping_address: true,
metadata: {}
})
};
fetch('https://pay.chargily.net/test/api/v2/payment-links/{id}', 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://pay.chargily.net/test/api/v2/payment-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'items' => [
[
'price' => '<string>',
'quantity' => 123,
'adjustable_quantity' => true
]
],
'after_completion_message' => '<string>',
'locale' => '<string>',
'pass_fees_to_customer' => true,
'collect_shipping_address' => true,
'metadata' => [
]
]),
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://pay.chargily.net/test/api/v2/payment-links/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"price\": \"<string>\",\n \"quantity\": 123,\n \"adjustable_quantity\": true\n }\n ],\n \"after_completion_message\": \"<string>\",\n \"locale\": \"<string>\",\n \"pass_fees_to_customer\": true,\n \"collect_shipping_address\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://pay.chargily.net/test/api/v2/payment-links/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"price\": \"<string>\",\n \"quantity\": 123,\n \"adjustable_quantity\": true\n }\n ],\n \"after_completion_message\": \"<string>\",\n \"locale\": \"<string>\",\n \"pass_fees_to_customer\": true,\n \"collect_shipping_address\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay.chargily.net/test/api/v2/payment-links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"price\": \"<string>\",\n \"quantity\": 123,\n \"adjustable_quantity\": true\n }\n ],\n \"after_completion_message\": \"<string>\",\n \"locale\": \"<string>\",\n \"pass_fees_to_customer\": true,\n \"collect_shipping_address\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "01hhhtvg4w7gk4mcaxmgzb2ynw",
"entity": "payment_link",
"livemode": false,
"name": "Payment Link for Facebook page.",
"active": 1,
"after_completion_message": "The product will arrive in 03 days.",
"locale": "ar",
"pass_fees_to_customer": false,
"metadata": [],
"created_at": 1702479380,
"updated_at": 1702479380,
"collect_shipping_address": 0,
"url": "https://pay.chargily.dz/test/payment-links/01hhhtvg4w7gk4mcaxmgzb2ynw"
}