curl -X POST https://sandbox.api.prava.space/v1/sessions/ses_123/report-status \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "txn_ref_id": "tli_1", "txn_status": "APPROVED", "authorization_code": "OK123", "response_code": "00" }'
import requests
resp = requests.post(
"https://sandbox.api.prava.space/v1/sessions/ses_123/report-status",
headers={"Authorization": "Bearer sk_test_..."},
json={
"txn_ref_id": "tli_1",
"txn_status": "APPROVED",
"authorization_code": "OK123",
"response_code": "00",
},
)
const resp = await fetch("https://sandbox.api.prava.space/v1/sessions/ses_123/report-status", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
txn_ref_id: "tli_1",
txn_status: "APPROVED",
authorization_code: "OK123",
response_code: "00",
}),
});
{ "status": "confirmed", "txn_ref_id": "tli_1", "txn_status": "APPROVED", "visa_confirmation": "SUCCESS" }
{
"error": { "code": "INVALID_STATE", "message": "No transaction awaiting payment result" }
}
{
"error": { "code": "NOT_FOUND", "message": "Session or txn_ref_id not found" }
}
Server-Side API
Report Status
Report payment execution outcome back to Prava
POST
/
v1
/
sessions
/
{sessionId}
/
report-status
curl -X POST https://sandbox.api.prava.space/v1/sessions/ses_123/report-status \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "txn_ref_id": "tli_1", "txn_status": "APPROVED", "authorization_code": "OK123", "response_code": "00" }'
import requests
resp = requests.post(
"https://sandbox.api.prava.space/v1/sessions/ses_123/report-status",
headers={"Authorization": "Bearer sk_test_..."},
json={
"txn_ref_id": "tli_1",
"txn_status": "APPROVED",
"authorization_code": "OK123",
"response_code": "00",
},
)
const resp = await fetch("https://sandbox.api.prava.space/v1/sessions/ses_123/report-status", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
txn_ref_id: "tli_1",
txn_status: "APPROVED",
authorization_code: "OK123",
response_code: "00",
}),
});
{ "status": "confirmed", "txn_ref_id": "tli_1", "txn_status": "APPROVED", "visa_confirmation": "SUCCESS" }
{
"error": { "code": "INVALID_STATE", "message": "No transaction awaiting payment result" }
}
{
"error": { "code": "NOT_FOUND", "message": "Session or txn_ref_id not found" }
}
Report the payment execution outcome back to Prava. Always report after you attempt the charge with the credentials — it updates transaction records and relays the outcome to the card network.
POST /v1/sessions/{sessionId}/report-status · Authenticated with your secret key.
Always report status after checkout execution. Report
DECLINED if a payment token was used but checkout failed.Path parameters
string
required
The session id from Create Session.
Body
string
required
The line-item reference from Get Payment Result.
string
required
APPROVED or DECLINED.string
default:"PURCHASE"
Transaction type.
string
Authorization code from your processor, max 128 chars.
string
Processor response code, max 2 chars (e.g.
"00" for approved).string
Override the total paid, if different from the original.
object[]
Optional per-product status overrides; informational (the overall mandate status follows
txn_status).Response
string
Always
"confirmed".string
string
APPROVED or DECLINED.string
SUCCESS or FAILURE.Notes
- A mandate is the spending permission created when the cardholder approved the payment. Reporting a one-time mandate charge as
APPROVEDconsumes the mandate (it can’t be reused); a recurring mandate staysactivefor future charges. See Mandates. product_statusesis optional and informational; the overall mandate status followstxn_status.
Error responses
| Status | Code | Cause | Resolution |
|---|---|---|---|
| 401 | AUTH_1001 | Invalid API key | Check your secret key |
| 401 | AUTH_1002 | Missing or invalid Authorization header | Include Authorization: Bearer sk_xxx |
| 404 | NOT_FOUND | Session / order / transaction reference not found | Verify the session ID and txn_ref_id |
| 400 | INVALID_STATE | No transaction awaiting payment result | May already be reported, or not yet ready |
| 400 | MANDATE_EXPIRED | Mandate has expired | Register a new intent |
| 400 | PRODUCT_NOT_FOUND | Product not found by the given ID | Verify product_id or product_ref_id |
| 502 | VISA_CONFIRMATION_FAILED | Card network confirmation failed | Retry or contact support |
| 500 | REPORT_STATUS_ERROR | Internal error | Contact support with the X-Response-ID header |
curl -X POST https://sandbox.api.prava.space/v1/sessions/ses_123/report-status \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "txn_ref_id": "tli_1", "txn_status": "APPROVED", "authorization_code": "OK123", "response_code": "00" }'
import requests
resp = requests.post(
"https://sandbox.api.prava.space/v1/sessions/ses_123/report-status",
headers={"Authorization": "Bearer sk_test_..."},
json={
"txn_ref_id": "tli_1",
"txn_status": "APPROVED",
"authorization_code": "OK123",
"response_code": "00",
},
)
const resp = await fetch("https://sandbox.api.prava.space/v1/sessions/ses_123/report-status", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
txn_ref_id: "tli_1",
txn_status: "APPROVED",
authorization_code: "OK123",
response_code: "00",
}),
});
{ "status": "confirmed", "txn_ref_id": "tli_1", "txn_status": "APPROVED", "visa_confirmation": "SUCCESS" }
{
"error": { "code": "INVALID_STATE", "message": "No transaction awaiting payment result" }
}
{
"error": { "code": "NOT_FOUND", "message": "Session or txn_ref_id not found" }
}
Authorizations
Your secret key: sk_test_* (sandbox) or sk_live_* (production).
Path Parameters
The session ID returned from Create Session
Body
application/json
The transaction line item reference ID (from Get Payment Result)
The payment outcome
Available options:
APPROVED, DECLINED Transaction type
Authorization code from the merchant's payment processor
Maximum string length:
128Processor response code, e.g. "00" for approved
Maximum string length:
2Override the total amount paid, if different from the original
Optional per-product status overrides
- By merchant product ID
- By Prava product reference
Show child attributes
Show child attributes