Charge future transaction
Execute a scheduled future payment immediately, before its planned date.
curl --request POST \
--url https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id} \
--header 'Content-Type: application/json' \
--header 'x-signature: <api-key>' \
--header 'x-timestamp: <api-key>' \
--data '
{
"future_transaction_id": "<string>",
"recurring_id": "<string>",
"amount": 500000
}
'import requests
url = "https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}"
payload = {
"future_transaction_id": "<string>",
"recurring_id": "<string>",
"amount": 500000
}
headers = {
"x-signature": "<api-key>",
"x-timestamp": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-signature': '<api-key>',
'x-timestamp': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({future_transaction_id: '<string>', recurring_id: '<string>', amount: 500000})
};
fetch('https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_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://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_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([
'future_transaction_id' => '<string>',
'recurring_id' => '<string>',
'amount' => 500000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-signature: <api-key>",
"x-timestamp: <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://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}"
payload := strings.NewReader("{\n \"future_transaction_id\": \"<string>\",\n \"recurring_id\": \"<string>\",\n \"amount\": 500000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-signature", "<api-key>")
req.Header.Add("x-timestamp", "<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://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}")
.header("x-signature", "<api-key>")
.header("x-timestamp", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"future_transaction_id\": \"<string>\",\n \"recurring_id\": \"<string>\",\n \"amount\": 500000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-signature"] = '<api-key>'
request["x-timestamp"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"future_transaction_id\": \"<string>\",\n \"recurring_id\": \"<string>\",\n \"amount\": 500000\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "<string>",
"recurring_id": "<string>",
"future_transaction_id": "<string>",
"accepted": true,
"order_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}future_transaction_id and recurring_id.
Provide amount to override its scheduled amount for this charge.
Idempotency-Key header. Reuse the same key only when retrying the exact same request body. See Idempotency.Authorizations
Lowercase hex HMAC-SHA256 of {x-timestamp}.{METHOD}.{path_with_query}.{raw_body} keyed with your API secret. See https://www.smartretry.com/docs/authentication.
Current Unix time in seconds; must be within 5 minutes of server time and match the value used in the signature.
Headers
Optional idempotency key, scoped to terminal + matched route pattern. A replayed request returns the cached response with Idempotency-Replayed: true. Send it exactly once (a repeated header is rejected); 1-255 characters, letters, digits, _ and - only.
1 - 255^[\w-]+$Path Parameters
The unique identifier of the terminal.
6^[\dA-Za-z]{6}$Body
The future transaction identifier to charge immediately.
8^[\dA-Za-z]{8}$The recurring subscription identifier this future transaction belongs to.
8^[\dA-Za-z]{8}$Override amount in major currency units (e.g. 10.00 for $10.00 USD). Uses the scheduled amount if omitted.
0.01 <= x <= 999999.99Response
Default Response
8^[\dA-Za-z]{8}$8^[\dA-Za-z]{8}$8^[\dA-Za-z]{8}$8^[\dA-Za-z]{8}$curl --request POST \
--url https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id} \
--header 'Content-Type: application/json' \
--header 'x-signature: <api-key>' \
--header 'x-timestamp: <api-key>' \
--data '
{
"future_transaction_id": "<string>",
"recurring_id": "<string>",
"amount": 500000
}
'import requests
url = "https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}"
payload = {
"future_transaction_id": "<string>",
"recurring_id": "<string>",
"amount": 500000
}
headers = {
"x-signature": "<api-key>",
"x-timestamp": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-signature': '<api-key>',
'x-timestamp': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({future_transaction_id: '<string>', recurring_id: '<string>', amount: 500000})
};
fetch('https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_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://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_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([
'future_transaction_id' => '<string>',
'recurring_id' => '<string>',
'amount' => 500000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-signature: <api-key>",
"x-timestamp: <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://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}"
payload := strings.NewReader("{\n \"future_transaction_id\": \"<string>\",\n \"recurring_id\": \"<string>\",\n \"amount\": 500000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-signature", "<api-key>")
req.Header.Add("x-timestamp", "<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://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}")
.header("x-signature", "<api-key>")
.header("x-timestamp", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"future_transaction_id\": \"<string>\",\n \"recurring_id\": \"<string>\",\n \"amount\": 500000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://terminal.smartretry.com/v1/payments/recurring/future-transactions/charge/{terminal_friendly_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-signature"] = '<api-key>'
request["x-timestamp"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"future_transaction_id\": \"<string>\",\n \"recurring_id\": \"<string>\",\n \"amount\": 500000\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "<string>",
"recurring_id": "<string>",
"future_transaction_id": "<string>",
"accepted": true,
"order_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason_code": "SYSTEM/SUCCESSFUL",
"instance": "<string>",
"context": {}
}