curl --request GET \
--url https://payment-gateway.learnagent.cloud/v2/payments/{payment_id} \
--header 'X-Morphosis-Key-Id: <x-morphosis-key-id>' \
--header 'X-Morphosis-Nonce: <x-morphosis-nonce>' \
--header 'X-Morphosis-Signature: <api-key>' \
--header 'X-Morphosis-Signature-Version: <x-morphosis-signature-version>' \
--header 'X-Morphosis-Timestamp: <x-morphosis-timestamp>'import requests
url = "https://payment-gateway.learnagent.cloud/v2/payments/{payment_id}"
headers = {
"X-Morphosis-Signature-Version": "<x-morphosis-signature-version>",
"X-Morphosis-Key-Id": "<x-morphosis-key-id>",
"X-Morphosis-Timestamp": "<x-morphosis-timestamp>",
"X-Morphosis-Nonce": "<x-morphosis-nonce>",
"X-Morphosis-Signature": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Morphosis-Signature-Version': '<x-morphosis-signature-version>',
'X-Morphosis-Key-Id': '<x-morphosis-key-id>',
'X-Morphosis-Timestamp': '<x-morphosis-timestamp>',
'X-Morphosis-Nonce': '<x-morphosis-nonce>',
'X-Morphosis-Signature': '<api-key>'
}
};
fetch('https://payment-gateway.learnagent.cloud/v2/payments/{payment_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://payment-gateway.learnagent.cloud/v2/payments/{payment_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 => [
"X-Morphosis-Key-Id: <x-morphosis-key-id>",
"X-Morphosis-Nonce: <x-morphosis-nonce>",
"X-Morphosis-Signature: <api-key>",
"X-Morphosis-Signature-Version: <x-morphosis-signature-version>",
"X-Morphosis-Timestamp: <x-morphosis-timestamp>"
],
]);
$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://payment-gateway.learnagent.cloud/v2/payments/{payment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Morphosis-Signature-Version", "<x-morphosis-signature-version>")
req.Header.Add("X-Morphosis-Key-Id", "<x-morphosis-key-id>")
req.Header.Add("X-Morphosis-Timestamp", "<x-morphosis-timestamp>")
req.Header.Add("X-Morphosis-Nonce", "<x-morphosis-nonce>")
req.Header.Add("X-Morphosis-Signature", "<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://payment-gateway.learnagent.cloud/v2/payments/{payment_id}")
.header("X-Morphosis-Signature-Version", "<x-morphosis-signature-version>")
.header("X-Morphosis-Key-Id", "<x-morphosis-key-id>")
.header("X-Morphosis-Timestamp", "<x-morphosis-timestamp>")
.header("X-Morphosis-Nonce", "<x-morphosis-nonce>")
.header("X-Morphosis-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://payment-gateway.learnagent.cloud/v2/payments/{payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Morphosis-Signature-Version"] = '<x-morphosis-signature-version>'
request["X-Morphosis-Key-Id"] = '<x-morphosis-key-id>'
request["X-Morphosis-Timestamp"] = '<x-morphosis-timestamp>'
request["X-Morphosis-Nonce"] = '<x-morphosis-nonce>'
request["X-Morphosis-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"external_reference": "<string>",
"requested_amount": {
"currency": "<string>",
"decimal": "<string>",
"minor_units": "<string>"
},
"environment": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"payment_instructions": {
"network": "<string>",
"asset": "<string>",
"destination": "<string>",
"amount": {
"decimal": "<string>",
"sun": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z"
},
"settlement": {
"actual_received": {
"decimal": "<string>",
"sun": "<string>"
},
"settled_amount": {
"currency": "<string>",
"decimal": "<string>",
"minor_units": "<string>"
},
"settlement_rate": {
"base_asset": "<string>",
"quote_currency": "<string>",
"quote_minor_units": "<string>",
"base_sun": "<string>"
},
"transaction_hash": "<string>"
},
"failure": {
"message": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>"
}Retrieve a payment
GET /v2/payments/ — read the current payment state.
curl --request GET \
--url https://payment-gateway.learnagent.cloud/v2/payments/{payment_id} \
--header 'X-Morphosis-Key-Id: <x-morphosis-key-id>' \
--header 'X-Morphosis-Nonce: <x-morphosis-nonce>' \
--header 'X-Morphosis-Signature: <api-key>' \
--header 'X-Morphosis-Signature-Version: <x-morphosis-signature-version>' \
--header 'X-Morphosis-Timestamp: <x-morphosis-timestamp>'import requests
url = "https://payment-gateway.learnagent.cloud/v2/payments/{payment_id}"
headers = {
"X-Morphosis-Signature-Version": "<x-morphosis-signature-version>",
"X-Morphosis-Key-Id": "<x-morphosis-key-id>",
"X-Morphosis-Timestamp": "<x-morphosis-timestamp>",
"X-Morphosis-Nonce": "<x-morphosis-nonce>",
"X-Morphosis-Signature": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Morphosis-Signature-Version': '<x-morphosis-signature-version>',
'X-Morphosis-Key-Id': '<x-morphosis-key-id>',
'X-Morphosis-Timestamp': '<x-morphosis-timestamp>',
'X-Morphosis-Nonce': '<x-morphosis-nonce>',
'X-Morphosis-Signature': '<api-key>'
}
};
fetch('https://payment-gateway.learnagent.cloud/v2/payments/{payment_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://payment-gateway.learnagent.cloud/v2/payments/{payment_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 => [
"X-Morphosis-Key-Id: <x-morphosis-key-id>",
"X-Morphosis-Nonce: <x-morphosis-nonce>",
"X-Morphosis-Signature: <api-key>",
"X-Morphosis-Signature-Version: <x-morphosis-signature-version>",
"X-Morphosis-Timestamp: <x-morphosis-timestamp>"
],
]);
$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://payment-gateway.learnagent.cloud/v2/payments/{payment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Morphosis-Signature-Version", "<x-morphosis-signature-version>")
req.Header.Add("X-Morphosis-Key-Id", "<x-morphosis-key-id>")
req.Header.Add("X-Morphosis-Timestamp", "<x-morphosis-timestamp>")
req.Header.Add("X-Morphosis-Nonce", "<x-morphosis-nonce>")
req.Header.Add("X-Morphosis-Signature", "<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://payment-gateway.learnagent.cloud/v2/payments/{payment_id}")
.header("X-Morphosis-Signature-Version", "<x-morphosis-signature-version>")
.header("X-Morphosis-Key-Id", "<x-morphosis-key-id>")
.header("X-Morphosis-Timestamp", "<x-morphosis-timestamp>")
.header("X-Morphosis-Nonce", "<x-morphosis-nonce>")
.header("X-Morphosis-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://payment-gateway.learnagent.cloud/v2/payments/{payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Morphosis-Signature-Version"] = '<x-morphosis-signature-version>'
request["X-Morphosis-Key-Id"] = '<x-morphosis-key-id>'
request["X-Morphosis-Timestamp"] = '<x-morphosis-timestamp>'
request["X-Morphosis-Nonce"] = '<x-morphosis-nonce>'
request["X-Morphosis-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"external_reference": "<string>",
"requested_amount": {
"currency": "<string>",
"decimal": "<string>",
"minor_units": "<string>"
},
"environment": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"payment_instructions": {
"network": "<string>",
"asset": "<string>",
"destination": "<string>",
"amount": {
"decimal": "<string>",
"sun": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z"
},
"settlement": {
"actual_received": {
"decimal": "<string>",
"sun": "<string>"
},
"settled_amount": {
"currency": "<string>",
"decimal": "<string>",
"minor_units": "<string>"
},
"settlement_rate": {
"base_asset": "<string>",
"quote_currency": "<string>",
"quote_minor_units": "<string>",
"base_sun": "<string>"
},
"transaction_hash": "<string>"
},
"failure": {
"message": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>"
}Idempotency-Key is forbidden on this route.Authorizations
Morphosis HMAC v2 authenticates public Payment API requests.
Join exactly seven values with one LF character and no trailing LF:
v2- Uppercase HTTP method
- Raw path and query exactly as received
- Unix timestamp in seconds
- Unique nonce
- Raw
Idempotency-Key, or an empty line for GET - Lowercase hexadecimal SHA-256 of the exact raw request body bytes
Encode the canonical string as UTF-8. Sign it with HMAC-SHA-256 and encode the signature as unpadded base64url. Reject duplicate signed headers before canonicalization.
Headers
Public Payment API signature version. Duplicate values are rejected.
"v2"Public identifier for the merchant signing key. Duplicate values are rejected.
1 - 128^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$Unix timestamp in whole seconds. Duplicate values are rejected.
^[0-9]{10}$Unique, single-use nonce. Duplicate values are rejected.
16 - 128^[A-Za-z0-9._~-]+$Unpadded base64url HMAC-SHA-256 signature. Duplicate values are rejected.
^[A-Za-z0-9_-]{43}$Path Parameters
MorphosisBlock Payment identifier.
^pay_[0-7][0-9A-HJKMNP-TV-Z]{25}$Response
Current Payment.
^pay_[0-7][0-9A-HJKMNP-TV-Z]{25}$1 - 128pending, submission_unknown, paid, denied, cancelled, review_required Show child attributes
Show child attributes
Sandbox TRON Shasta environment.
"sandbox"Merchant-defined string values returned unchanged. The idempotency digest sorts original keys by ascending UTF-8 bytes and preserves each validated value exactly.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Stable gateway failure information. It never contains private provider field names, identifiers, status codes, response bodies, or raw errors.
Show child attributes
Show child attributes