Skip to content
Meem Payment

Accept payments

Workflow selection

Routing workflows are built and published in Routing Studio. Your integration decides only which workflow runs, either explicitly with workflowId or implicitly through triggers.

Choose a workflow explicitly

Send workflowId (the workflow's id or code) on a payment, a checkout session or a payment link. Meem validates it and never substitutes another workflow: an unknown, unpublished, foreign or incompatible workflow fails the payment with 422.

WhereField
POST /api/v1/paymentsworkflowId
POST /api/v1/checkout/sessionsworkflowId
POST /api/v1/payment-linksworkflowId
curl -X POST "https://api.sandbox.meem-dev.example/api/v1/payments" \
  -H "Authorization: Bearer $MEEM_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount": 1200,
    "currency": "SAR",
    "cardToken": "4000001111112223",
    "workflowId": "<workflow_id_or_code>",
    "channel": "web"
  }'
CodeCause
WORKFLOW_NOT_FOUNDNo workflow with that id or code for your merchant.
WORKFLOW_NOT_PUBLISHEDThe workflow exists but has no live published version in this environment.
WORKFLOW_PAYMENT_METHOD_MISMATCHThe workflow is bound to a different payment method.

Resolution order

When you don't name a workflow, Meem resolves one in this order. The first match wins.

StepSourceRecorded as
1Explicit workflowIdExplicit
2A trigger the parent merchant set for this sub-accountSubAccountTrigger
3The merchant's own triggersMerchantTrigger (or PaymentMethodMapping for a method binding)
4Lanes: a payment-method lane, then the merchant defaultPaymentMethodMapping · Default
5Inherited from the parent (only if the sub-account inherits configuration)InheritedTrigger · InheritedPaymentMethodMapping · InheritedDefault
6Nothing matched422 ROUTING_NOT_CONFIGURED. There's no cross-merchant fallback.

Only triggers of published, non-archived workflows in the payment's environment take part. Gateway credentials are never inherited: an inherited workflow routes over the sub-account's own gateway accounts.

How triggers match

Triggers are configured in Routing Studio on each workflow. A trigger can constrain these dimensions; empty means any, except currency:

DimensionValues
Payment option / methodKnown codes, e.g. card, mada, apple_pay.
CurrencyISO 4217. Empty on create means SAR, not any.
OperationAuthorize, Purchase or any.
CountryISO 3166 alpha-2.
Channelweb, mobile, link, api, recovery.
Amount rangeInclusive minAmount–maxAmount.
Effective windowOptional [from, to).
  • Among matching triggers, the most specific wins (most constrained dimensions), then the lowest priority (0–10000, default 100).
  • Two triggers of different workflows with equal specificity and priority that can match the same payment are rejected as ambiguous (409) when saved or first published.
  • Send channel on direct API payments if you want channel triggers to apply; without it the payment is recorded as api. Hosted checkout sets web, and payment links set link.

What the payment records

GET /api/v1/payments/{id} returns workflowId, workflowVersion, workflowVersionId (the immutable published version that ran), workflowResolution and channel. The routing trace shows which rules were evaluated and why accounts were excluded.

Documentation reflects the platform as verified on 3 December 2026. Placeholder hosts and credentials are used throughout; your real sandbox host and keys are provided at onboarding.