Get a payment link
curl --request GET \
--url https://api.fintoc.com/v1/payment_links/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/payment_links/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/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://api.fintoc.com/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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v1/payment_links/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fintoc.com/v1/payment_links/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/payment_links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "plink_K2zwNNSxPyx8w3GZ",
"object": "payment_link",
"amount": 5000,
"checkout": {
"description": "Premium subscription"
},
"created_at": "2024-04-04T15:23:11.474Z",
"currency": "CLP",
"customer_email": "customer@example.com",
"expires_at": null,
"max_completed_sessions": null,
"metadata": {
"order_id": "1234"
},
"mode": "live",
"recipient_account": null,
"status": "active",
"url": "https://pay.fintoc.com/plink_K2zwNNSxPyx8w3GZ"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "id",
"message": "No such payment_link: plink_K2zwNNSxPyx8w3GZ",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Payment links
Get a payment link
Retrieves a payment link by its id. Only payment links matching the live or test mode of the API key are visible.
GET
/
v1
/
payment_links
/
{id}
Get a payment link
curl --request GET \
--url https://api.fintoc.com/v1/payment_links/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/payment_links/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/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://api.fintoc.com/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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v1/payment_links/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fintoc.com/v1/payment_links/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/payment_links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "plink_K2zwNNSxPyx8w3GZ",
"object": "payment_link",
"amount": 5000,
"checkout": {
"description": "Premium subscription"
},
"created_at": "2024-04-04T15:23:11.474Z",
"currency": "CLP",
"customer_email": "customer@example.com",
"expires_at": null,
"max_completed_sessions": null,
"metadata": {
"order_id": "1234"
},
"mode": "live",
"recipient_account": null,
"status": "active",
"url": "https://pay.fintoc.com/plink_K2zwNNSxPyx8w3GZ"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "id",
"message": "No such payment_link: plink_K2zwNNSxPyx8w3GZ",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}La respuesta de la API puede contener campos vacíos.
Respuesta
The payment link.
Status of the payment link. One of active (accepts payments), expired (the expiration date passed), canceled (you canceled the link), or completed (the link reached its maximum number of completed sessions).
Opciones disponibles:
active, expired, canceled, completed Ejemplo:
"active"
¿Esta página le ayudó?