Skip to content

Getting started

Every integration begins on your server. Choose an environment, load the matching secret API key from secret storage, and create a checkout session from your authoritative cart or order.

Checkout-session bodies are strict: an unrecognized top-level property, or an unrecognized property inside an item, returns 422 Unprocessable Entity. Send only the fields declared by the API reference.

  1. Select sandbox or live and configure the corresponding API base on your server.
  2. Create a checkout session with a merchant API key. A channel acting for a merchant also identifies that merchant as described in Channel API.
  3. Give the buyer Hosted Checkout or Embedded Checkout, or mount the published browser SDK by following the maxanapay.js reference.
  4. Treat the browser result as user experience feedback. Reconcile durable state from the API and webhooks, with duplicate-safe handling.

The cURL and Node.js examples create a sandbox checkout session from trusted server code. The browser example mounts that session after your page loads the published major-channel script; it explicitly selects the sandbox API.

curl.sh
curl --request POST \
--url https://staging.api.maxanapay.com/api/checkout-sessions \
--header 'Authorization: Bearer sk_test_replace_me' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: order_1001_checkout' \
--data @request.json

The response’s environment is the API key’s environment, and the browser example’s environment option is the SDK’s. They are separate vocabularies that share one spelling: a sandbox key creates a session that reads test, while the SDK option for that same deployment is sandbox. Passing one into the other throws config_error before checkout mounts. See Environments.

  • Keep all secret keys out of browser code, logs, analytics, and URLs.
  • Use an idempotency key when the operation contract accepts one.
  • Store Maxana and provider identifiers with your own order identifier.
  • Exercise success, decline, cancellation, timeout, duplicate webhook, and delayed webhook paths in sandbox.

The browser SDK currently mounts the PayPal wallet rail and excludes the capabilities listed in the SDK reference. Use Hosted Checkout or Embedded Checkout when the session needs one of those capabilities, and do not treat sandbox credentials or state as live-ready.