Draft API Preview for the MorphosisBlock Payment API. Error codes and retry guidance are proposed contract material. They are not evidence of an available service.

Errors

Non-success responses use one stable JSON envelope so merchants can log a request identifier without exposing request bodies or credentials. Use the HTTP status for the broad failure class, code for application logic, and request_id when correlating a failed request.
The URI is a stable documentation identifier and is not a callable endpoint.

Draft error catalogue

Error messages are for people and may change. Branch application logic on code, not title or detail.

Idempotency

POST /v2/payments requires an Idempotency-Key containing 16 to 128 ASCII characters. The draft permits letters, numbers, ., _, ~, and -, with a letter or number as the first character.
Generate one key when a merchant order first enters payment creation. Persist it with the order before sending the request.

Required behaviour

  • Reuse the same key only with byte-for-byte equivalent logical content.
  • Never reuse a key for another merchant order.
  • If a response is lost, do not invent a new key or create a second logical payment.
  • Treat submission_unknown as unresolved, not as success or failure.
  • Make downstream fulfilment idempotent independently of API idempotency.

Ambiguous create outcome

If the connection closes before a complete create response:
  1. Preserve the merchant reference, original request body, idempotency key, timestamped attempt record, and any returned request identifier.
  2. Do not send a new logical payment request.
  3. Do not promise the customer that creation failed.
  4. Wait for an authoritative payment response or payment.updated event before proceeding.
This preview does not promise that replaying a create request is available or safe. A launch contract must define and test server-side idempotency retention and recovery before merchants are instructed to replay writes.

Logging

Log the payment identifier, merchant reference, idempotency key, error code, request identifier, HTTP status, and timestamp. Do not log request-signing secrets, signatures, full authentication headers, customer personal data, or raw webhook bodies.