Update a payment link
curl --request PATCH \
--url https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"successUrl": "<string>"
}
'import requests
url = "https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}"
payload = {
"title": "<string>",
"description": "<string>",
"successUrl": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: '<string>', description: '<string>', successUrl: '<string>'})
};
fetch('https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}', 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://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}",
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([
'title' => '<string>',
'description' => '<string>',
'successUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"successUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"successUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"successUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"amount": 123,
"createdAt": "<string>",
"currency": "<string>",
"flexibleAmount": true,
"isActive": true,
"name": "<string>",
"paymentLinkUrl": "<string>",
"pricingId": "<string>",
"pricingType": "<string>",
"provider": "<string>",
"title": "<string>",
"description": "<string>",
"minAmount": 123,
"maxAmount": 123,
"successUrl": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}Merchant API endpoints
Update a payment link
Change a payment link’s title, description or success URL.
PATCH
/
v1
/
payment-links
/
{linkId}
Update a payment link
curl --request PATCH \
--url https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"successUrl": "<string>"
}
'import requests
url = "https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}"
payload = {
"title": "<string>",
"description": "<string>",
"successUrl": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: '<string>', description: '<string>', successUrl: '<string>'})
};
fetch('https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}', 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://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}",
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([
'title' => '<string>',
'description' => '<string>',
'successUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"successUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"successUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-api-prod.anyway.sh/v1/payment-links/{linkId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"successUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"amount": 123,
"createdAt": "<string>",
"currency": "<string>",
"flexibleAmount": true,
"isActive": true,
"name": "<string>",
"paymentLinkUrl": "<string>",
"pricingId": "<string>",
"pricingType": "<string>",
"provider": "<string>",
"title": "<string>",
"description": "<string>",
"minAmount": 123,
"maxAmount": 123,
"successUrl": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}Authenticate with an API key that belongs to the link’s organization and has Full access or the
products:payment_links:write permission (Payment links under Can create and change in the dashboard). Only the Owner and Admin roles can grant it.
linkIdis the ID of a payment link in your organization, such as an item returned by Get product payment links.- The body takes
title,descriptionandsuccessUrl, all optional. Only the fields you send change. successUrlis an absolute HTTPS URL. Send an empty string to clear it; the customer then sees the Anyway receipt.- Price, currency and billing can’t be changed. To sell at a different price, create a new payment link.
- The response is the full updated link, whether it is active or not, with the same shape as an item from Get product payment links.
- Unknown fields are rejected with
400. There is noIdempotency-Keyfor this endpoint.
| Status | Code | Meaning |
|---|---|---|
400 | Validation failed: a successUrl that isn’t an absolute HTTPS URL, an unknown field, or a value that is too long (title 255 characters, description 2000, successUrl 1000). | |
401 | The API key is missing or invalid. | |
403 | INSUFFICIENT_SCOPE | The key lacks products:payment_links:write. |
404 | The payment link doesn’t exist or belongs to another organization. | |
413 | PAYLOAD_TOO_LARGE | The request body is larger than 64 KiB. |
Authorizations
Merchant API key (format: ak_BASE64)
Path Parameters
Payment link ID
Body
application/json
Fields to change