Select Cryptocurrency
curl --request POST \
--url https://api.example.com/payment/select-cryptoimport requests
url = "https://api.example.com/payment/select-crypto"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/payment/select-crypto', 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.example.com/payment/select-crypto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/payment/select-crypto"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/payment/select-crypto")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payment/select-crypto")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": false,
"error": {
"status": 400,
"code": "VALIDATION_INVALID",
"message": "Invalid cryptocurrency code"
},
"data": null
}
Payments
Select Cryptocurrency
Select cryptocurrency for payment
POST
/
payment
/
select-crypto
Select Cryptocurrency
curl --request POST \
--url https://api.example.com/payment/select-cryptoimport requests
url = "https://api.example.com/payment/select-crypto"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/payment/select-crypto', 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.example.com/payment/select-crypto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/payment/select-crypto"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/payment/select-crypto")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payment/select-crypto")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": false,
"error": {
"status": 400,
"code": "VALIDATION_INVALID",
"message": "Invalid cryptocurrency code"
},
"data": null
}
Select the cryptocurrency for a payment request.
string
required
Cryptocurrency code (BTC, ETH, LTC, SOL)
boolean
Indicates if the request was successful
string
Payment ID
string
Payment status (pending, completed, expired)
string
Amount in cryptocurrency
string
Selected cryptocurrency
string
Cryptocurrency address for payment
string
Payment expiration timestamp
string
Checkout URL for customer
Example Request
curl -X POST https://api.transaction.gg/payment/select-crypto \
-H "Content-Type: application/json" \
-d '{
"crypto": "BTC"
}'
Example Response
{
"success": true,
"data": {
"id": "pay_abc123def456",
"status": "pending",
"amountCrypto": "0.00012345",
"crypto": "BTC",
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"expiresAt": "2024-01-01T01:00:00Z",
"checkoutUrl": "https://checkout.transaction.gg/pay_abc123def456"
}
}
Error Responses
{
"success": false,
"error": {
"status": 400,
"code": "VALIDATION_INVALID",
"message": "Invalid cryptocurrency code"
},
"data": null
}
{
"success": false,
"error": {
"status": 404,
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found"
},
"data": null
}
⌘I