Skip to main content

Create Payment Intent

POST 

/api/v2/consumer_portal/payment-intent

Create a payment intent before calling Moyasar.

The frontend calls this endpoint first to create an intent and get an intent_id. This intent_id is then passed to Moyasar in the metadata. When webhook/redirect happens, we extract payment_ids from the intent.

Validations:

  • All payment IDs exist
  • All payments belong to the same invoice
  • All payments are unpaid (PENDING, PROCESSING, FAILED, FAILED_INITIATION)

Args: request: Request containing payment_ids payment_intent_service: Injected service instance

Returns: PaymentIntentResponse with intent_id and payment_ids

Request

Responses

Successful Response