Cancellation preview (eligibility and refund amount)
On behalf of a member ·
x-on-behalf-of required
Preview before cancelling. Refunds decrease by stage: a full refund before submission upstream, a partial refund once card production has begun. Cancellation is irreversible. If the user cancels without seeing the refund amount first, the difference will be difficult to explain.
Do not show the cancellation button when cancellable: false. stage identifies the application's current stage. Display unknown values unchanged; do not default to processing.
refund_total is already final: the issuance and shipping fees have each been multiplied by their respective refund ratios and summed. Do not apply another ratio.
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Application ID. Accepted with or without the cap_ prefix. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-on-behalf-of |
string | Required |
Response
200OK
{
"stage": "submitted",
"cancellable": true,
"asset": "USDT",
"ledger_scale": 6,
"refund_total": "20.00"
}404
not_found: the application does not exist or does not belong to this member/merchant.Request
curl -X GET 'https://api.zinfra.vip/v1/cards/applications/{id}/cancel-preview' \
-H 'x-auth-token: Bearer $TOKEN' \
-H 'x-on-behalf-of: $MEMBER_ID'const res = await fetch("https://api.zinfra.vip/v1/cards/applications/{id}/cancel-preview", {
method: "GET",
headers: {
"x-auth-token": "Bearer $TOKEN",
"x-on-behalf-of": "$MEMBER_ID",
},
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();import requests
res = requests.get(
"https://api.zinfra.vip/v1/cards/applications/{id}/cancel-preview",
headers={
"x-auth-token": "Bearer $TOKEN",
"x-on-behalf-of": "$MEMBER_ID",
},
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()req, _ := http.NewRequest("GET", "https://api.zinfra.vip/v1/cards/applications/{id}/cancel-preview",
nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-on-behalf-of", "$MEMBER_ID")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.zinfra.vip/v1/cards/applications/{id}/cancel-preview"))
.header("x-auth-token", "Bearer $TOKEN")
.header("x-on-behalf-of", "$MEMBER_ID")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
// Use String / BigDecimal for amounts, not double.$ch = curl_init('https://api.zinfra.vip/v1/cards/applications/{id}/cancel-preview');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-auth-token: Bearer $TOKEN',
'x-on-behalf-of: $MEMBER_ID',
],
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
{
"stage": "submitted",
"cancellable": true,
"asset": "USDT",
"ledger_scale": 6,
"refund_total": "20.00"
}