Last updated

Avarda Checkout Adapter

Overview Document: Payment Adapters Overview

Overview and Unique Capabilities

The Avarda Checkout Adapter integrates Avarda Checkout 3.0 with Norce Checkout. This page focuses on the unique technical details and configuration for Avarda.

Supported payment methods and other features: Features Overview

Supported Languages

English, Swedish, Finnish, Norwegian, Estonian, Danish, Czech, Latvian, Slovak, Polish, German, Austrian, Russian

B2B and B2C Support

The adapter supports both B2C (person) and B2B (organization) checkout modes. For B2C, customers are identified by their national identification number (social security number). For B2B, customers are identified by their organization identification number. The mode is determined automatically based on the customer type on the Norce order, or can be overridden via the mode configuration option.

Limitations

  • Partial Capture is not supported (full order capture only).
  • Partial Refund is not supported (full refund only).
  • Preselected payment method is not applicable for Sweden market.

Configuration in Norce Admin

The adapter is configured using the following unique details obtained from Avarda:

API Settings

FieldDescriptionExample Value
apiUrlAvarda Checkout API URL.https://stage.checkout-api.avarda.com
javascriptUrlURL to Avarda Checkout embed script.https://stage.checkout-cdn.avarda.com/cdn/static/js/main.js
clientIdYour Avarda client identifier.abc123
clientSecretYour Avarda client secret key.xyz789
useShippingBrokerEnable Avarda's integrated shipping broker.true

Checkout Setup Options

FieldDescription
selectedPaymentMethodTypePreselected payment method (not applicable for Sweden market).
recurringPaymentsEnable recurring payments checkbox (Hidden, Checked, Unchecked).
emailInvoiceEnable email invoice checkbox (Hidden, Checked, Unchecked).
languageOverride checkout form language (default: based on order culture).
modePurchase mode (B2C or B2B). Default: determined by customer type.
displayItemsShow item list inside checkout form (default: true).
differentDeliveryAddressDelivery address checkbox setup (Hidden, Checked, Unchecked).
termsAndConditionsUrlCustom T&C link (overrides Partner onboarding setting).
integrityConditionsUrlCustom integrity/privacy policy link.
enableB2BLinkEnable or disable B2B link visibility (default: false).
enableCountrySelectorEnable or disable country selector (default: false).
showThankYouPageShow or hide thank you page (default: false).
ageValidationMinimum customer age requirement (integer).
hideUnsupportedRecurringPaymentMethodsHide payment methods that don't support recurring (default: true).
skipEmailZipEntrySkip email and zip code entry step.
invoicingCountriesList of invoicing countries for country selector.
deliveryCountriesList of delivery countries for country selector.

Styling Options

Custom CSS styling can be configured via the styles object to override Avarda Checkout's default appearance. The styles are passed through to the Avarda Checkout iframe.

FieldDescription
emailNewsletterSubscriptionConsentIdConsent ID for email newsletter subscription.
smsNewsletterSubscriptionConsentIdConsent ID for SMS newsletter subscription.

Avarda API Environments

In addition to the generic Norce Adapter URLs (see Payment Adapters Overview), Avarda uses the following external API environments:

EnvironmentAvarda API Base URL
Productionhttps://checkout-api.avarda.com
Stagehttps://stage.checkout-api.avarda.com

Embedding the Checkout

Use the purchaseJwt and javascriptUrl returned from the create payment endpoint:

{
  "paymentId": "pfloMHwnSFxLDtaQYTVSeSKaLBx",
  "purchaseJwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "javascriptUrl": "https://stage.checkout-cdn.avarda.com/cdn/static/js/main.js",
  "styles": {}
}

The Avarda Checkout is embedded as an iframe using the JavaScript SDK. Load the script from javascriptUrl and initialize the checkout with the purchaseJwt token. The checkout iframe handles the complete payment flow including customer identification, payment method selection, and order confirmation.

Client-Side Event Callbacks

The Avarda Checkout JavaScript SDK provides several callbacks that your storefront should handle:

CallbackDescriptionAction Required
beforeSubmitTriggered when customer clicks "Complete Payment"Call validate then process endpoints
completedPurchaseTriggered when payment is completed in AvardaCall notification endpoint
customerUpdateTriggered when customer updates billing/shippingCall customer-update endpoint
shippingOptionUpdateTriggered when shipping option changesCall shipping-option-update endpoint

Validation and Process Flow

Implement a two-step validation flow when the customer clicks "Complete Payment":

Step 1: Validate

POST /api/checkout/v1/callback/orders/{order_id}/payments/{payment_id}/validate
Host: {slug}.api-se.stage.norce.tech
x-merchant: {merchant}
x-channel: {channel}
Authorization: Bearer {token}

Step 2: Process (if validation succeeds)

POST /api/checkout/v1/callback/orders/{order_id}/payments/{payment_id}/process
Host: {slug}.api-se.stage.norce.tech
x-merchant: {merchant}
x-channel: {channel}
Authorization: Bearer {token}

The process endpoint checks that the order has not changed since validation, updates consents, billing and shipping address, and transitions the Norce order and payment state.

Confirmation Page

After successful payment completion, Avarda can display a thank you page within the checkout iframe if showThankYouPage is enabled. Alternatively, redirect the customer to your own confirmation page. The payment details can be retrieved using the GET payment endpoint to display order confirmation information.

Troubleshooting (Avarda Specific)

In addition to the generic troubleshooting steps:

  • Review the order status in Avarda's admin portal.
  • Check that the Avarda order has been fully processed (ProcessedBackEnd: true).
  • Use the refresh endpoint to update available payment actions:
POST /api/order/v1/orders/{order_id}/payments/{payment_id}/refresh
Host: {slug}.api-se.stage.norce.tech
x-merchant: {merchant}
x-channel: {channel}
Authorization: Bearer {token}

Common Errors

  • 409 Conflict: A payment already exists for this order.
  • avarda-order-expired: Checkout session expired, create new payment.
  • Capture Fails: Order must be in reserved state and Completed in Avarda.

Payment States

StateDescription
intentPayment initialized, checkout session created
pendingPayment awaiting final confirmation
reservedPayment completed, ready for capture
capturedPayment captured/delivered
cancelledPayment cancelled
declinedPayment declined by Avarda