Skip to content

Fail a withdrawal

POST
/v1/operations/withdrawal_failed.v1
curl --request POST \
--url http://localhost:8080/v1/operations/withdrawal_failed.v1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: pay-2026-11-14-0001' \
--data '{ "accounts": { "withdrawal_in_transit": "9030:wdt-0001", "customer_wallet": "2010:cust-hana" }, "amounts": { "amount": { "amount": "100.00", "currency": "ETB" } } }'

Books withdrawal_failed.v1 (worked entries E04 (c)). The request binds each role to an account and gives each amount; the template turns it into one balanced entry, which the ledger posts in one transaction. The client decides whether the operation is allowed (ADR-0002); the ledger decides how it is booked.

Idempotency-Key
required
string
/^[A-Za-z0-9._:-]{1,128}$/

Makes a write safe to retry. The same key with the same request returns the original result; with a different request, 409 idempotency_key_reused. Keys are per client and kept for at least 30 days (ADR-0008).

Media typeapplication/json
object
accounts
required
object
withdrawal_in_transit
required

The account bound to withdrawal_in_transit: one opened under chart account 9030.

One of:

An account ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
customer_wallet
required

The account bound to customer_wallet: one opened under chart account 2010.

One of:

An account ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
amounts
required
object
amount
required

Greater than zero.

object
amount
required

A decimal amount, with at most the currency’s minor-unit digits (ETB: 2). Never a JSON number.

string
/^-?(0|[1-9][0-9]{0,17})(\.[0-9]{1,4})?$/
currency
required

An ISO 4217 code the ledger supports.

string
/^[A-Z]{3}$/
metadata

Client references, copied into the entry, never used for accounting. At most 32 keys and 4096 bytes in all. The key template is reserved.

object
<= 32 properties
key
additional properties
string
<= 512 characters
event_time

When the event happened, if the client knows (an offline payment). Informational: the entry is posted now, into the open period (INV-12).

string | null format: date-time

Example

{
"accounts": {
"withdrawal_in_transit": "9030:wdt-0001",
"customer_wallet": "2010:cust-hana"
},
"amounts": {
"amount": {
"amount": "100.00",
"currency": "ETB"
}
}
}

Replayed

Media typeapplication/json
object
id
required

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
sequence
required

Posting order (INV-12).

integer format: int64
kind
required
string
Allowed values: standard reversal adjustment refund
template
required

The template that booked it; null for a reversal or an adjustment.

One of:
string
/^[a-z][a-z0-9_]{0,63}\.v[1-9][0-9]{0,4}$/
period_id
required
integer format: int64
>= 1
recorded_at
required
string format: date-time
event_time
required

When the event happened, if the client knows (an offline payment). Informational: the entry is posted now, into the open period (INV-12).

string | null format: date-time
lines
required
Array<object>
>= 2 items
object
account
required

An account ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
side
required
string
Allowed values: debit credit
amount
required

An amount with its currency (ADR-0005, ADR-0009).

object
amount
required

A decimal amount, with at most the currency’s minor-unit digits (ETB: 2). Never a JSON number.

string
/^-?(0|[1-9][0-9]{0,17})(\.[0-9]{1,4})?$/
currency
required

An ISO 4217 code the ledger supports.

string
/^[A-Z]{3}$/
metadata
required
object
key
additional properties
string
reverses
required
One of:

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
refunds
required
One of:

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
authorization
required
object
reason
required
string
requested_by
required
string
approved_by
string | null
receipt
required

The signed ledger receipt (spec §7.2, INV-26): proof, verifiable with the public key alone, that the ledger recorded this entry at this position of its hash chain. null only for entries posted before the chain began.

One of:

The entry’s link in the hash chain, signed. Verify the signature over mezgeb.receipt.v1\0, the position (8 bytes, big-endian), the entry ID (16 bytes) and the hash, with the key key_id from /v1/keys.

object
position
required
integer
>= 1
entry
required

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
prev_hash
required

A SHA-256 hash, in lower-case hex.

string
/^[0-9a-f]{64}$/
hash
required

