Skip to content

Register an offline device

POST
/v1/offline/devices
curl --request POST \
--url http://localhost:8080/v1/offline/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "owner_account": "2010:cust-hana", "public_key": "03ca16e9076330c0c89ff8738477b10113a8d324b21e95863ef1f442035b1203c1", "label": "Hana'\''s phone", "attestation": { "type": "none" } }'

Registers a payer device’s P-256 public key for a customer wallet and returns its device certificate, signed by the issuer key (protocol §5). The attestation decides the tier: until a card chip is chosen and Android Key Attestation is verified, only none is accepted, which earns tier C if the client has enabled it. The public key identifies the request: registering it again with the same details returns the device (200, Idempotent-Replayed: true).

Media typeapplication/json
object
owner_account
required

The owner’s customer wallet (2010), by ID or chart reference.

string
public_key
required

A compressed P-256 public key (SEC1, 33 bytes), in lower-case hex.

string
/^0[23][0-9a-f]{64}$/
label
required
string
>= 1 characters <= 100 characters
attestation
required
object
type
required

none earns tier C. card and android are refused as attestation_unsupported until they are verified.

string
Allowed values: none card android

Example

{
"owner_account": "2010:cust-hana",
"public_key": "03ca16e9076330c0c89ff8738477b10113a8d324b21e95863ef1f442035b1203c1",
"label": "Hana's phone",
"attestation": {
"type": "none"
}
}

The device, registered earlier with the same details.

Media typeapplication/json
object
id
required

An offline device 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}$/
owner_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}$/
public_key
required

A compressed P-256 public key (SEC1, 33 bytes), in lower-case hex.

string
/^0[23][0-9a-f]{64}$/
key_id
required
string
/^[0-9a-f]{16}$/
tier
required
string
Allowed values: A B C
attestation
required
string
Allowed values: none card android
label
required
string
status
required
string
Allowed values: active frozen lost revoked
status_reason
required
One of:
string
next_counter
required

The first counter the device’s next voucher authorises, at the least: it rises with every receipt recorded and every voucher issued.

integer
>= 1
certificate
required
object
body
required

The exact bytes signed, in lower-case hex (protocol §3).

string
/^([0-9a-f]{2})+$/
signature
required

An ECDSA P-256 signature, r || s with low s, in lower-case hex.

string
/^[0-9a-f]{128}$/
issuer_key_id
required
string
/^[0-9a-f]{16}$/
issued_at
required
string format: date-time
valid_until
required
string format: date-time

Example

{
"tier": "A",
"attestation": "none",
"status": "active"
}

The device and its certificate.

Media typeapplication/json
object
id
required

An offline device 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}$/
owner_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}$/
public_key
required

A compressed P-256 public key (SEC1, 33 bytes), in lower-case hex.

string
/^0[23][0-9a-f]{64}$/
key_id
required
string
/^[0-9a-f]{16}$/
tier
required
string
Allowed values: A B C
attestation
required
string
Allowed values: none card android
label
required
string
status
required
string
Allowed values: active frozen lost revoked
status_reason
required
One of:
string
next_counter
required

The first counter the device’s next voucher authorises, at the least: it rises with every receipt recorded and every voucher issued.

integer
>= 1
certificate
required
object
body
required

The exact bytes signed, in lower-case hex (protocol §3).

string
/^([0-9a-f]{2})+$/
signature
required

An ECDSA P-256 signature, r || s with low s, in lower-case hex.

string
/^[0-9a-f]{128}$/
issuer_key_id
required
string
/^[0-9a-f]{16}$/
issued_at
required
string format: date-time
valid_until
required
string format: date-time

Example

{
"id": "0192f3c4-0000-7000-8000-000000000d01",
"owner_account": "0192f3c4-0000-7000-8000-000000000002",
"public_key": "03ca16e9076330c0c89ff8738477b10113a8d324b21e95863ef1f442035b1203c1",
"key_id": "a2bfef699d293e97",
"tier": "C",
"attestation": "none",
"label": "Hana's phone",
"status": "active",
"status_reason": null,
"next_counter": 1,
"certificate": {
"body": "6d657a6765622e6f66666c696e652e6465766963652e763100",
"signature": "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab",
"issuer_key_id": "8356ab979cb1fbd8",
"issued_at": "2026-11-16T00:00:00Z",
"valid_until": "2027-11-16T00:00:00Z"
}
}
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"
}

The key is registered with other details

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

Examplepublic_key_registered

public_key_registered

{
"type": "urn:mezgeb:problem:public_key_registered",
"title": "The public key is registered with other details",
"status": 409,
"code": "public_key_registered",
"detail": "this public key is already registered with other details",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}

The device was 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

owner_not_a_wallet

{
"type": "urn:mezgeb:problem:owner_not_a_wallet",
"title": "The owner account is not an open customer wallet",
"status": 422,
"code": "owner_not_a_wallet",
"detail": "account 0192f3c4-0000-7000-8000-000000000001 is not an open customer wallet",
"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, or offline payments are not configured

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

offline_unavailable

{
"type": "urn:mezgeb:problem:offline_unavailable",
"title": "Offline payments are not configured",
"status": 503,
"code": "offline_unavailable",
"detail": "This ledger has no offline issuer key, so offline payments are off.",
"instance": "urn:uuid:0192f3c4-0000-7000-8000-00000000abcd"
}