Generates a new payment link for a customer to pay.
curl --request POST \
--url https://checkout.suave.money/api/v1/payment_link \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"line_items": [
{
"title": "Acme NFT #1234",
"description": "This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote",
"quantity": 1,
"image_url": "https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png"
}
],
"order_price": {
"amount": 1000000000000000000,
"decimals": 18,
"currency": "USDC"
},
"env_mode": "live",
"success_callback_url": "http://localhost:3000?success=true",
"cancel_callback_url": "http://localhost:3000?cancel=true",
"failure_callback_url": "http://localhost:3000?failure=true",
"metadata": {
"custom_field": "value"
}
}
'import requests
url = "https://checkout.suave.money/api/v1/payment_link"
payload = {
"line_items": [
{
"title": "Acme NFT #1234",
"description": "This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote",
"quantity": 1,
"image_url": "https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png"
}
],
"order_price": {
"amount": 1000000000000000000,
"decimals": 18,
"currency": "USDC"
},
"env_mode": "live",
"success_callback_url": "http://localhost:3000?success=true",
"cancel_callback_url": "http://localhost:3000?cancel=true",
"failure_callback_url": "http://localhost:3000?failure=true",
"metadata": { "custom_field": "value" }
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
line_items: [
{
title: 'Acme NFT #1234',
description: 'This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote',
quantity: 1,
image_url: 'https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png'
}
],
order_price: {amount: 1000000000000000000, decimals: 18, currency: 'USDC'},
env_mode: 'live',
success_callback_url: 'http://localhost:3000?success=true',
cancel_callback_url: 'http://localhost:3000?cancel=true',
failure_callback_url: 'http://localhost:3000?failure=true',
metadata: {custom_field: 'value'}
})
};
fetch('https://checkout.suave.money/api/v1/payment_link', 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://checkout.suave.money/api/v1/payment_link",
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([
'line_items' => [
[
'title' => 'Acme NFT #1234',
'description' => 'This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote',
'quantity' => 1,
'image_url' => 'https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png'
]
],
'order_price' => [
'amount' => 1000000000000000000,
'decimals' => 18,
'currency' => 'USDC'
],
'env_mode' => 'live',
'success_callback_url' => 'http://localhost:3000?success=true',
'cancel_callback_url' => 'http://localhost:3000?cancel=true',
'failure_callback_url' => 'http://localhost:3000?failure=true',
'metadata' => [
'custom_field' => 'value'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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://checkout.suave.money/api/v1/payment_link"
payload := strings.NewReader("{\n \"line_items\": [\n {\n \"title\": \"Acme NFT #1234\",\n \"description\": \"This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote\",\n \"quantity\": 1,\n \"image_url\": \"https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png\"\n }\n ],\n \"order_price\": {\n \"amount\": 1000000000000000000,\n \"decimals\": 18,\n \"currency\": \"USDC\"\n },\n \"env_mode\": \"live\",\n \"success_callback_url\": \"http://localhost:3000?success=true\",\n \"cancel_callback_url\": \"http://localhost:3000?cancel=true\",\n \"failure_callback_url\": \"http://localhost:3000?failure=true\",\n \"metadata\": {\n \"custom_field\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-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.post("https://checkout.suave.money/api/v1/payment_link")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"line_items\": [\n {\n \"title\": \"Acme NFT #1234\",\n \"description\": \"This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote\",\n \"quantity\": 1,\n \"image_url\": \"https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png\"\n }\n ],\n \"order_price\": {\n \"amount\": 1000000000000000000,\n \"decimals\": 18,\n \"currency\": \"USDC\"\n },\n \"env_mode\": \"live\",\n \"success_callback_url\": \"http://localhost:3000?success=true\",\n \"cancel_callback_url\": \"http://localhost:3000?cancel=true\",\n \"failure_callback_url\": \"http://localhost:3000?failure=true\",\n \"metadata\": {\n \"custom_field\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://checkout.suave.money/api/v1/payment_link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"line_items\": [\n {\n \"title\": \"Acme NFT #1234\",\n \"description\": \"This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote\",\n \"quantity\": 1,\n \"image_url\": \"https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png\"\n }\n ],\n \"order_price\": {\n \"amount\": 1000000000000000000,\n \"decimals\": 18,\n \"currency\": \"USDC\"\n },\n \"env_mode\": \"live\",\n \"success_callback_url\": \"http://localhost:3000?success=true\",\n \"cancel_callback_url\": \"http://localhost:3000?cancel=true\",\n \"failure_callback_url\": \"http://localhost:3000?failure=true\",\n \"metadata\": {\n \"custom_field\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_order_id": "sample_payment_order_id",
"payment_url": "https://checkout.suave.money/payment/sample_payment_order_id"
}{
"message": "Invalid request data",
"code": "400",
"error": [
{
"path": "success_callback_url",
"message": "Required"
},
{
"path": "cancel_callback_url",
"message": "Required"
},
{
"path": "failure_callback_url",
"message": "Required"
},
{
"path": "line_items",
"message": "Required"
},
{
"path": "order_price",
"message": "Required"
}
]
}Payment API
Create Payment Link
POST
/
api
/
v1
/
payment_link
Generates a new payment link for a customer to pay.
curl --request POST \
--url https://checkout.suave.money/api/v1/payment_link \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"line_items": [
{
"title": "Acme NFT #1234",
"description": "This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote",
"quantity": 1,
"image_url": "https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png"
}
],
"order_price": {
"amount": 1000000000000000000,
"decimals": 18,
"currency": "USDC"
},
"env_mode": "live",
"success_callback_url": "http://localhost:3000?success=true",
"cancel_callback_url": "http://localhost:3000?cancel=true",
"failure_callback_url": "http://localhost:3000?failure=true",
"metadata": {
"custom_field": "value"
}
}
'import requests
url = "https://checkout.suave.money/api/v1/payment_link"
payload = {
"line_items": [
{
"title": "Acme NFT #1234",
"description": "This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote",
"quantity": 1,
"image_url": "https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png"
}
],
"order_price": {
"amount": 1000000000000000000,
"decimals": 18,
"currency": "USDC"
},
"env_mode": "live",
"success_callback_url": "http://localhost:3000?success=true",
"cancel_callback_url": "http://localhost:3000?cancel=true",
"failure_callback_url": "http://localhost:3000?failure=true",
"metadata": { "custom_field": "value" }
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
line_items: [
{
title: 'Acme NFT #1234',
description: 'This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote',
quantity: 1,
image_url: 'https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png'
}
],
order_price: {amount: 1000000000000000000, decimals: 18, currency: 'USDC'},
env_mode: 'live',
success_callback_url: 'http://localhost:3000?success=true',
cancel_callback_url: 'http://localhost:3000?cancel=true',
failure_callback_url: 'http://localhost:3000?failure=true',
metadata: {custom_field: 'value'}
})
};
fetch('https://checkout.suave.money/api/v1/payment_link', 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://checkout.suave.money/api/v1/payment_link",
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([
'line_items' => [
[
'title' => 'Acme NFT #1234',
'description' => 'This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote',
'quantity' => 1,
'image_url' => 'https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png'
]
],
'order_price' => [
'amount' => 1000000000000000000,
'decimals' => 18,
'currency' => 'USDC'
],
'env_mode' => 'live',
'success_callback_url' => 'http://localhost:3000?success=true',
'cancel_callback_url' => 'http://localhost:3000?cancel=true',
'failure_callback_url' => 'http://localhost:3000?failure=true',
'metadata' => [
'custom_field' => 'value'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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://checkout.suave.money/api/v1/payment_link"
payload := strings.NewReader("{\n \"line_items\": [\n {\n \"title\": \"Acme NFT #1234\",\n \"description\": \"This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote\",\n \"quantity\": 1,\n \"image_url\": \"https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png\"\n }\n ],\n \"order_price\": {\n \"amount\": 1000000000000000000,\n \"decimals\": 18,\n \"currency\": \"USDC\"\n },\n \"env_mode\": \"live\",\n \"success_callback_url\": \"http://localhost:3000?success=true\",\n \"cancel_callback_url\": \"http://localhost:3000?cancel=true\",\n \"failure_callback_url\": \"http://localhost:3000?failure=true\",\n \"metadata\": {\n \"custom_field\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-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.post("https://checkout.suave.money/api/v1/payment_link")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"line_items\": [\n {\n \"title\": \"Acme NFT #1234\",\n \"description\": \"This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote\",\n \"quantity\": 1,\n \"image_url\": \"https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png\"\n }\n ],\n \"order_price\": {\n \"amount\": 1000000000000000000,\n \"decimals\": 18,\n \"currency\": \"USDC\"\n },\n \"env_mode\": \"live\",\n \"success_callback_url\": \"http://localhost:3000?success=true\",\n \"cancel_callback_url\": \"http://localhost:3000?cancel=true\",\n \"failure_callback_url\": \"http://localhost:3000?failure=true\",\n \"metadata\": {\n \"custom_field\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://checkout.suave.money/api/v1/payment_link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"line_items\": [\n {\n \"title\": \"Acme NFT #1234\",\n \"description\": \"This Acme NFT is one of only 10000 in this collection. Your Acme NFT gives you premium access to watch the Road Runner evade Wile E. Coyote\",\n \"quantity\": 1,\n \"image_url\": \"https://www.artnews.com/wp-content/uploads/2022/01/unnamed-2.png\"\n }\n ],\n \"order_price\": {\n \"amount\": 1000000000000000000,\n \"decimals\": 18,\n \"currency\": \"USDC\"\n },\n \"env_mode\": \"live\",\n \"success_callback_url\": \"http://localhost:3000?success=true\",\n \"cancel_callback_url\": \"http://localhost:3000?cancel=true\",\n \"failure_callback_url\": \"http://localhost:3000?failure=true\",\n \"metadata\": {\n \"custom_field\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_order_id": "sample_payment_order_id",
"payment_url": "https://checkout.suave.money/payment/sample_payment_order_id"
}{
"message": "Invalid request data",
"code": "400",
"error": [
{
"path": "success_callback_url",
"message": "Required"
},
{
"path": "cancel_callback_url",
"message": "Required"
},
{
"path": "failure_callback_url",
"message": "Required"
},
{
"path": "line_items",
"message": "Required"
},
{
"path": "order_price",
"message": "Required"
}
]
}Headers
Example:
"your_api_key_here"
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Specify the env_mode to indicate the environment (e.g., test or live). On successful payment, webhook events are sent to subscriptions with the same env_mode as the payment link.
Available options:
test, live Example:
"live"
⌘I