A SHA-256 hash, in lower-case hex.

string
/^[0-9a-f]{64}$/
key_id
required
One of:
string
/^[0-9a-f]{16}$/
signature
required
One of:

An Ed25519 signature, in lower-case hex.

string
/^[0-9a-f]{128}$/

Example

{
"kind": "standard",
"template": "merchant_payment.v1",
"lines": [
{
"side": "debit",
"amount": {
"amount": "39.20",
"currency": "ETB"
}
}
]
}
Idempotent-Replayed
string
Allowed values: true

true when the response repeats an earlier request with the same key.

Posted

Media typeapplication/json
object
id
required

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
sequence
required

Posting order (INV-12).

integer format: int64
kind
required
string
Allowed values: standard reversal adjustment refund
template
required

The template that booked it; null for a reversal or an adjustment.

One of:
string
/^[a-z][a-z0-9_]{0,63}\.v[1-9][0-9]{0,4}$/
period_id
required
integer format: int64
>= 1
recorded_at
required
string format: date-time
event_time
required

When the event happened, if the client knows (an offline payment). Informational: the entry is posted now, into the open period (INV-12).

string | null format: date-time
lines
required
Array<object>
>= 2 items
object
account
required

An account ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
side
required
string
Allowed values: debit credit
amount
required

An amount with its currency (ADR-0005, ADR-0009).

object
amount
required

A decimal amount, with at most the currency’s minor-unit digits (ETB: 2). Never a JSON number.

string
/^-?(0|[1-9][0-9]{0,17})(\.[0-9]{1,4})?$/
currency
required

An ISO 4217 code the ledger supports.

string
/^[A-Z]{3}$/
metadata
required
object
key
additional properties
string
reverses
required
One of:

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
refunds
required
One of:

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
authorization
required
object
reason
required
string
requested_by
required
string
approved_by
string | null
receipt
required

The signed ledger receipt (spec §7.2, INV-26): proof, verifiable with the public key alone, that the ledger recorded this entry at this position of its hash chain. null only for entries posted before the chain began.

One of:

The entry’s link in the hash chain, signed. Verify the signature over mezgeb.receipt.v1\0, the position (8 bytes, big-endian), the entry ID (16 bytes) and the hash, with the key key_id from /v1/keys.

object
position
required
integer
>= 1
entry
required

An entry ID.

string format: uuid
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
prev_hash
required

A SHA-256 hash, in lower-case hex.

string
/^[0-9a-f]{64}$/
hash
required

A SHA-256 hash, in lower-case hex.

string
/^[0-9a-f]{64}$/
key_id
required
One of:
string
/^[0-9a-f]{16}$/
signature
required
One of:

An Ed25519 signature, in lower-case hex.

string
/^[0-9a-f]{128}$/

Example

{
"id": "0192f3c4-0000-7000-8000-000000000007",
"sequence": 8,
"kind": "standard",
"template": "merchant_payment.v1",
"period_id": 12,
"recorded_at": "2026-11-14T09:30:12.418205Z",
"event_time": null,
"lines": [
{
"account": "0192f3c4-0000-7000-8000-000000000002",
"side": "debit",
"amount": {
"amount": "100.00",
"currency": "ETB"
}
},
{
"account": "0192f3c4-0000-7000-8000-000000000004",
"side": "credit",
"amount": {
"amount": "98.00",
"currency": "ETB"
}
},
{
"account": "0192f3c4-0000-7000-8000-000000000005",
"side": "credit",
"amount": {
"amount": "2.00",
"currency": "ETB"
}
}
],
"metadata": {
"template": "merchant_payment.v1",
"channel": "qr",
"order": "order-81"
},
"reverses": null,
"refunds": null,
"authorization": null,
"receipt": null
}
Location
string

The URL of the created resource.

Bad request

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

invalid_request

