Skip to content

Get a posting template

GET
/v1/templates/{template_id}
curl --request GET \
--url http://localhost:8080/v1/templates/merchant_payment.v1 \
--header 'Authorization: Bearer <token>'

One template version, such as merchant_payment.v1.

template_id
required
string
/^[a-z][a-z0-9_]{0,63}\.v[1-9][0-9]{0,4}$/

The template, as name.vN.

The template.

Media typeapplication/json
object
id
required
string
/^[a-z][a-z0-9_]{0,63}\.v[1-9][0-9]{0,4}$/
roles
required
Array<object>
object
name
required
string
codes
required
Array<integer>
optional
required
boolean
amounts
required
Array<string>
optional_amounts
required
Array<string>
metadata
required
Array<object>
object
name
required
string
required
required
boolean
values
required
Array<string>
refunds
required
boolean

Example

{
"id": "merchant_payment.v1",
"roles": [
{
"name": "payer_wallet",
"codes": [
2010
],
"optional": false
},
{
"name": "merchant_balance",
"codes": [
2030
],
"optional": false
},
{
"name": "fee_revenue",
"codes": [
4010
],
"optional": true
}
],
"amounts": [
"amount"
],
"optional_amounts": [
"merchant_fee",
"payer_fee"
],
"metadata": [
{
"name": "channel",
"required": true,
"values": [
"qr",
"card_tap",
"phone_tap",
"fingerprint"
]
}
],
"refunds": false
}

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"
}

Not found

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

not_found

{
"type": "urn:mezgeb:problem:not_found",
"title": "Not found",
"status": 404,
"code": "not_found",
"detail": "Not found.",
"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"
}