Payment Flow

Creating Payment Intents

Create a payment intent with payment method, amount, customer info, and return URLs:

{
  "paymentMethod": {
    "id": "mbway-eupago",
    "phone": "+351912345678"
  },
  "reference": "ORDER-12345",
  "customer": {
    "id": "cust_abc123",
    "email": "customer@example.com"
  },
  "amount": "50.00",
  "currency": "EUR",
  "returnLinks": {
    "default": "https://yourproduct.com/return",
    "cancel": "https://yourproduct.com/cancel"
  }
}

Response includes payment intent ID (UUID), status, and action object.

Action Types

Redirect Action - Instant methods (MBWay, Neteller, Paysafecard):

{
  "type": "redirect",
  "method": "GET",
  "url": "https://provider.com/pay/...",
  "expiresAt": "2025-11-18T15:30:00Z"
}

Redirect customer to URL, they complete payment at provider, return to your site.

Requisites Action - Delayed methods (Multibanco):

{
  "type": "requisites",
  "requisites": {
    "entity": "12345",
    "reference": "123 456 789",
    "amount": "100.50"
  },
  "expiresAt": "2025-11-20T23:59:59Z"
}

Display requisites to customer, they pay at ATM or online banking, confirmation in 1-3 days.

Webhooks

Configure at portal-test.sweuze.com.

Fulfill orders on payment.succeeded only - not on return URLs (can be manipulated).

Webhooks are cryptographically signed for security. See Webhook Validation.

Idempotency

  • Same reference matches existing non-canceled intents
  • Use unique references for new payments
  • Check webhook id before processing (may be delivered multiple times)

Error Handling

Code Meaning Action
401 Invalid auth Check API key and signature
409 Intent blocked Customer account issue
422 Validation failed Check fields array
502 Provider error Retry or offer alternative