{
"type": "urn:mezgeb:problem:invalid_request",
"title": "The request is malformed",
"status": 400,
"code": "invalid_request",
"detail": "The request is malformed.",
"errors": [
{
"pointer": "/amounts/amount",
"detail": "\"10.255\" has more decimal places than ETB allows"
}
],
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

Unauthenticated

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

Exampleunauthenticated

unauthenticated

{
"type": "urn:mezgeb:problem:unauthenticated",
"title": "Authentication is required",
"status": 401,
"code": "unauthenticated",
"detail": "Authentication is required.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

Forbidden

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

Exampleforbidden

forbidden

{
"type": "urn:mezgeb:problem:forbidden",
"title": "The caller may not do this",
"status": 403,
"code": "forbidden",
"detail": "The caller may not do this.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

Conflict

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

Exampleidempotency_key_reused

idempotency_key_reused

{
"type": "urn:mezgeb:problem:idempotency_key_reused",
"title": "The idempotency key was used for a different request",
"status": 409,
"code": "idempotency_key_reused",
"detail": "Idempotency key \"pay-0001\" was already used for a different request.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

Refused

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

missing_amount (2004)

{
"type": "urn:mezgeb:problem:missing_amount",
"title": "An amount the template needs is missing",
"status": 422,
"code": "missing_amount",
"rule": 2004,
"detail": "An amount the template needs is missing.",
"name": "amount",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

Rate limited

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

Examplerate_limited

rate_limited

{
"type": "urn:mezgeb:problem:rate_limited",
"title": "Too many requests",
"status": 429,
"code": "rate_limited",
"detail": "Too many requests.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}
Retry-After
integer
>= 1

Seconds to wait before retrying.

Internal error

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

internal_error

{
"type": "urn:mezgeb:problem:internal_error",
"title": "Internal error",
"status": 500,
"code": "internal_error",
"detail": "Internal error.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

Unavailable

Media typeapplication/problem+json

RFC 9457 Problem Details, with Mezgeb’s stable code.

object
type
required

urn:mezgeb:problem:<code>.

string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance

This occurrence: urn:uuid:<request id>.

string format: uri
code
required

A stable error code. Never renumbered or reused; see docs/api/errors.md.

string
Allowed values: invalid_request idempotency_key_required unauthenticated forbidden not_found idempotency_key_reused rate_limited internal_error not_implemented busy contention no_open_period too_few_lines too_many_lines metadata_too_large amount_not_positive account_not_found account_not_open currency_mismatch duplicate_line amount_overflow unbalanced account_total_overflow insufficient_funds invalid_template_id unknown_template unknown_template_version missing_amount unexpected_amount non_positive_amount missing_account unexpected_account bound_account_not_found account_not_allowed same_account reserved_metadata template_defect amount_not_whole_balance account_not_new fee_exceeds_amount amount_currency_mismatch amount_too_large missing_metadata invalid_metadata missing_refunded_entry unexpected_refunded_entry invalid_reference duplicate_reference invalid_status_change already_reversed cannot_reverse_reversal reason_not_allowed maker_is_checker hold_not_active hold_expired capture_exceeds_hold invalid_held_account account_is_held not_refundable refund_of_reversed_entry refund_line_not_allowed refund_exceeds_original refunded_entry_not_found refunded_entry_cannot_be_reversed cannot_reverse_refund period_not_closed period_label_taken period_close_findings adjustment_not_pending offline_unavailable attestation_unsupported public_key_registered owner_not_a_wallet tier_disabled device_not_active certificate_expired voucher_open over_tier_limit over_customer_cap shortfall_unpaid dispute_resolved break_closed break_not_closable
rule

The posting rule (1001–1012) or template rule (2001–2022) that refused the request.

integer
line

The zero-based line of the entry at fault.

integer
role

The template role at fault.

string
name

The amount or metadata key at fault.

string
errors

For invalid_request: each field at fault.

Array<object>
object
pointer
required

A JSON Pointer into the request body.

string
detail
required
string

Examples

busy

{
"type": "urn:mezgeb:problem:busy",
"title": "The accounts are busy; retry later",
"status": 503,
"code": "busy",
"detail": "An account stayed locked longer than the lock timeout. Retry after the Retry-After interval.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}
Retry-After
integer
>= 1

Seconds to wait before retrying.