Stage Sandbox walkthrough. Replace the example key id and secret with credentials Morphosis issued to your merchant. The example secret below is public documentation material and will be rejected by the live gateway.

Create a sandbox payment

This example signs POST /v2/payments with Morphosis HMAC v2 and targets the live Stage Sandbox origin.

1. Configure environment

Use your issued MORPHOSIS_KEY_ID and MORPHOSIS_SIGNING_SECRET. Keep the base URL pointing at the Stage Sandbox.

2. Sign and send the request

Save the following as create-payment.mjs and run it with Node.js 18 or newer.
A successful create returns 201 with payment_id and payment_instructions. A same-digest in-flight or indeterminate submission returns 202 with status: "submission_unknown" — do not create a second logical payment.

3. Reproducible documentation vector

The fixed vector below is for reviewing the canonical string. It uses documentation-only credentials and a fixed timestamp.
Signed with demo_only_not_a_credential_replace_with_issued_secret, the signature is jeIngz8uluitIQutRDF9r6d0K7p1ChdRAVAPDmXwueM. Body bytes:

4. Understand a successful response

Persist payment_id, external_reference, and the complete payment_instructions object before presenting instructions to a customer. TRX amounts use decimal + sun (not minor_units).

5. Next steps