curl --request POST \
--url https://api.fintoc.com/v1/payment_intents/{id}/expire \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/payment_intents/{id}/expire"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/payment_intents/{id}/expire', 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_intents/{id}/expire",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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_intents/{id}/expire"
req, _ := http.NewRequest("POST", 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.post("https://api.fintoc.com/v1/payment_intents/{id}/expire")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/payment_intents/{id}/expire")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "pi_BO381oEATXonG6bj",
"object": "payment_intent",
"amount": 150000,
"business_profile": null,
"created_at": "2023-08-23T16:45:04.000Z",
"currency": "MXN",
"customer": null,
"customer_email": null,
"customer_phone": null,
"error_reason": "manually_expired",
"expires_at": "2023-08-25T16:45:04.000Z",
"invoices": [],
"metadata": {},
"mode": "live",
"next_action": null,
"payment_method": null,
"payment_type": "cash",
"payment_type_options": {
"cash": {
"reference_number": "1234567890123",
"barcode_url": "https://barcodes.fintoc.com/1234567890123.png",
"voucher_url": null
}
},
"recipient_account": null,
"reference_id": null,
"sender_account": null,
"split": null,
"split_applied": null,
"status": "expired",
"transaction_date": null,
"widget_token": null
}{
"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: pi_BO381oEATXonG6bj",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "payment_non_expirable",
"message": "Payment intent is not expirable. Payment intent can not be transitioned when consumer has already started the payment process in the sale point.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "unsupported_payment_type",
"message": "Payment type 'bank_transfer' is not supported for this request.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Expire a payment intent
Expires a payment intent, so it can no longer be paid. Only available for payment intents with payment_type cash and status created or requires_action. Once the customer starts the payment at the sale point, the payment intent can no longer be expired.
curl --request POST \
--url https://api.fintoc.com/v1/payment_intents/{id}/expire \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/payment_intents/{id}/expire"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/payment_intents/{id}/expire', 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_intents/{id}/expire",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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_intents/{id}/expire"
req, _ := http.NewRequest("POST", 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.post("https://api.fintoc.com/v1/payment_intents/{id}/expire")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/payment_intents/{id}/expire")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "pi_BO381oEATXonG6bj",
"object": "payment_intent",
"amount": 150000,
"business_profile": null,
"created_at": "2023-08-23T16:45:04.000Z",
"currency": "MXN",
"customer": null,
"customer_email": null,
"customer_phone": null,
"error_reason": "manually_expired",
"expires_at": "2023-08-25T16:45:04.000Z",
"invoices": [],
"metadata": {},
"mode": "live",
"next_action": null,
"payment_method": null,
"payment_type": "cash",
"payment_type_options": {
"cash": {
"reference_number": "1234567890123",
"barcode_url": "https://barcodes.fintoc.com/1234567890123.png",
"voucher_url": null
}
},
"recipient_account": null,
"reference_id": null,
"sender_account": null,
"split": null,
"split_applied": null,
"status": "expired",
"transaction_date": null,
"widget_token": null
}{
"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: pi_BO381oEATXonG6bj",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "payment_non_expirable",
"message": "Payment intent is not expirable. Payment intent can not be transitioned when consumer has already started the payment process in the sale point.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "unsupported_payment_type",
"message": "Payment type 'bank_transfer' is not supported for this request.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Response
The expired payment intent, with status expired and error_reason manually_expired.
Options specific to the payment type. For card payments, the object contains a card object. For cash payments, the object contains a cash object with the reference_number, barcode_url, voucher_url, and notification_preferences of the payment. For bank transfers, the object is empty.
Show child attributes
Show child attributes
{}
Status of the payment intent. One of created (the customer has not started the payment), in_progress (the customer is paying), succeeded (the money reached the recipient account), rejected (the institution rejected the transfer), failed (the payment could not be completed), expired (the payment intent expired before being paid), or pending (the final status is not yet known; only used if your organization has the pending status enabled).
created, failed, succeeded, rejected, in_progress, pending, expired "succeeded"
Was this page helpful?