Create sequence diagrams with simple online tool

Swimlanes.io is a free webapp for making sequence diagrams. You simply edit the text on the left and the diagram is updated in real time. You can download your sequence diagrams as images or distribute with a link.

Title: Native Merchant Onboarding Order: Merchant, Native Partner, Klarna Onboarding API, ... Note Merchant, ...: API calls to "Klarna Onboarding API" will use the following **base urls**: EU * playground: https://api.playground.klarna.com/accountmanagement/v1/ * production: https://api.klarna.com/accountmanagement/v1/ US * playground: https://api-na.playground.klarna.com/accountmanagement/v1/ * production: https://api-na.klarna.com/accountmanagement/v1/ AP * playground: https://api-oc.playground.klarna.com/accountmanagement/v1/ * production: https://api-oc.klarna.com/accountmanagement/v1/ Note Merchant, ...: Callbacks to `callback_url` or `confirmation_callback_url` will be done x times within y hours unless we get HTTP 200 as a response. Note Merchant, ...:Native Partner transfers as much `merchant data` as available. To create a production-enabled merchant account at least the following data fields are necessary (holds for NL): * Merchant Information * **email** - merchant's admin email * **type** - a new (NEW) merchant for the partner or a merchant that is already active (ESTABLISHED) and has a live webshop. * **confirmation_email** - merchant's email to confirm sensitive data change (esp. bank account details) * **country** - the merchant's country * Business Information * **organization_entity_type** - the legal form of merchant's business * **organization_registration_id** - e.g. KVK number (NL), commercial register number (DE) (for DE also the **registration_authority** like "Amtsgericht Charlottenburg" is needed) * **vat_id** - merchant's VAT ID (EU) * **subject_to_vat** - indicates if merchant is obliged to pay VAT * Store Information * **country** - country of the merchant's store * **store_name** - name of merchant's shop/brand * **organization_category** - the industry of merchant's business * **homepage_url** - the URL of merchant's shop * Furhter Information * **price_plan** - the ID of a partner specific, predefined price plan for merchants (sets pricing and settlement parameters, like delay & frequency) =: **1. Create Merchant Account** Note Native Partner, Klarna Onboarding API: for security reasons Native Partner needs to authenticate via **OAUTH2** Native Partner -> Klarna Onboarding API: POST /merchants `merchant data` if: **field validation ok** Native Partner <-- Klarna Onboarding API: HTTP 201, `merchant_id` else: **invalid fields** Native Partner <-- Klarna Onboarding API: HTTP 4xx, `error_object` end =: **2. Update Merchant Account (Completely)** Note Merchant, ...: If merchant data can be updated before merchant loads iFrame in next step, use the following API call (there is also a PATCH endpoint available to partially update a merchant account): Native Partner -> Klarna Onboarding API: PUT /merchants/{merchant_id} `merchant_data` if: **field validation ok** Klarna Onboarding API ->> ...: updating Klarna Onboarding API <<-- ...: result Native Partner <-- Klarna Onboarding API: HTTP 204 else: **invalid fields** Native Partner <-- Klarna Onboarding API: HTTP 4xx, `error_object` end =: **3. Redirect Merchant to Enter AML Data** Note Merchant, ...: Load iFrame/widget in Partner's merchant backend for entering missing data (might be also a redirected webpage at somwhere.klarna.com) Merchant -> Native Partner: payouts GET `page url (which includes widget)` Native Partner -> Klarna Onboarding API: POST /merchants/{merchant_id}/widget-url-request if: **success_case** Native Partner <-- Klarna Onboarding API: HTTP 200, `widget_url` Merchant <-- Native Partner: HTTP 200 `widget_url` Merchant -> Klarna Onboarding API: GET `widget_url` if: **merchant needs to enter AML data** Merchant <-- Klarna Onboarding API: HTTP 200 Note: Widget shows current set of available data from previous API calls prefilled in the form. Merchant -> Merchant: enter/update `business data`, `aml data`, `bank account` and click 'Submit' Merchant -> Klarna Onboarding API: POST `merchant_id/widget_token` `business data`, `aml data`, `bank account` Klarna Onboarding API -> Klarna Onboarding API: PATCH /merchants/{merchant_id} `merchant_data` Klarna Onboarding API ->> ...: underwriting Merchant <-- Klarna Onboarding API: HTTP 200 Klarna Onboarding API <<-- ...: underwriting result Native Partner <<- Klarna Onboarding API: POST callback_url `merchant_id`, `{status}` Note: `{status}` might be [`TRANSACTIONS_ENABLED`, `ADDITIONAL_REVIEW_1`, `SUSPENDED`] Native Partner --> Klarna Onboarding API: HTTP 200 Klarna Onboarding API <<-- ...: underwriting result Native Partner <<- Klarna Onboarding API: POST callback_url `merchant_id`, `{status}` Note: `{status}` might be [`PAYOUTS_ENABLED`, `ADDITIONAL_REVIEW_2`, `SUSPENDED`] Native Partner --> Klarna Onboarding API: HTTP 200 =: **4. Retrieve Credentials** Note Merchant, ...: Credentials can be requested several times; each time a new set of credentials will be created; new credentials are first deactivated until Klarna Onboarding API gets the acknowledgment that the creation is approved With receiving the acknowledgment, the new credentials are activated and the 48 hour transition period starts until the old credentials are deactivated automatically. Native Partner -> Klarna Onboarding API: POST /merchants/{merchant_id}/credentials-request Klarna Onboarding API -> ...: create credentials Klarna Onboarding API <-- ...: `credentials` Native Partner <-- Klarna Onboarding API: HTTP 202, `credentials` Native Partner <- Klarna Onboarding API: POST confirmation_callback_url `merchant_id`, `REQUEST_FOR_ACKNOWLEDGEMENT` Native Partner -> Native Partner: calculate `ACK` Native Partner --> Klarna Onboarding API: HTTP 200, `ACK` Klarna Onboarding API -> Klarna Onboarding API: check `ACK` if: check of `ACK` successful Klarna Onboarding API -> ...: activate new credentials, deactivate old credentials after 48 hours Native Partner <- Klarna Onboarding API: POST confirmation_callback_url `merchant_id`, `ACKNOWLEDGMENET_RESULT`, `ACCEPTED` Native Partner --> Klarna Onboarding API: HTTP 200 else: else Native Partner <- Klarna Onboarding API: POST confirmation_callback_url `merchant_id`, `ACKNOWLEDGMENET_RESULT`, `DECLINED` Native Partner --> Klarna Onboarding API: HTTP 200 end Native Partner <-- Klarna Onboarding API: HTTP 4xx, `error_object` end