Skip to main content
POST
/
payins
/
{id}
/
request
Send payment request
curl --request POST \
  --url https://{subdomain}.truust.io/2.0/payins/{id}/request \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{subdomain}.truust.io/2.0/payins/{id}/request"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{subdomain}.truust.io/2.0/payins/{id}/request', 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://{subdomain}.truust.io/2.0/payins/{id}/request",
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: Bearer <token>"
],
]);

$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://{subdomain}.truust.io/2.0/payins/{id}/request"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{subdomain}.truust.io/2.0/payins/{id}/request")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{subdomain}.truust.io/2.0/payins/{id}/request")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "self": "/2.0/payins/456",
  "reference": "<string>",
  "type": "<string>",
  "subtype": "<string>",
  "provider": {},
  "tag": "<string>",
  "direct_link": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "confirmed_at": "2023-11-07T05:31:56Z",
  "denied_at": "2023-11-07T05:31:56Z",
  "connections": {}
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}

Authorizations

Authorization
string
header
required

Use your account's Secret Key as the Bearer token.

Path Parameters

id
integer
required

Payin ID.

Response

Payment request sent

id
integer
self
string
Example:

"/2.0/payins/456"

reference
string | null

Provider's payment reference ID.

type
string

Payment method type (e.g. CARD, BANKWIRE, WALLET).

subtype
string | null
status
enum<string>
Available options:
CREATED,
AUTHORIZED,
CONFIRMED,
DENIED,
REFUNDED,
CANCELLED
provider
object

Raw provider response data.

tag
string | null

Payment page URL. Only present when status is CREATED or AUTHORIZED.

created_at
string<date-time> | null
confirmed_at
string<date-time> | null
denied_at
string<date-time> | null
connections
object

Hypermedia links to related resources.