openapi: 3.0.0
info:
  title: Hooks API
  description: |
    API for managing webhooks

    # Changelog

    All notable changes to the API.

    ## 2026-06-18

    > **new**: Add support for subscription on `account_payout_destination_add`, `account_payout_destination_update`, and `account_payout_destination_delete` events.
    >
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](/webhooks-api/example-management-auth-events/example_account_payout_destination_update_event)

    ## 2026-05-16

    > **break**: Rename `account_location_add`, `account_location_update` and
    > `account_location_delete` events to `account_store_add`,
    > `account_store_update` and `account_store_delete`.
    >
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](/webhooks-api/example-management-auth-events/example_account_store_add_event)

    ## 2026-03-10

    > **Update**: Switch from `external_token_reference` to `external_token_references` for card tokens
    > - [Event example](/webhooks-api/example-checkout-events/example_checkout_token_event)

    ## 2026-03-01

    > **doc**: Document guaranteed fields in card token event payloads
    > - [Event example](/webhooks-api/example-checkout-events/example_checkout_token_event)

    ## 2026-02-18

    > **Update**: Document support for `external_token_reference` for card tokens
    > - [Event example](/webhooks-api/example-checkout-events/example_checkout_token_event)

    ## 2026-01-26

    > **new**: Add support for subscription on `account_location_add`,
    > `account_location_update` and `account_location_delete` events.
    >
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](#operation/example_account_location_add_event)

    ## 2025-11-30

    > **new**: Add support for `exclude_fields` in webhooks. Use the new option
    > to exclude fields from the event being delivered
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)

    > **new**: Add support for subscription on `checkout_authorization` event.
    >
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](/webhooks-api/example-checkout-events/example_checkout_authorization_event)

    ## 2025-10-01

    > **new**: Add support for subscription on `checkout_token_add`,
    > `checkout_token_update` and `checkout_token_delete` event.
    >
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](/webhooks-api/example-checkout-events/example_checkout_token_event)

    ## 2024-08-01

    > **update**: Extend the `cdd_case_update` event with optional
    > `payout_destination_case` and `payment_case` to make it easier to determine
    > what CDD case was updated
    > - [Event example](/webhooks-api/example-management-auth-events/example_cdd_case_update_event)

    ## 2024-02-01

    > **doc**: Fix `HookDeliveryDetail` definition, the type for the `response.body`
    > and `details.delivery_duration` was wrong, change to `string` and
    > `number`
    > - [GET /v1/accounts/{aid}/hooks/subscriptions/{hid}/deliveries/{delivery_id}](/webhooks-api/subscription-deliveries/aid_source_hooks_hid_deliveries_did_get)

    ## 2023-12-01

    > **new**: Add support for `approval_payout_destination_delete` event.
    > The event will be published when a seller approval is archived
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](/webhooks-api/example-management-auth-events/example_approval_payout_destination_update_delete)

    ## 2023-01-01

    > **new**: Add support for subscription on `checkout_transaction` event.
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > - [Event example](/webhooks-api/example-checkout-events/example_checkout_transaction_event)

    ## 2022-11-01

    > Add support for creating subscription with `fields` mask. The fields property
    > lets you explicitly select the fields you need from the event deliveries
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)

    ## 2022-08-01

    > Document example for `approval_payout_destination_update` event
    > - [POST approval_payout_destination_update event](/webhooks-api/example-management-auth-events/example_approval_payout_destination_update_event)

    ## 2021-04-01

    > Add support for subscription on `shopping_order_delete` events.
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)

    ## 2021-01-01

    > Add support for subscription on `settlement_add` events.
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)

    ## 2020-10-01

    > Add support for subscription on `account_add` and `account_update` events.
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)

    ## 2019-04-31

    > Implement support for subscription on
    > `discount_customer_update` event. The event is published after a
    > - [POST hooks/subscriptions](/webhooks-api/subscriptions/aid_source_hooks_post)
    > `receipt_add` event or when discounts are claimed.

    # Webhook Events

    Each event has a similar JSON schema, but a unique payload
    object that is determined by its event type.

    ## Accounts

    ### account_add / account_update

    The event is sent from auth service after an account is added or updated.

    > The events are only available for production subscriptions

    > `account_add` events are only available for partner accounts

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: account_add
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "account_add",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "account": {
                    "account_id": "12341234",
                    "jwks": {
                        "name": "example",
                        "uri": "https://example.com"
                    },
                    "applicant": {
                        "agreement": {
                            "accepted_at": "2022-01-01T00:00:00Z"
                        },
                        "email": "john.doe@example.com",
                        "first_name": "John",
                        "last_name": "Doe",
                        "phone_number": "+1234567890",
                        "promo_code": "ABC123",
                        "utm": {
                            "utm_source": "google",
                            "utm_medium": "cpc",
                            "utm_campaign": "example"
                        }
                    },
                    "billing": {
                        "address": {
                            "address_line": "123 Main St",
                            "postal_place": "MainVille",
                            "country": "NO"
                        },
                        "business_name": "Example Inc"
                    },
                    "company": {
                        "business_name": "Example Inc.",
                        "address": {
                            "address_line": "123 Main St",
                            "postal_place": "MainVille",
                            "country": "NO"
                        }
                    },
                    "language_code": "en-US",
                    "livemode": "true",
                    "partner_id": "00000000",
                    "active": "true",
                    "account_manager": {
                        "email": "jane.doe@example.com"
                    },
                    "reseller_id": "reseller123",
                    "progression": "live",
                    "subscription": {
                        "interval": "month",
                        "metadata": {
                            "key": "value"
                        },
                        "plan": "basic",
                        "support": "email"
                    },
                    "services": {
                        "checkout": {
                            "enabled": "true",
                            "settings": {
                                "key": "value"
                            }
                        },
                        "customers": {
                            "enabled": "true",
                            "settings": {
                                "key": "value"
                            }
                        }
                    },
                    "connections": {
                        "collector": {
                            "invoice": {
                                "enabled": "true",
                                "settings": {
                                    "key": "value"
                                }
                            }
                        }
                    },
                    "created_by": "1234-1234-1234-1234"
                }
            }

    ### account_store_add / account_store_update / account_store_delete

    The event is sent from auth service after a store is added, updated or deleted.

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: account_store_add
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "account_store_add",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "store": {
                    "id": "T12341234-0001",
                    "store_id": "STORE001",
                    "store_name": "Main Store",
                    "created_at": "2019-08-24T14:15:22Z",
                    "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                    "updated_at": "2019-08-24T14:15:22Z",
                    "updated_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                    "status": "ACTIVE",
                    "verified": true,
                    "number_of_terminals": 2,
                    "organization": {
                        "organization_number": "123456789",
                        "name": "Example Company AS",
                        "trade_name": "Example Store"
                    },
                    "email": "store@example.com",
                    "phone_number": "+4799999999",
                    "address": {
                        "address_line": "Sommerkroveien 34",
                        "postal_place": "Oslo",
                        "postal_code": "0349",
                        "country": "NO"
                    },
                    "payout_destination": {
                        "payout_destination_id": "pd-123",
                        "status": "ACTIVE",
                        "type": "company"
                    },
                    "operator_payout_destinations": []
                }
            }

    ## Customers

    ### customer_update / customer_add / customer_delete

    Customer event sent from customers service after a customer is
    created, updated or deleted. All customer properties will be
    included in the event.

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: customer_update
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "customer_update",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "metadata": {
                    "dob_year": 1985
                },
                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                "created_at": "2019-08-24T14:15:22Z",
                "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                "updated_at": "2019-08-24T14:15:22Z",
                "first_name": "John",
                "last_name": "Doe",
                "email": "customer@example.com",
                "phone_number": "+4799999999",
                "status": "string",
                "favorite_store": "string",
                "enrolled_by": {
                    "type": "url",
                    "value": "https://facebook.com"
                },
                "type": "customer",
                "addresses": [
                    {
                        "address_line": "Sommerkroveien 34",
                        "postal_place": "Oslo",
                        "country": "NO"
                    }
                ],
                "term": {
                    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                    "accepted_at": "2019-08-24T14:15:22Z"
                },
                "company": {
                    "organization_number": "123456789MVA",
                    "bussiness_name": "TKP tech AS",
                    "department": "sales department",
                    "industry": "computer industry",
                },
                "date_of_birth": "1990-09-20",
                "customer_id": "string"
            }

    ### customer_change_password

    Customer event sent from customers service after a change_password
    request is received. Note that the event includes a context object
    with `audience` and `created_by`.

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: customer_change_password
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "customer_change_password",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "metadata": {
                    "dob_year": 1985
                },
                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                "created_at": "2019-08-24T14:15:22Z",
                "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                "updated_at": "2019-08-24T14:15:22Z",
                "first_name": "John",
                "last_name": "Doe",
                "email": "customer@example.com",
                "phone_number": "+4799999999",
                "status": "string",
                "favorite_store": "string",
                "enrolled_by": {
                    "type": "url",
                    "value": "https://facebook.com"
                },
                "type": "customer",
                "addresses": [
                    {
                        "address_line": "Sommerkroveien 34",
                        "postal_place": "Oslo",
                        "country": "NO"
                    }
                ],
                "term": {
                    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                    "accepted_at": "2019-08-24T14:15:22Z"
                },
                "company": {
                    "organization_number": "123456789MVA",
                    "bussiness_name": "TKP tech AS",
                    "department": "sales department",
                    "industry": "computer industry",
                },
                "date_of_birth": "1990-09-20",
                "customer_id": "string"
                "context": {
                    "audience": "https://api.dintero.com/v1/accounts/P00000000",
                    "created_by": "API_USER"
                }
            }

    ## Discounts

    ### discount_update / discount_add / discount_delete

    Discount event sent from discount service after a discount rule
    is created, updated or deleted. All discount properties will be
    included in the event

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: discount_update
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "discount_update",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                "created_at": "2019-08-24T14:15:22Z",
                "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                "updated_at": "2019-08-24T14:15:22Z",
                "campaign_id": "string",
                "active": "true",
                "private": "false",
                "updated_by": "3d1e4824-5474-48e7-a369-4f603fa4c5b8",
                "type": "item",
                "name": "Spar 100,-",
                "receipt_text": "Mai Salg",
                "visible_from": "2019-08-24T14:15:22Z",
                "description": "Gjør et Stablestol kupp!",
                "limitation": {
                    "discount_activation": [
                        {
                            "type": "deactivate_if_discount_active",
                            "value": "string"
                        }
                    ],
                    "discount_hours": {
                        "timezone": "Europe/Oslo",
                        "hours": [
                            {
                                "day": "mon",
                                "start": "10:00",
                                "end": "20:00"
                            }
                        ]
                    },
                    "discount_reward_usage": 1,
                    "discount_combination": -1,
                    "discount_eligible": "item_eligible_for_discount",
                    "discount_repeat_usage": -1,
                    "stamp_expire_days": 100,
                    "blacklist": [
                        {
                            "id": "b714118",
                            "group_id": "B1"
                        }
                    ]
                },
                "requirement": {
                    "customer": {
                        "addresses": [
                            {
                                "country": [
                                    "NO"
                                ],
                                "postal_code": [
                                    "0349"
                                ],
                                "postal_place": [
                                    "Oslo"
                                ],
                                "custom_type": [
                                    "offsite"
                                ],
                                "type": [
                                    "custom"
                                ]
                            }
                        ],
                        "company": {
                            "bussiness_name": [
                                "TKP tech AS"
                            ],
                            "department": [
                                "production",
                                "research"
                            ],
                            "industry": [
                                "J62.0.1",
                                "J62.0.2"
                            ],
                            "number_of_employees": [
                                "20"
                            ],
                            "organization_number": [
                                "123456789MVA"
                            ],
                            "website": [
                                "https://dintero.com"
                            ]
                        },
                        "date_of_birth": [
                            "1990-09-20",
                            "1990-05-10"
                        ],
                        "first_name": [
                            "John"
                        ],
                        "gender": [
                            "male"
                        ],
                        "last_name": [
                            "Doe"
                        ],
                    },
                    "item": {
                        "quantity": 0,
                        "mixes": [
                            {
                                "items": [
                                    {
                                        "id": "b714118"
                                    },
                                    {
                                        "group_id": "g4"
                                    }
                                ],
                                "quantity": 0,
                                "reward_eligible": "true"
                            }
                        ],
                        "items": [
                            {
                                "id": "b714118",
                                "group_id": "B1"
                            }
                        ]
                    },
                    "store_ids": [
                        "sc029"
                    ],
                    "gross_amount": 0,
                    "currencies": [
                        {
                            "anything-but": [
                                "NOK"
                            ]
                        }
                    ],
                    "stamp": 5,
                    "discount_code": "TACO",
                    "store": {
                        "id": [
                            "sc029"
                        ],
                    },
                    "purchase_from": "2019-08-24T14:15:22Z",
                    "purchase_to": "2019-08-24T14:15:22Z"
                },
                "reward": {
                    "type": "discount_amount",
                    "value": 10000,
                    "base": "net",
                    "effect": "discount"
                },
                "metadata": {
                    "campaign_id": "V101",
                    "is_featured": "true",
                    "dintero:private_text:kind": "Gold"
                },
                "links": [
                    {
                        "href": "https://example.dintero.com/c/photos/2018/6_20_thumbnail_discount_image.png",
                        "rel": "thumbnail_discount_image"
                    }
                ]
            }

    ### discount_add_customers / discount_delete_customers

    The event is sent from discount service after a customer is added
    removed from the discount. The event will originate from
    [Add customer](/discounts-api/rules-customers/aid_discounts_did_customers_post),
    [Remove customer](/discounts-api/rules-customers/aid_discounts_did_customers_delete)
    or from an [automation](/discounts-api/rules-automations/aid_automations_rules_post)
    triggered.

    The receipt/automation property is only set if the customer
    was added to the discount by the automation.

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: discount_add_customers
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "discount_add_customers",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "created_at": "2018-01-10T08:49:20.533Z",
                "created_by": "API_USER",
                "id": "{customer_ref_discount_id}",
                "customer_id": "{customer_id}",
                "discount": {
                    "id": "{discount.id}"
                },
                "receipt": { "id": "{receipt.id}" ... },
                "automation": {
                    "created_at": "2018-03-19T15:04:42Z",
                    "created_by": "API_USER",
                    "id": "string",
                    "updated_at": "2018-03-19T15:04:42Z",
                    "events": ["customer_add"]
                }
            }

    ### discount_customer_update

    The event is sent from discount service after a customer discounts
    is updated. An update is triggered when discounts are used (receipt_add),
    claimed or if stamp is added to the discount (receipt_add).

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: discount_customer_update
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "discount_customer_update",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "created_by": "string",
                "created_at": "2022-01-01T00:00:00Z",
                "customer_id": "string",
                "claim": {
                    "id": "string"
                },
                "receipt": {
                    "id": "string"
                },
                "discounts": [
                    {
                        "id": "string",
                        "refs": [
                            {
                                "id": "string",
                                "stamp": 1337,
                                "amount": 10,
                                "usage": 1,
                                "bonus": 0,
                                "statistics": {
                                    "amount": 10,
                                    "bonus": 0,
                                    "debit_balance": 0,
                                    "stamp": 1640995200,
                                    "usage": 1
                                }
                            }
                        ]
                    }
                ]
            }

    ## Locations

    ### location_add / location_update / location_delete

    Location event sent from our customer service after a location is created,
    updated or deleted. All locations properties will be included in the event.

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: location_add
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9
            {
                "account_id": "P12341234",
                "event": "location_add",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "location": {
                    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                    "created_at": "2019-08-24T14:15:22Z",
                    "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                    "updated_at": "2019-08-24T14:15:22Z",
                    "location_id": "S01923",
                    "name": "TKP Store",
                    "timezone": "Europe/Oslo",
                    "status": "Active",
                    "language_code": "string",
                    "currency": "NOK",
                    "phone_number": "+4799999999",
                    "chain": "SuperChain",
                    "email": "saleslocation@example.com",
                    "mcc": "5814",
                    "gln": "string",
                    "organization_number": "123456789MVA",
                    "business_name": "TKP technology AS",
                    "franchise": "Subway",
                    "type": "string",
                    "website_url": "string",
                    "address": {
                        "address_line": "Sommerkroveien 34",
                        "address_line_2": "PB 123",
                        "postal_code": "0349",
                        "postal_place": "Oslo",
                        "country": "NO",
                        "latitude": 0,
                        "longitude": 0
                    }
                }
            }


    ## Receipts

    ### receipt_add / receipt_update

    Receipt event sent from receipts service after a receipt is added.
    The complete receipt will be included in the event.

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: receipt_add
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9
            {
                "account_id": "P12341234",
                "event": "receipt_add",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "created_at": "2018-01-10T07:57:42Z",
                "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
                "id": "2adb53e8-7f9b-44a4-8d5f-ed85d44cf02b",
                "purchase_at": "2018-01-10T07:57:42Z",
                "receipt_id": "714118",
                "store": {
                    "id": "sc029"
                }
            }

    ## Settlements

    ### settlement_add

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: settlement_add
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "settlement_add",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "settlement": {
                    "id": "string",
                    "account_id": "P12341234",
                    "settled_at": "2022-01-01T00:00:00.000Z",
                    "email_received_at": "2022-01-02T00:00:00.000Z",
                    "gateway": "vipps",
                    "created_at": "2022-01-03T00:00:00.000Z",
                    "updated_at": "2022-01-04T00:00:00.000Z",
                    "provider_reference": "123456789",
                    "payout_destination_id": "987654321",
                    "metadata": {
                        "attachments": [
                            {
                                "id": "attachment1",
                                "download_link": "https://example.com/attachment1",
                                "content_type": "application/pdf",
                                "extension": "pdf",
                                "created_by": "user1"
                            }
                        ],
                        "aggregation": [
                            {
                                "capture": 94000,
                                "amount": 30825,
                                "currency": "NOK",
                                "fee": -1175,
                                "refund": -62000
                            }
                        ],
                        "start_at": "2022-01-01T00:00:00.000Z",
                        "end_at": "2022-01-02T00:00:00.000Z"
                    }
                }
            }

    ## Shopping

    ### shopping_draft_add / shopping_draft_complete / shopping_draft_update

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: shopping_draft_add
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "shopping_draft_add",
                "event-delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "options": {
                    "order_time_to_live": 94672800,
                    "generate_order_id": "UUID",
                    "order_id": "string",
                    "replace": "order",
                    "split_draft": "false",
                    "serial_order_number_suffix": "false",
                    "multiple_authorizations": "false"
                },
                "order": {
                    "customer": {
                        "first_name": "John",
                        "last_name": "Doe",
                        "id": "string",
                        "email": "customer@example.com",
                        "phone_number": "+4799999999",
                        "addresses": [
                            {
                                "address_line": "Sommerkroveien 34",
                                "postal_place": Oslo,
                                "country": "NO"
                            }
                        ],
                        "enrolled_by": {
                            "type": "url",
                            "value": "https://facebook.com"
                        },
                        "type": "customer"
                    },
                    "shipping_address": {
                        "address_line": "Sommerkroveien 34",
                        "postal_place": "Oslo",
                        "country": "NO"
                    },
                    "billing_address": {
                        "address_line": "Sommerkroveien 34",
                        "postal_place": "Oslo",
                        "country": "NO"
                    },
                    "comment": "string",
                    "salesperson_id": "string",
                    "salesperson_name": "string",
                    "delivery_at": "2019-08-24T14:15:22Z",
                    "pickup_at": "2019-08-24T14:15:22Z",
                    "courier_id": "string",
                    "pre_order": "true",
                    "time_to_live": 94672800,
                    "items": [
                        {
                            "status": "string",
                            "id": "175938",
                            "groups": [
                                {
                                    "id": "B234",
                                    "name": "Stol"
                                },
                                {
                                    "id": "B1",
                                    "name": "Møbel"
                                }
                            ],
                            "line_id": 1,
                            "quantity": 2,
                            "gross_amount": 39800,
                            "tax_lines": [
                                {
                                    "amount": 5584,
                                    "percentage": 25,
                                    "tax_code": "3",
                                    "tax_group": "Vmva-høy"
                                }
                            ],
                            "description": "Stablestol for utendørsbruk",
                            "eligible_for_discount": "true",
                            "discount_lines": [
                                {
                                    "amount": 23130,
                                    "percentage": 10,
                                    "discount_type": "customer",
                                    "discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
                                    "description": "string",
                                    "line_id": 1
                                }
                            ]
                        }
                    ],
                    "type": "delivery",
                    "order_number": "order123456",
                    "currency": "NOK",
                    "order_id": "string",
                    "store": {
                        "id": "SL02"
                    }
                }
            }

    ### shopping_order_update / shopping_order_event_add / shopping_order_delete

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: shopping_order_update
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "account_id": "P12341234",
                "event": "shopping_order_update",
                "event-delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "customer": {
                    "first_name": "John",
                    "last_name": "Doe",
                    "id": "string",
                    "email": "customer@example.com",
                    "phone_number": "+4799999999",
                    "addresses": [
                        {
                            "address_line": "Sommerkroveien 34",
                            "postal_place": "Oslo",
                            "country": "NO"
                        }
                    ],
                    "status": "string",
                    "type": "customer"
                },
                "shipping_address": {
                    "address_line": "Sommerkroveien 34",
                    "postal_place": "Oslo",
                    "country": "NO"
                },
                "billing_address": {
                    "address_line": "Sommerkroveien 34",
                    "postal_place": "Oslo",
                    "country": "NO"
                },
                "delivery_at": "2019-08-24T14:15:22Z",
                "pickup_at": "2019-08-24T14:15:22Z",
                "courier_id": "string",
                "items": [
                    {
                        "status": "string",
                        "line_id": 1
                    }
                ]
            }

    ## Wallet

    ### wallet_transaction

    Wallet transaction event sent from wallets service after a transaction is created

        POST /
            User-Agent: Dintero-Hook/0c9ad03b
            Content-Type: application/json
            event: wallet_transaction
            event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

            {
                "event": "wallet_transaction",
                "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
                "created_at": "2017-11-30T08:12:20.533Z",
                "created_by": "API_USER",
                "id": "19657e92-9165-4b4f-92ab-2cd9cdef1525",
                "metadata": { },
                "ref_id": "0000359382",
                "amount": 69900,
                "currency": "NOK",
                "parent_id": null,
                "type": "drawdown",
                "account_id": "T00000000",
                "card_id": "1234567890"
            }
  contact:
    name: API Integration Support
    email: integration@dintero.com
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
security:
  - JWT: []
tags:
  - name: example-management-auth-events
    x-displayName: Accounts
    description: Accounts events
  - name: example-checkout-events
    x-displayName: Checkout
    description: Checkout events
paths:
  /accounts/{aid}/hooks/subscriptions:
    post:
      operationId: aid_source_hooks_post
      summary: aid_source_hooks_post
      description: |

        When you create a new webhook, we'll send you a simple ping event to
        let you know you've set up the webhook correctly.
        You can trigger a ping again by calling the
        [ping endpoint](/webhooks-api/subscription-deliveries/aid_source_hooks_hid_ping_post).

        ## Receiving Webhooks

        In order for Dintero to send webhook payloads, your server needs to be
        accessible from the Internet. We also highly suggest using SSL
        so that we can send encrypted payloads over HTTPS.

        ## Respond to a webhook

        Your webhook acknowledges that it received data by sending a 200 OK
        response. Any response outside of the 200 range will let Dintero
        know that you did not receive your webhook, including 301 Redirect.
        Dintero does not follow redirects for webhook notifications and will
        consider a redirection as an error response.

        Dintero has implemented a 60-second timeout period and a retry
        period for subscriptions. We wait 120 seconds for a response to
        each request, and if there isn't one or we get an error, we retry
        the connection to a total of 5 times.
        A webhook will be deleted if there are consecutive failures for the
        exact same webhook. You should monitor the admin of your webhook
        tool for failing webhooks.

        ### Webhooks Headers

        Dintero will send along several HTTP headers to differentiate between
        event types and payload identifiers.

        | Name           | Description                                          |
        |----------------|------------------------------------------------------|
        | event          | The event type                                       |
        | event-delivery | A guid to indentify the payload and event being sent |
        | event-signature| The value of this header is computed as the HMAC SHA1 hex digest of the body, using the secret config option as the key. |

        scopes:
        - admin:hooks
        - write:hooks
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - write:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Hook'
        description: subscription configuration
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Subscription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create subscription
          sidebarTitle: Create subscription
    get:
      operationId: aid_source_hooks_get
      summary: aid_source_hooks_get
      description: |
        Get a list of all subscriptions

        scopes:
        - admin:hooks
        - read:hooks
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: include_deleted
          description: |
            include deleted subscriptions in the response.
          in: query
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/total'
      security:
        - JWT: []
      responses:
        '200':
          description: Subscriptions
          headers:
            page-count:
              description: |
                count object in response
              schema:
                type: integer
            total-count:
              description: |
                total count, only set if query parameter
                `total` is set
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Hook'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List subscriptions
          sidebarTitle: List subscriptions
  /accounts/{aid}/hooks/subscriptions/{hid}:
    get:
      operationId: aid_source_hooks_hid_get
      summary: aid_source_hooks_hid_get
      description: |
        Get subscription details

        scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - read:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get subscription details
          sidebarTitle: Get subscription details
    delete:
      operationId: aid_source_hooks_hid_delete
      summary: aid_source_hooks_hid_delete
      description: |
        Delete a webhook subscription

        No more events will be sent to the webhook

        scopes:
        - admin:hooks
        - write:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - write:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Subscription deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete Subscription
          sidebarTitle: Delete Subscription
  /accounts/{aid}/hooks/subscriptions/{hid}/deliveries:
    get:
      operationId: aid_source_hooks_hid_deliveries_get
      summary: aid_source_hooks_hid_deliveries_get
      description: |
        Get recent subscription deliveries

        scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscription deliveries
      x-scopes:
        - admin:hooks
        - read:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Deliveries Collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HookDelivery'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List subscription deliveries
          sidebarTitle: List subscription deliveries
  /accounts/{aid}/hooks/subscriptions/{hid}/deliveries/{delivery_id}:
    get:
      operationId: aid_source_hooks_hid_deliveries_did_get
      summary: aid_source_hooks_hid_deliveries_did_get
      description: |
        Get subscription delivery details

        scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
        - name: delivery_id
          in: path
          required: true
          description: delivery id
          schema:
            type: string
      tags:
        - subscription deliveries
      x-scopes:
        - admin:hooks
        - read:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Deliveries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HookDeliveryDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get delivery details
          sidebarTitle: Get delivery details
  /accounts/{aid}/hooks/subscriptions/{hid}/ping:
    post:
      operationId: aid_source_hooks_hid_ping_post
      summary: aid_source_hooks_hid_ping_post
      description: |
        This will trigger a ping event to be sent to the subscription URL.

        ### Ping Event Payload

        ```http
        POST /
        User-Agent: Dintero-Hook/0c9ad03b
        Content-Type: application/json
        event: ping
        event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

        {
          "created_at": "2017-12-06T15:36:43Z",
          "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
          "id": "string",
          "updated_at": "2017-12-06T15:36:43Z",
          "active": true,
          "config": {
            "content_type": "application/json",
            "insecure_ssl": 0,
            "secret": { ... }
            "url": "string"
          },
          "events": ["receipt_add"]
        }
        ```
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscription deliveries
      x-scopes:
        - admin:hooks
        - write:hooks
      security:
        - JWT: []
      responses:
        '204':
          headers:
            event-delivery:
              schema:
                type: string
          description: No Content
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Subscription ping
          sidebarTitle: Subscription ping
  /examples/approval_payout_destination_update:
    post:
      operationId: example_approval_payout_destination_update_event
      summary: example_approval_payout_destination_update_event
      description: |
        Event is pushed to subscribers when the `case_status`
        of a seller approval changes
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: approval_payout_destination_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalPayoutDestinationUpdateEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: approval_payout_destination_update
          sidebarTitle: approval_payout_destination_update
  /examples/approval_payout_destination_delete:
    post:
      operationId: example_approval_payout_destination_update_delete
      summary: example_approval_payout_destination_update_delete
      description: |
        Event is pushed to subscribers when the approval is archived
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: approval_payout_destination_delete
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalPayoutDestinationDeleteEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: approval_payout_destination_delete
          sidebarTitle: approval_payout_destination_delete
  /examples/cdd_case_update:
    post:
      operationId: example_cdd_case_update_event
      summary: example_cdd_case_update_event
      description: |
        Event is pushed to subscribers when a CDD case changes status.

        Note that the event will only include one of
        `payout_destination_case` or `payment_case` never both
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: cdd_case_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CddCaseUpdateEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: cdd_case_update
          sidebarTitle: cdd_case_update
  /examples/checkout_transaction:
    post:
      operationId: example_checkout_transaction_event
      summary: example_checkout_transaction_event
      description: |
        Event is pushed to subscribers when the checkout transaction is created or
        updated
      tags:
        - example-checkout-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: checkout_transaction_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutTransactionEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: checkout_transaction
          sidebarTitle: checkout_transaction
  /examples/checkout_authorization:
    post:
      operationId: example_checkout_authorization_event
      summary: example_checkout_authorization_event
      description: |
        Event is pushed to subscribers when a transaction was authorized
        or failed authorization

        > The deliveries match what is delivered to the session callback_url
        > with `report_error=true` set
      tags:
        - example-checkout-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: checkout_authorization
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutAuthorizationEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: checkout_authorization
          sidebarTitle: checkout_authorization
  /examples/checkout_token:
    post:
      operationId: example_checkout_token_event
      summary: example_checkout_token_event
      description: |
        Event is pushed to subscribers when the checkout token is created, \
        updated or deleted
      tags:
        - example-checkout-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: checkout_token_add
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutTokenEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: checkout_token_*
          sidebarTitle: checkout_token_*
  /examples/account_store_add:
    post:
      operationId: example_account_store_add_event
      summary: example_account_store_add_event
      description: |
        Event is pushed to subscribers when a new store is added to the account
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: account_store_add
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountStoreAddEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: account_store_add
          sidebarTitle: account_store_add
  /examples/account_store_update:
    post:
      operationId: example_account_store_update_event
      summary: example_account_store_update_event
      description: |
        Event is pushed to subscribers when a store is updated
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: account_store_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountStoreUpdateEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: account_store_update
          sidebarTitle: account_store_update
  /examples/account_store_delete:
    post:
      operationId: example_account_store_delete_event
      summary: example_account_store_delete_event
      description: |
        Event is pushed to subscribers when a store is deleted
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: account_store_delete
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountStoreDeleteEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: account_store_delete
          sidebarTitle: account_store_delete
  /examples/account_payout_destination_add:
    post:
      operationId: example_account_payout_destination_add_event
      summary: example_account_payout_destination_add_event
      description: |
        Event is pushed to subscribers when a payout destination is added
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: account_payout_destination_add
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountPayoutDestinationAddEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: account_payout_destination_add
          sidebarTitle: account_payout_destination_add
  /examples/account_payout_destination_update:
    post:
      operationId: example_account_payout_destination_update_event
      summary: example_account_payout_destination_update_event
      description: |
        Event is pushed to subscribers when a payout destination is updated
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: account_payout_destination_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountPayoutDestinationUpdateEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: account_payout_destination_update
          sidebarTitle: account_payout_destination_update
  /examples/account_payout_destination_delete:
    post:
      operationId: example_account_payout_destination_delete_event
      summary: example_account_payout_destination_delete_event
      description: |
        Event is pushed to subscribers when a payout destination is deleted
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: account_payout_destination_delete
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountPayoutDestinationDeleteEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: account_payout_destination_delete
          sidebarTitle: account_payout_destination_delete
x-tagGroups:
  - name: event examples
    tags:
      - example-management-auth-events
      - example-checkout-events
  - name: webhooks
    tags:
      - subscriptions
      - subscription deliveries
servers:
  - url: https://api.dintero.com/v1
components:
  parameters:
    accountId:
      name: aid
      description: |
        An id that uniquely identifies the account.
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{8}$
        minLength: 9
        maxLength: 9
    limit:
      name: limit
      in: query
      description: |
        A limit on the number of objects to be returned. Limit can range
        between 1 and 100 items, and the default is 10 items.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
    startingAfter:
      name: starting_after
      in: query
      description: |
        cursor for use in pagination. starting_after is an object ID
        that defines your place in the list. For instance, if you make
        a list request and receive 100 objects, end the result contains
          `paging_token=pt1`, your subsequent call can include
        `starting_after=pt1` in order to fetch the next page of the list.
      required: false
      schema:
        type: string
    total:
      name: total
      in: query
      description: |
        include `total-count` header in the response
      required: false
      schema:
        type: boolean
        default: false
    subscriptionId:
      name: hid
      description: subscription id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    AccessForbidden:
      description: Access forbidden, invalid JWT token was used
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad / Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    JWT:
      type: http
      description: |
        Bearer authentication (token authentication) should be used for accessing the API.

        Use [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post) to get an access token for client credentials.
        Pass the token in the request header:

            Authorization: Bearer {access_token}

        where the **access_token** is JSON Web Tokens (JWT).
      scheme: bearer
      bearerFormat: JWT
  schemas:
    HMAC-SHA1:
      type: object
      description: Sign all requests with HMAC SHA1, signature added to `event-signature` header.
      x-discriminator-value: HMAC-SHA1
      allOf:
        - $ref: '#/components/schemas/SecretBase'
        - required:
            - value
          properties:
            value:
              type: string
              description: |
                Use the value to compute HMAC SHA1 hex digest of
                the body and pass it with the HTTP requests as
                an `event-signature` header.
            type:
              type: string
              enum:
                - HMAC-SHA1
      title: HMAC-SHA1
    AWS4-HMAC-SHA256:
      type: object
      description: |
        Sign all requests with AWS Signature Version 4.
      x-discriminator-value: AWS4-HMAC-SHA256
      allOf:
        - $ref: '#/components/schemas/SecretBase'
        - required:
            - aws_access_key_id
            - aws_secret_access_key
            - region
            - service
          properties:
            aws_access_key_id:
              type: string
              description: AWS access key
              example: AKIAIOSFODNN7EXAMPLE
            aws_secret_access_key:
              type: string
              description: AWS secret key
              example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
            region:
              type: string
              example: eu-west-1
            service:
              type: string
              example: execute-api
            type:
              type: string
              enum:
                - AWS4-HMAC-SHA256
      title: AWS4-HMAC-SHA256
    Authorization:
      type: object
      description: |
        Include Authorization header on all requests
      x-discriminator-value: Authorization
      allOf:
        - $ref: '#/components/schemas/SecretBase'
        - required:
            - value
          properties:
            value:
              type: string
              example: Bearer <token>
            type:
              type: string
              enum:
                - Authorization
      title: Authorization
    CheckoutTokenEvent:
      discriminator:
        propertyName: event
        mapping:
          checkout_token_add: '#/components/schemas/CheckoutTokenAddEvent'
          checkout_token_update: '#/components/schemas/CheckoutTokenUpdateEvent'
          checkout_token_delete: '#/components/schemas/CheckoutTokenDeleteEvent'
      oneOf:
        - $ref: '#/components/schemas/CheckoutTokenAddEvent'
        - $ref: '#/components/schemas/CheckoutTokenUpdateEvent'
        - $ref: '#/components/schemas/CheckoutTokenDeleteEvent'
    CheckoutTokenAddEvent:
      type: object
      x-discriminator-value: checkout_token_add
      allOf:
        - $ref: '#/components/schemas/CheckoutTokenEventBase'
        - type: object
          required:
            - token
          properties:
            event:
              type: string
              enum:
                - checkout_token_add
            token:
              $ref: '#/components/schemas/CardTokenAdd'
      title: checkout_token_add
    CheckoutTokenUpdateEvent:
      type: object
      x-discriminator-value: checkout_token_update
      allOf:
        - $ref: '#/components/schemas/CheckoutTokenEventBase'
        - type: object
          required:
            - token
          properties:
            event:
              type: string
              enum:
                - checkout_token_update
            token:
              $ref: '#/components/schemas/CardTokenUpdate'
      title: checkout_token_update
    CheckoutTokenDeleteEvent:
      type: object
      x-discriminator-value: checkout_token_delete
      allOf:
        - $ref: '#/components/schemas/CheckoutTokenEventBase'
        - type: object
          required:
            - token
          properties:
            event:
              type: string
              enum:
                - checkout_token_delete
            token:
              $ref: '#/components/schemas/CardTokenDelete'
      title: checkout_token_delete
    AccountPayoutDestinationUpdateEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - payout_destination
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: account_payout_destination_update
          enum:
            - account_payout_destination_update
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        payout_destination:
          $ref: '#/components/schemas/AccountPayoutDestination'
    Entity:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        deleted_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
    Secret:
      discriminator:
        propertyName: type
        mapping:
          HMAC-SHA1: '#/components/schemas/HMAC-SHA1'
          AWS4-HMAC-SHA256: '#/components/schemas/AWS4-HMAC-SHA256'
          Authorization: '#/components/schemas/Authorization'
      oneOf:
        - $ref: '#/components/schemas/HMAC-SHA1'
        - $ref: '#/components/schemas/AWS4-HMAC-SHA256'
        - $ref: '#/components/schemas/Authorization'
    Hook:
      type: object
      description: |
        Configuration for a webhook
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - config
            - events
          properties:
            active:
              type: boolean
              description: |
                Determines whether the hook is actually triggered.
              default: true
            config:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: |
                    A required string defining the URL to which
                    the payloads will be delivered.

                    The URL must be public available and you cannot use the
                    following as value:

                      - localhost
                      - "fake" domains like www.example.com
                      - Dintero domains (i.e. dintero.com)
                content_type:
                  type: string
                  default: application/json
                  enum:
                    - application/json
                secret:
                  $ref: '#/components/schemas/Secret'
                insecure_ssl:
                  type: integer
                  description: |
                    An optional string that determines whether the
                    SSLcertificate of the host for url will be
                    verified when delivering payloads. Supported
                    values include `"0"` (verification is performed)
                    and `"1"` (verification is not performed).
                    The default is `"0"`.
                  default: 0
            fields:
              type: string
              description: |
                Limit the event data included in the delivery

                The syntax is loosely based on XPath:
                - a,b,c comma-separated list will select multiple fields
                - a/b/c path will select a field from its parent
                - a(b,c) sub-selection will select many fields from a parent
                - a/*/c the star * wildcard will select all items in a field
              example: account(partner_id,account_id,created_at)
              format: field-mask
            exclude_fields:
              type: array
              description: |
                Limit the event data included in the delivery
              example:
                - customer_ip
                - billing_address
              items:
                type: string
                minItems: 1
                maxItems: 20
                maxLength: 50
                format: field-name
            events:
              type: array
              items:
                type: string
                minItems: 1
                enum:
                  - account_add
                  - account_update
                  - account_store_add
                  - account_store_update
                  - account_store_delete
                  - account_payout_destination_add
                  - account_payout_destination_update
                  - account_payout_destination_delete
                  - receipt_add
                  - receipt_update
                  - customer_add
                  - customer_update
                  - customer_delete
                  - customer_change_password
                  - token_add
                  - token_remove
                  - transaction
                  - wallet_transaction
                  - discount_add
                  - discount_update
                  - discount_delete
                  - discount_add_customers
                  - discount_customer_update
                  - shopping_draft_add
                  - shopping_draft_update
                  - shopping_draft_complete
                  - shopping_order_update
                  - shopping_order_event_add
                  - shopping_order_delete
                  - settlement_add
                  - location_add
                  - location_delete
                  - location_update
                  - cdd_case_update
                  - approval_payout_destination_update
                  - approval_payout_destination_delete
                  - checkout_authorization
                  - checkout_transaction
                  - checkout_token_add
                  - checkout_token_update
                  - checkout_token_delete
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            code:
              type: string
              description: The code used to identify the error/warning
            errors:
              type: array
              description: The nested error(s) encountered during validation
              items:
                type: object
            message:
              type: string
              description: The human readable description of the error/warning
    HookDelivery:
      type: object
      properties:
        id:
          type: string
        event_delivery:
          type: string
        created_at:
          type: string
          format: date-time
        status:
          type: integer
          description: |
            HTTP status code
          example: 200
    HookDeliveryDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/HookDelivery'
        - properties:
            url:
              type: string
              description: |
                The payload URL
            request:
              type: object
              properties:
                headers:
                  type: object
                  properties:
                    event:
                      type: string
                    event-delivery:
                      type: string
                    event-signature:
                      type: string
                body:
                  type: object
            response:
              type: object
              properties:
                headers:
                  type: object
                body:
                  type: string
                  nullable: true
            details:
              type: object
              properties:
                delivery_at:
                  type: string
                  format: date-time
                delivery_duration:
                  type: number
                  example: 848
                delivery_success:
                  type: boolean
                  example: true
    PayoutDestinationUpdateBase:
      type: object
      description: |
        The seller approval case that was updated
      required:
        - id
        - created_at
        - updated_at
        - payout_destination_id
        - payout_reference
        - organization_number
        - case_status
      properties:
        id:
          type: string
          format: uuid
          example: 497f6eca-6276-4993-bfeb-53cbbbba6f08
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        updated_at:
          type: string
          format: date-time
        payout_destination_id:
          type: string
        payout_destination_name:
          type: string
        payout_destination_description:
          type: string
        payout_reference:
          type: string
        organization_number:
          type: string
        case_status:
          type: string
          enum:
            - ACTIVE
            - DECLINED
            - UNDER_MANUAL_REVIEW
            - AUTOMATIC_REVIEW
            - WAITING_FOR_SIGNATURE
            - WAITING_FOR_DECLARATION
            - ERROR
    ApprovalPayoutDestinationUpdateEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - payout_destination_case
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: approval_payout_destination_update
          enum:
            - approval_payout_destination_update
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        payout_destination_case:
          allOf:
            - $ref: '#/components/schemas/PayoutDestinationUpdateBase'
            - description: |
                The seller approval case that was updated
              required:
                - case_status
              properties:
                case_status:
                  enum:
                    - ACTIVE
                    - DECLINED
                    - UNDER_MANUAL_REVIEW
                    - AUTOMATIC_REVIEW
                    - WAITING_FOR_SIGNATURE
                    - WAITING_FOR_DECLARATION
                    - ERROR
    ApprovalPayoutDestinationDeleteEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - payout_destination_case
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: approval_payout_destination_delete
          enum:
            - approval_payout_destination_delete
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        payout_destination_case:
          allOf:
            - $ref: '#/components/schemas/PayoutDestinationUpdateBase'
            - description: |
                The seller approval case that was deleted
              required:
                - deleted_at
                - deleted_by
                - case_status
              properties:
                deleted_at:
                  type: string
                  format: date-time
                deleted_by:
                  type: string
                case_status:
                  type: string
                  enum:
                    - ARCHIVED
    AccountJwks:
      type: object
      properties:
        jwks:
          readOnly: true
          description: |
            Alternative JWKS configured for validating access token issued by
            external authentication.
          required:
            - name
            - uri
          properties:
            name:
              description: |
                Short name identifying the issuer.
              type: string
            uri:
              type: string
              format: uri
              example: https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json
    ApprovalStatus:
      type: string
      enum:
        - ACTIVE
        - DECLINED
        - UNDER_MANUAL_REVIEW
        - AUTOMATIC_REVIEW
        - WAITING_FOR_SIGNATURE
        - WAITING_FOR_DECLARATION
        - ERROR
        - ARCHIVED
        - WAITING_FOR_DETAILS
        - TERMINATED
    AccountPaymentSummary:
      type: object
      properties:
        payment_case_status:
          allOf:
            - $ref: '#/components/schemas/ApprovalStatus'
            - readOnly: true
        projected_sales:
          type: string
          readOnly: true
          description: Projected sales declared by merchant.
        average_transaction_value:
          type: string
          readOnly: true
        merchant_category_code:
          type: string
          readOnly: true
          description: Merchant category code declared by merchant.
          format: mcc
        delivery_timeline:
          type: string
          readOnly: true
          enum:
            - P0W
            - P1D
            - P2D
            - P5D
            - P2W
            - P4W
            - P12W
            - P1Y
        most_expensive_product_price:
          type: string
          readOnly: true
          description: Price of most expensive product declared by merchant.
        gift_card_revenue_percentage:
          type: string
          readOnly: true
          description: |
            Percentage of revenue coming from gift card transactions
            declared by merchant.
        credit_rating:
          type: string
          readOnly: true
          description: The most recent credit rating of the merchant.
        prev_credit_rating:
          type: string
          readOnly: true
          description: The previous credit rating of the merchant.
        currency:
          type: string
          enum:
            - NOK
            - SEK
            - DKK
            - EUR
          readOnly: true
          description: |
            The currency of the various values declared by the merchant, such as
            `most_expensive_product_price`, `average_transaction_value`, and so on.
    AccountAgreement:
      type: object
      description: |
        Defines an terms and conditions agreement between
        a company or user and Dintero
      properties:
        name:
          description: Defines the name of the agreement
          type: string
        version:
          description: Defines the version of the agreement
          type: string
        personal_guarantee_accepted:
          description: |
            The applicant/user has read and accepted the terms of
            a personal guarantee.
          type: boolean
        attachments:
          description: attachment policies
          type: array
          items:
            type: object
            properties:
              name:
                description: Defines the name of the attachment
                type: string
                example: Cookie Policy
              version:
                description: Defines the version of the attachment
                type: string
    UtmCampaign:
      type: object
      title: campaign
      properties:
        utm_source:
          type: string
          title: Campaign Source
          description: |
            Use utm_source to identify a search engine, newsletter name,
            or other source.
          example: google
        utm_medium:
          type: string
          title: Campaign Medium
          description: |
            Use utm_medium to identify a medium such as email or cost-per- click.
          example: cpc
        utm_campaign:
          type: string
          title: Campaign Name
          description: |
            Used for keyword analysis. Use utm_campaign to identify a
            specific product promotion or strategic campaign.
          example: spring_sale
        utm_term:
          type: string
          title: Campaign Term
          description: |
            Used for paid search. Use utm_term to note the keywords
            for this ad.
          example: running+shoes
        utm_content:
          type: string
          title: Campaign Content
          description: |
            Used for A/B testing and content-targeted ads. Use utm_content
            to differentiate ads or links that point to the same URL.
          example: textlink
    AccountApplicant:
      type: object
      required:
        - email
        - agreement
      properties:
        first_name:
          type: string
          example: John
        last_name:
          type: string
          example: Doe
        email:
          type: string
          example: customer@example.com
        phone_number:
          type: string
          description: |
            A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        agreement:
          $ref: '#/components/schemas/AccountAgreement'
        recaptcha_sitekey:
          type: string
          description: |
            The public site key used for reCAPTCHA
          example: 6LdE_pIUAAAAAHbiL0uHjHg2Mgn2IILTvZdA_Ux-
        recaptcha_response:
          type: string
          description: |
            A response from a reCAPTCHA check
          example: 03AOLTBLSbzmXKXuAz9N--DsZ1xWmhfx6okCheBPesOsNmRSdkfcO4E5CkeBQQFJkC_emfE_KF0P8C3T57Nr9eOon_PVTEIq1NUpRS5oGkGMhr1vxVe1F7txMYUc4ClxUDLxWiW5WgnDvWHC7gOnlJZKvxVE4gn7qAJijE6SFMXkvFOwoWcx_kONmBHGnXHGgxIe2M8G-FkIKr0WZbQIDYmDaiQxb6mL1L70UGOyO280v2Pp65JB1mSohdeJLdQhHeye6v6__H9_M0GxDGd8s-LoLUY5Vq9hKbAs8MCsh2OFwtpbTYGfqmDbTwsc2v8SqOOZ86uKXwl7gyk3RHXT27m8Rv8iZAs2Ym5w
        promo_code:
          type: string
          description: Promotion code
        signup_reference:
          type: string
          description: An optional reference that can be used to identify the signup when the account has been created.
        utm:
          $ref: '#/components/schemas/UtmCampaign'
    Address:
      type: object
      required:
        - address_line
        - postal_place
        - country
      properties:
        address_line:
          type: string
          example: Sommerkroveien 34
        address_line_2:
          type: string
          example: PB 123
        postal_code:
          type: string
          example: '0349'
        postal_place:
          type: string
          example: Oslo
        country:
          type: string
          format: iso-3166-1
          description: |
            ISO 3166-1 country code
          example: 'NO'
    AccountCompanyTerms:
      description: |
        Terms of company account.
      type: object
      properties:
        type:
          type: string
          enum:
            - all
            - sales
            - cookies
            - privacy
        href:
          type: string
          format: uri
    AccountCompanyContact:
      description: |
        Contact details for a company.
      type: object
      properties:
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        email:
          type: string
          format: email
        website:
          type: string
          format: uri
        type:
          type: string
          enum:
            - support
            - disputes
    AccountCompany:
      description: |
        The details of an account company
      type: object
      required:
        - business_name
        - address
      properties:
        business_name:
          type: string
          example: TKP tech AS
        display_name:
          type: string
          example: TKP tech instore AS
          description: The name of the company as displayed in Dintero systems. If not set, defaults to business_name.
        organization_number:
          type: string
          description: Companys identification number
          example: 123456789MVA
        industry:
          type: string
          example: computer industry
        website:
          type: string
          format: uri
          maxLength: 120
        terms_url:
          type: string
          format: uri
          maxLength: 240
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        address:
          $ref: '#/components/schemas/Address'
        email:
          type: string
          format: email
          example: contact@business.dintero.com
        technical_email:
          type: string
          format: email
          example: tech_support@business.dintero.com
          description: |
            Technical email. Dintero will use this email when contacting
            the company about technical issues.
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            mobile number of a person / company, ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        branding:
          type: object
          properties:
            icon_url:
              description: |
                Url to icon. The image should have equal height and width, around 50px.

                Will be used to personalize the backoffice and checkout.
              type: string
              format: uri
              maxLength: 240
            logo_url:
              description: |
                Url to logo. Will be used in receipts, emails, etc.
              type: string
              format: uri
              maxLength: 240
        merchant_category_code:
          type: string
          format: mcc
        average_transaction_value:
          type: string
        most_expensive_product_price:
          type: string
        projected_sales:
          type: string
        terms:
          type: array
          description: |
            Terms of company account. If `terms_url` is set, this property will include a term of type `all` that corresponds to the `terms_url`.
            If the opposite is true, `terms_url` will be set corresponding to the first term of type `all`.
          items:
            allOf:
              - $ref: '#/components/schemas/AccountCompanyTerms'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/AccountCompanyContact'
        public_business_name:
          type: string
          example: TKP tech
          description: Public name of the business, as displayed to customers
    AccountBillingStatement:
      description: |
        The details of the billing statement for the account
      type: object
      properties:
        name:
          type: string
          description: The name to be displayed on the billing statement
          minLength: 2
          maxLength: 22
          example: John Doe
        phone_number:
          type: string
          description: |
            The phone number to be displayed on the billing statement, ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
          pattern: ^\+?\d{5,15}$
          example: '+4745454545'
    AccountBilling:
      description: |
        The details of the billing for the account
      type: object
      required:
        - business_name
        - address
      properties:
        business_name:
          type: string
          example: TKP tech AS
        organization_number:
          type: string
          description: Companys identification number
          example: 123456789MVA
        address:
          $ref: '#/components/schemas/Address'
        email:
          description: Billing email
          type: string
          example: billing@business.dintero.com
        reference:
          description: Billing reference
          type: string
          maxLength: 120
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            mobile number of a person / company, ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        billing_statement:
          $ref: '#/components/schemas/AccountBillingStatement'
    Subscription:
      type: object
      description: Subscription plan for the account
      required:
        - interval
        - plan
      properties:
        interval:
          type: string
          description: |
            The frequency with which a subscription should be billed.
          enum:
            - month
            - year
        plan:
          type: string
          description: |
            The price plan which a billing is based on
          enum:
            - transaction_fee
            - per_customer_fee
        support:
          type: string
          description: The support service enabled
          enum:
            - office_hours
            - 24_7_extended
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to a subscription
            object. It can be useful for storing additional information about
            the subscription in a structured format.
    Attachment:
      description: |
        An attachment is a file or document associated with a reference and a uri.
      type: object
      required:
        - ref
        - href
      properties:
        ref:
          type: string
          description: |
            The reference to the attachment.
        href:
          type: string
          format: uri
          description: |
            The URI of the attachment.
    Account:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/AccountJwks'
        - $ref: '#/components/schemas/AccountPaymentSummary'
        - required:
            - applicant
            - company
            - billing
          properties:
            applicant:
              description: The individual completing the account registration
              allOf:
                - $ref: '#/components/schemas/AccountApplicant'
                - properties:
                    agreement:
                      type: object
                      properties:
                        accepted_at:
                          description: |
                            defines the date of the account terms and conditions
                            agreement in ISO 8601 format with a timezone
                          type: string
                          format: date-time
                          readOnly: true
            company:
              $ref: '#/components/schemas/AccountCompany'
            billing:
              $ref: '#/components/schemas/AccountBilling'
            subscription:
              $ref: '#/components/schemas/Subscription'
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/Attachment'
            account_id:
              type: string
              description: The id that uniquely identifies the account.
              readOnly: true
            partner_id:
              type: string
              description: The id of the partner associated with the account
              format: ^[PT]{1}(?=(?:.{3})$)[0-9]*$
              readOnly: true
            livemode:
              type: boolean
              description: |
                Flag indicating whether the account exists in live
                mode and test mode.
              default: false
            active:
              type: boolean
              description: The account is active
              default: false
              readOnly: true
            language_code:
              type: string
              description: |
                The preferred language for the account as defined by
                <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
                (IETF BCP 47, "Tags for Identifying Languages").
            platform_type:
              type: string
              description: |
                Optional type of platform for merchants using split payout.
              readOnly: true
              enum:
                - marketplace
                - aggregator
            allowed_merchant_category_codes:
              type: array
              description: Restricts the MCC codes available for selection during merchant onboarding.
              items:
                type: string
                pattern: ^\d{4}$
    ReportedVolume:
      type: object
      required:
        - type
        - period
        - currency
        - volume
        - count
      properties:
        type:
          type: string
          enum:
            - monthly
            - weekly
        period:
          type: string
          description: |
            Format depend on type, e.g. `2023-09` for monthly and `2023-W40`
            for weekly
          format: iso-8601
        currency:
          type: string
          format: iso-4217
        volume:
          type: integer
        count:
          type: integer
    ServiceFeatureStatus:
      type: string
      description: |
        Whether the feature is operational

        **enabled**
        > Indicates that the Feature might be used

        **pending**
        > Indicates that the Feature can't be used but that the `status`
        > eventually changes to either `declined` or `enabled` without
        > user intervention.

        **disabled**
        > Indicates that the Feature have been disabled

        **declined**
        > Indicates that the Feature can't be used and either requires some
        > action by the user or is permanently disabled
      enum:
        - declined
        - disabled
        - enabled
        - pending
    ServiceFeature:
      type: object
      required:
        - requested
        - status
      properties:
        created_by:
          type: string
          readOnly: true
        created_at:
          type: string
          format: datetime
          readOnly: true
        updated_by:
          type: string
          readOnly: true
        updated_at:
          type: string
          format: datetime
          readOnly: true
        requested:
          type: string
          enum:
            - enable
            - disable
        status:
          $ref: '#/components/schemas/ServiceFeatureStatus'
    CheckoutServiceFeatures:
      type: object
      properties:
        applepay:
          $ref: '#/components/schemas/ServiceFeature'
        billie:
          $ref: '#/components/schemas/ServiceFeature'
        clicktopay:
          $ref: '#/components/schemas/ServiceFeature'
        collector:
          $ref: '#/components/schemas/ServiceFeature'
        creditcard:
          $ref: '#/components/schemas/ServiceFeature'
        googlepay:
          $ref: '#/components/schemas/ServiceFeature'
        instabank:
          $ref: '#/components/schemas/ServiceFeature'
        klarna:
          $ref: '#/components/schemas/ServiceFeature'
        mobilepay:
          $ref: '#/components/schemas/ServiceFeature'
        santander:
          $ref: '#/components/schemas/ServiceFeature'
        swish:
          $ref: '#/components/schemas/ServiceFeature'
        vipps:
          $ref: '#/components/schemas/ServiceFeature'
        kravia:
          $ref: '#/components/schemas/ServiceFeature'
        two:
          $ref: '#/components/schemas/ServiceFeature'
        ipp:
          allOf:
            - $ref: '#/components/schemas/ServiceFeature'
            - type: object
              properties:
                sandbox_requested:
                  type: string
                  enum:
                    - enable
                    - disable
                sandbox_status:
                  $ref: '#/components/schemas/ServiceFeatureStatus'
    AccountService:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        updated_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        status:
          type: string
          enum:
            - enabled
            - disabled
        progression:
          type: string
          enum:
            - not_applied
            - applied
            - live
            - frozen
            - deactivated
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to a subscription
            object. It can be useful for storing additional information about
            the subscription in a structured format.
    PayoutServiceFeatures:
      type: object
      description: |
        Payout features
      properties:
        split_payment:
          $ref: '#/components/schemas/ServiceFeature'
        daily_payouts:
          $ref: '#/components/schemas/ServiceFeature'
    PayoutAccountService:
      allOf:
        - $ref: '#/components/schemas/AccountService'
        - properties:
            features:
              $ref: '#/components/schemas/PayoutServiceFeatures'
    AccountPrivateDetails:
      type: object
      description: |
        Account properties that are private and managed by the
        root partner.
      properties:
        progression:
          type: string
          enum:
            - applied
            - live
            - frozen
            - deactivated
          description: |
            Status assigned to the account by the account partner
            > value is not visible for the merchant.
        reseller_id:
          type: string
          description: |
            Reseller id assigned by the account partner
            > value is not visible for the merchant
          example: DINTERO_ACCOUNT:99900000
        account_manager:
          type: object
          required:
            - email
          description: |
            Account manager responsible for the account.
            > value is not visible for the merchant
          properties:
            email:
              type: string
              example: employee@dintero.com
        permissions:
          description: List the permission granted the account
          type: array
          items:
            type: object
            required:
              - effect
              - action
            properties:
              effect:
                type: string
                enum:
                  - allow
                  - deny
              action:
                type: array
                minItems: 1
                maxItems: 1
                items:
                  type: string
                  enum:
                    - checkout:auto_capture
                    - notifications:publish
        sale_channel:
          type: string
          enum:
            - DIRECT
            - INBOUND
            - PARTNER
            - REFERRAL
        price_package:
          type: string
        statistics:
          type: object
          description: Statistics for the account
          properties:
            checkout_captures:
              description: Statistics about transactions captured
              type: array
              readOnly: true
              items:
                $ref: '#/components/schemas/ReportedVolume'
              example:
                - type: monthly
                  periode: 2023-09
                  currency: NOK
                  volume: 3921930
                  count: 131
                - type: weekly
                  periode: 2023-W33
                  currency: NOK
                  volume: 980482
                  count: 32
            metrics:
              description: key metrics about the account
              properties:
                checkout:transaction:first_capture_at:
                  type: string
                  format: datetime
                checkout:transaction:last_capture_at:
                  type: string
                  format: datetime
        services:
          type: object
          properties:
            checkout:
              type: object
              required:
                - features
              properties:
                features:
                  $ref: '#/components/schemas/CheckoutServiceFeatures'
            payout:
              required:
                - features
              properties:
                features:
                  $ref: '#/components/schemas/PayoutAccountService'
    AccountConnectionEvent:
      type: object
      required:
        - status
        - event
      properties:
        id:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          readOnly: true
        status:
          type: string
          enum:
            - pending
            - enabled
            - failed
            - declined
        event:
          type: string
          example: signature_required
        description:
          description: short description about the event
          type: string
          example: Vipps awaiting signature
        metadata:
          maxProperties: 40
          description: |
            A set of key/values that you can attach to a connection
            event.
          example:
            signature_link: https://sig.example.com/K34K244
    AccountConnectionMeta:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to a subscription
            object. It can be useful for storing additional information about
            the subscription in a structured format.
        status:
          description: |
            The status of the connection
          type: string
          enum:
            - pending
            - enabled
            - failed
            - declined
        events:
          description: |
            List of events recorded, an event is created when the
            connection is updated with new status
          type: array
          items:
            $ref: '#/components/schemas/AccountConnectionEvent'
        schema:
          type: number
          description: |
            The version of the schema used for the connection
          readOnly: true
    AccountConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnectionMeta'
        - properties:
            configuration:
              type: object
              required:
                - payment_options
              properties:
                payment_options:
                  description: |
                    Payment options supported by this connection
                  type: array
                  items:
                    type: object
                    required:
                      - currencies
                      - type
                    properties:
                      currencies:
                        type: array
                        items:
                          type: string
                          format: iso4217-code
                          example: NOK
                      type:
                        type: string
    ApplePayPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero_psp.applepay
          details:
            type: object
            description: |
              Configuration details for the payment option
            properties:
              domain_names:
                description: |
                  An array of domain names used for embedding the checkout with Apple Pay. The value is just the domain name, without the protocol, port or path.
                type: array
                items:
                  type: string
                  example: example.dintero.com
    ApplePayConnectionConfiguration:
      type: object
      description: |
        The configuration for the Apple Pay connection.
      required:
        - merchant_id
        - payment_options
      properties:
        merchant_id:
          type: string
          description: |
            The Apple Pay merchant identifier.
        payment_options:
          $ref: '#/components/schemas/ApplePayPaymentOptions'
    ApplePayConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/ApplePayPaymentOptions'
        domain_names:
          description: |
            An array of domain names used for payment. Just the domain name, without the protocol.
          type: array
          items:
            type: string
            example: example.dintero.com
    ApplePayConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
            - configuration
          properties:
            configuration:
              $ref: '#/components/schemas/ApplePayConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/ApplePayConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    BamboraConnectionConfiguration:
      type: object
      description: |
        Bambora configuration for the merchant

        The Bambora configuration includes a `secret_token` stored safely and never exposed
      required:
        - merchant_number
        - md5_key
      properties:
        merchant_number:
          type: string
        md5_key:
          type: string
        access_token:
          type: number
        secret_token:
          type: string
        token_scope:
          type: string
    BamboraPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - bambora.creditcard
              - bambora.mobilepay
              - bambora.vipps
              - bambora.applepay
    BamboraDirectConnectionSignup:
      type: object
      required:
        - case_id
        - merchant_number
        - md5_key
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        merchant_number:
          type: string
          example: P12345678
        md5_key:
          type: string
          example: ae45ase
        payment_options:
          $ref: '#/components/schemas/BamboraPaymentOptions'
    BamboraConnectionSignup:
      type: object
      required:
        - payment_options
        - bank_name
        - account_number
        - revenue
      properties:
        payment_options:
          $ref: '#/components/schemas/BamboraPaymentOptions'
        store_type:
          type: array
          items:
            type: string
            enum:
              - online
              - instore
              - remote
        revenue:
          type: object
          properties:
            currency:
              type: string
              format: iso4217-code
              example: NOK
              description: |
                The three-character ISO-4217 currency for the expected amounts.
                https://en.wikipedia.org/wiki/ISO_4217
            yearly_revenue:
              type: string
              example: 100.000-250.000 NOK
            highest_transaction_amount:
              type: string
              example: 500-1000 NOK
              description: |
                estimated highest amount in a single transaction
            average_amount:
              type: string
              example: 250-500 NOK
              description: |
                average amount of transactions
            accept_prepaid:
              description: The company accepts advanced payments
              type: boolean
            subscriptions_or_memberships:
              description: The company sells subscriptions or memberships
              type: boolean
            gift_cards:
              description: The company sells gift cards
              type: boolean
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        ownership:
          type: object
          properties:
            ownership_structure:
              type: string
              enum:
                - owners_with_more_than_25
                - no_owners_with_more_than_25
                - complex
            owners:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Name of owner, or representative of the company owning shares.
                  legal_name:
                    type: string
                    description: Name of company. Required if the owner is a company.
                  date_of_birth:
                    type: string
                    description: Date of birth of the signee.
                    example: '1990-09-20'
                  percentage:
                    type: number
                    example: 25
                    description: Ownership percentage
        verifications:
          type: object
          description: |
            Verify that the business complies with the following requirements from the payment connections.
          properties:
            terms_and_conditions:
              description: |
                The payment site displays terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: boolean
            terms_and_conditions_url:
              description: |
                Url to terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: string
            contact_information:
              description: |
                The company's contact information is easily available, including organization number, phone number
                and address
              type: boolean
            payment_site:
              description: Customers have access to a payment site. Applies to online stores.
              type: boolean
            clear_pricing:
              description: All products and services have clearly marked prices.
              type: boolean
            payment_product_logos:
              description: Visa and Mastercard logos are visible on the payment site.
              type: boolean
        signature:
          type: object
          description: |
            Signatures from general manager or someone with signature authority
          properties:
            signatures:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  email:
                    type: string
            politically_exposed_person:
              description: |
                If you or owner is a politically exposed person according to the money laundering act
              type: boolean
            politically_exposed_associated:
              description: |
                If you or owner is closesely associated with an politically exposed person
                according to the money laundering act
              type: boolean
        applicant:
          description: |
            The person signing up for payment connection.
          type: object
          properties:
            phone_number:
              type: string
              description: |
                A phone number in E.164 number formatting.
              format: ^\+?[1-9]\d{1,14}$
              example: '+4799999999'
    BamboraPayFacConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        merchant_number:
          type: string
          example: P12345678
        md5_key:
          type: string
          example: ae45ase
        payment_options:
          $ref: '#/components/schemas/BamboraPaymentOptions'
        mcc:
          type: string
          format: iso-18245
          example: 5814
          description: |
            A four-digit Merchant Category Code (MCC) for the store
            [ISO 18245:2003](https://www.iso.org/standard/33365.html)

            Overrides what is previously set on the case.
    BamboraConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - properties:
            configuration:
              $ref: '#/components/schemas/BamboraConnectionConfiguration'
            direct_signups:
              type: array
              description: |
                The Bambora direct signups received for this account.
              items:
                allOf:
                  - $ref: '#/components/schemas/BamboraDirectConnectionSignup'
                  - required:
                      - created_at
                      - signup_id
                    properties:
                      signup_id:
                        type: string
                        description: |
                          Unique ID for the signup
                        format: uuid
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
                      callback_at:
                        type: string
                        format: date-time
                        description: |
                          Callback when Bambora approved the signup
            signup:
              description: |
                **DEPRECATED** 

                Signup object present for Bambora signups with the old `POST /connections/bambora` endpoint.
              allOf:
                - $ref: '#/components/schemas/BamboraConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Bambora approved the signup
            submerchant_signups:
              type: array
              description: |
                The signups received for this account

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/BamboraPayFacConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
                      callback_at:
                        type: string
                        format: date-time
                        description: |
                          Callback when Bambora approved the signup
    CollectorConnectionConfiguration:
      type: object
      description: |
        Collector Bank configuration for the merchant

        The Collector configuration includes a `password` stored safely and never exposed
      properties:
        username:
          type: string
        store_id:
          type: number
        country:
          type: string
          format: iso-3166-1
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - collector.invoice
                  - collector.invoice_b2b
                  - collector.installment
    CollectorConnectionSignup:
      type: object
      required:
        - legal_name
        - organization_number
        - bank_name
        - account_number
        - website
        - payment_options
      properties:
        business_name:
          type: string
          description: Name of the merchant, if it differs from legal_name
        legal_name:
          type: string
        organization_number:
          type: string
          example: 123456789MVA
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        website:
          type: string
          description: Company's website url
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - collector.invoice
                  - collector.installment
    CollectorConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            configuration:
              $ref: '#/components/schemas/CollectorConnectionConfiguration'
            signup:
              allOf:
                - $ref: '#/components/schemas/CollectorConnectionSignup'
                - required:
                    - created_at
                    - url
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    url:
                      type: string
                      description: |
                        Signup URL from Collector, where merchant can complete the signup
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Collector approved the signup
    PaymentOptions:
      type: array
      items:
        type: object
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero.zero
              - swish.swish
              - payex.creditcard
              - payex.vipps
              - payex.mobilepay
              - collector.invoice
              - collector.installment
              - collector.invoice_b2b
              - instabank.finance
              - instabank.invoice
              - instabank.postponement
              - instabank.installment
              - vipps
              - bambora.creditcard
              - bambora.mobilepay
              - bambora.vipps
              - klarna.klarna
              - klarna.billie
    CommonConnectionSignup:
      type: object
      required:
        - payment_options
        - store_type
      properties:
        payment_options:
          $ref: '#/components/schemas/PaymentOptions'
        store_type:
          type: array
          items:
            type: string
            enum:
              - online
              - instore
              - remote
        package:
          type: string
          description: |
            What pricing strategy to use for this company.
          example: Checkout 195 NOK/month + 1.5%
        revenue:
          type: object
          properties:
            currency:
              type: string
              format: iso4217-code
              example: NOK
              description: |
                The three-character ISO-4217 currency for the expected amounts.
                https://en.wikipedia.org/wiki/ISO_4217
            yearly_revenue:
              type: string
              example: 100.000-250.000 NOK
            highest_transaction_amount:
              type: string
              example: 500-1000 NOK
              description: |
                estimated highest amount in a single transaction
            average_amount:
              type: string
              example: 250-500 NOK
              description: |
                average amount of transactions
            accept_prepaid:
              description: The company accepts advanced payments
              type: boolean
            subscriptions_or_memberships:
              description: The company sells subscriptions or memberships
              type: boolean
            gift_cards:
              description: The company sells gift cards
              type: boolean
            estimated_percentage_per_payment_type:
              description: Estimates of revenue in percentages per payment store_type
              type: array
              items:
                type: object
                properties:
                  percentage:
                    type: number
                    minimum: 0
                    maximum: 100
                  type:
                    type: string
                    enum:
                      - swish.swish
                      - payex.creditcard
                      - payex.vipps
                      - payex.mobilepay
                      - collector.invoice
                      - collector.installment
                      - collector.invoice_b2b
                      - instabank.finance
                      - instabank.invoice
                      - instabank.postponement
                      - instabank.installment
                      - vipps
                      - bambora.creditcard
                      - bambora.mobilepay
                      - bambora.vipps
        bank_accounts:
          description: |
            Will only support one bank account for the time being
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: object
            properties:
              account_number:
                type: string
                description: The bank account number
              account_number_type:
                type: string
                description: |
                  What format the account number is.
                enum:
                  - iban
                  - mod11
              bank_name:
                type: string
                description: The name of the bank
              account_statement_url:
                type: string
                format: uri
                pattern: https?://*
                example: https://example.dintero.com/c/photos/account_statement.pdf
                description: |
                  Document or image to prove that the account number belongs to the company.
        ownership:
          type: object
          properties:
            ownership_structure:
              type: string
              enum:
                - owners_with_more_than_25
                - no_owners_with_more_than_25
                - complex
            owners:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Name of owner, or representative of the company owning shares.
                  legal_name:
                    type: string
                    description: Name of company. Required if the owner is a company.
                  date_of_birth:
                    type: string
                    description: Date of birth of the owner.
                    example: '1990-09-20'
                  social_security_number:
                    type: string
                    description: Social security number of the owner.
                  percentage:
                    type: number
                    example: 25
                    description: Ownership percentage
                  address:
                    $ref: '#/components/schemas/Address'
        verifications:
          type: object
          description: |
            Verify that the business complies with the following requirements from the payment connections.
          properties:
            terms_and_conditions:
              description: |
                The payment site displays terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: boolean
            terms_and_conditions_url:
              description: |
                Url to terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: string
            contact_information:
              description: |
                The company's contact information is easily available, including organization number, phone number
                and address
              type: boolean
            payment_site:
              description: Customers have access to a payment site. Applies to online stores.
              type: boolean
            payment_site_url:
              description: |
                Url to payment site.
              type: string
            demo_site_url:
              description: |
                Url to demo site.
              type: string
            clear_pricing:
              description: All products and services have clearly marked prices.
              type: boolean
            payment_product_logos:
              description: Visa and Mastercard logos are visible on the payment site.
              type: boolean
        signature:
          type: object
          description: |
            Signatures from general manager or someone with signature authority
          properties:
            signatures:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  email:
                    type: string
            politically_exposed_person:
              description: |
                If you or owner is a politically exposed person according to the money laundering act
              type: boolean
            politically_exposed_associated:
              description: |
                If you or owner is closesely associated with an politically exposed person
                according to the money laundering act
              type: boolean
        applicant:
          description: |
            The person signing up for payment connection.
          type: object
          properties:
            first_name:
              type: string
              example: John
            last_name:
              type: string
              example: Doe
            email:
              type: string
              example: customer@example.com
            phone_number:
              type: string
              description: |
                A phone number in E.164 number formatting.
              format: ^\+?[1-9]\d{1,14}$
              example: '+4799999999'
            social_security_number:
              type: string
              description: Social security number of the owner.
        company_information:
          type: object
          description: |
            Information on what your company does
          properties:
            industry:
              type: string
              enum:
                - goods
                - services
                - subscriptions_or_memberships
                - charity
                - travel_and_entertainment
                - food_and_beverages
                - other
            company_category:
              type: string
              description: |
                Company MCC code
              enum:
                - '4722'
                - '5021'
                - '5045'
                - '5122'
                - '5211'
                - '5399'
                - '5499'
                - '5691'
                - '5699'
                - '5712'
                - '5719'
                - '5732'
                - '5811'
                - '5812'
                - '5813'
                - '5814'
                - '5816'
                - '5817'
                - '5932'
                - '5941'
                - '5944'
                - '5945'
                - '5971'
                - '5977'
                - '5993'
                - '5999'
                - '7011'
                - '7033'
                - '7298'
                - '7299'
                - '7392'
                - '7399'
                - '7512'
                - '7922'
                - '7929'
                - '7991'
                - '7997'
                - '7999'
                - '8299'
                - '8398'
                - '8641'
                - '8699'
                - '8999'
            mcc:
              type: object
              description: More data about the mcc code selected
              properties:
                mcc:
                  type: string
                range:
                  type: object
                  properties:
                    start:
                      type: string
                    end:
                      type: string
                    description:
                      type: string
                    reserved:
                      type: boolean
                iso_description:
                  type: string
                usda_description:
                  type: string
                stripe_description:
                  type: string
                stripe_code:
                  type: string
                visa_description:
                  type: string
                visa_req_clearing_name:
                  type: string
            company_description:
              type: string
              description: |
                Description of the product or services that the company accepts payments from
        payment_method_specific:
          type: object
          description: |
            Any properties specifically needed for a certain payment method
          properties:
            payex:
              type: object
              properties:
                signup_url:
                  type: string
                  description: |
                    Link to payex form
            instabank:
              type: object
              required:
                - total_number_of_transactions
                - total_volume_of_transactions
                - finance_number_of_transactions
                - finance_volume_of_transactions
              description: |
                These fields must be filled out if instabank is a chosen payment method
              properties:
                total_number_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated number of transactions
                total_volume_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated yearly transaction volume
                finance_number_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated number of finance transactions
                finance_volume_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated yearly volume of finance transactions
    CommonConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnectionMeta'
        - required:
            - signup
          properties:
            signup:
              allOf:
                - $ref: '#/components/schemas/CommonConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                - properties:
                    payment_method_specific:
                      type: object
                      description: |
                        Any properties specifically needed for a certain payment method
                      properties:
                        vipps:
                          type: object
                          properties:
                            signup_url:
                              type: string
                              description: |
                                Link to vipps form
    DinteroPspConnectionConfiguration:
      type: object
      description: |
        Visa Tokenization configuration for the merchant
      required:
        - client_app_id
        - relationship_id
      properties:
        visa_net_client_id:
          type: string
        acquirer_merchant_id:
          type: string
        vipps_merchant_serial_number:
          type: string
          example: '123456'
        visa_token_client_app_id:
          type: string
        visa_token_relationship_id:
          type: string
          example: 10000000-20000000000
        mastercard_token_src_dpa_id:
          type: string
          example: src_dpa_56068
        mastercard_token_service_id:
          type: string
          example: SECURE_COF_MERCHANT_OBO#TESTPROJECT_PROD-PGMNAME#01
        google_pay_merchant_gateway_id:
          type: string
          example: dintero-test
    DinteroPspPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero_psp.creditcard
    DinteroPspConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service.
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/DinteroPspPaymentOptions'
    DinteroPspConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/DinteroPspConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/DinteroPspConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    InstabankConnectionConfiguration:
      type: object
      description: |
        Instabank configuration for the merchant
      properties:
        payment_product_codes:
          type: object
          description: |
            Instabank Product Codes
          required:
            - instabank.invoice
            - instabank.finance
          properties:
            instabank.finance:
              type: string
              example: '630'
            instabank.invoice:
              type: string
              example: '632'
        organization_number:
          type: string
        payment_options:
          type: array
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - instabank.invoice
                  - instabank.finance
    InstabankConnectionSignup:
      type: object
      required:
        - email
        - phone_number
        - total_number_of_transactions
        - total_volume_of_transactions
        - finance_number_of_transactions
        - finance_volume_of_transactions
        - industry
        - payment_options
        - account_number
      properties:
        email:
          type: string
          example: customer@example.com
        phone_number:
          type: string
          description: |
            A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        total_number_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated number of transactions
        total_volume_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated yearly transaction volume
        finance_number_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated number of finance transactions
        finance_volume_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated yearly volume of finance transactions
        industry:
          type: string
          example: computer industry
        account_number:
          type: string
          description: |
            The account number for where settlement payout is transfered to. Must be
            a checking account in a Norwegian bank.
          format: modulus11
          minLength: 11
          maxLength: 11
          example: '12345678911'
        payment_options:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - instabank.invoice
                  - instabank.finance
    InstabankConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            configuration:
              $ref: '#/components/schemas/InstabankConnectionConfiguration'
            signup:
              allOf:
                - $ref: '#/components/schemas/InstabankConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Instabank approved the signup
    KlarnaPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - klarna.klarna
              - klarna.billie
    KlarnaConnectionConfiguration:
      type: object
      description: |
        Klarna configuration for the merchant
      properties:
        credentials:
          type: array
          description: |
            The Klarna credentials created for this account
          items:
            type: object
            required:
              - case_id
              - merchant_id
              - username
            properties:
              case_id:
                description: |
                  The id to the case id in auth service
                type: string
                format: uuid
              merchant_id:
                type: string
              username:
                type: string
        payment_options:
          $ref: '#/components/schemas/KlarnaPaymentOptions'
    KlarnaConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/KlarnaPaymentOptions'
        price_package:
          description: |
            Name of the Dintero price package for the merchant. 
            The price package must be registered with Klarna as a price plan.
          type: string
          example: EU_DINTERO_PP001
        mcc:
          type: string
          format: iso-18245
          example: 5814
          description: |
            A four-digit Merchant Category Code (MCC) for the store
            [ISO 18245:2003](https://www.iso.org/standard/33365.html)

            Overrides what is previously set on the case.
    KlarnaConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/KlarnaConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/KlarnaConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
                      callback_at:
                        type: string
                        format: date-time
                        description: |
                          Callback when Klarna approved the signup
    KraviaConnectionSettlementType:
      type: string
      description: |
        Indicates whether settlement is done directly to the merchant or handled by Dintero
      enum:
        - direct
        - via_dintero
    KraviaPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - kravia.invoice_b2b
              - kravia.invoice_b2c
              - kravia.invoice_b2b_grouped
    InvoiceChannel:
      type: string
      description: |
        Default channel used for Kravia invoice distribution.

        - `kravia`: Dintero/Kravia distributes the invoice.
        - `merchant`: The merchant distributes the invoice.
      enum:
        - kravia
        - merchant
      default: kravia
    KraviaConnectionConfiguration:
      type: object
      description: |
        Kravia configuration for the merchant
      properties:
        credentials:
          type: array
          description: |
            The Kravia credentials created for this account
          items:
            type: object
            required:
              - case_id
              - merchant_id
            properties:
              case_id:
                description: |
                  The id to the case id in auth service
                type: string
                format: uuid
              merchant_id:
                type: string
              settlement_type:
                $ref: '#/components/schemas/KraviaConnectionSettlementType'
        payment_options:
          $ref: '#/components/schemas/KraviaPaymentOptions'
        supported_invoice_channels:
          type: array
          description: |
            Invoice channels available for this account.
          items:
            $ref: '#/components/schemas/InvoiceChannel'
          default:
            - kravia
    KraviaConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/KraviaPaymentOptions'
        settlement_type:
          $ref: '#/components/schemas/KraviaConnectionSettlementType'
    KraviaConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/KraviaConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/KraviaConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    Mastercard3DSConnectionSignup:
      type: object
      required:
        - case_id
      properties:
        case_id:
          description: |
            The id to the case id in auth service.
          type: string
          format: uuid
    Mastercard3DSConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              type: object
              description: |
                Mastercard 3DS configuration for the merchant
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - enabled
                    - failed
                    - pending
                    - declined
                  description: |
                    The status of the configuration
            events:
              type: array
              description: |
                The events received for this account.
              items:
                allOf:
                  - $ref: '#/components/schemas/AccountConnectionEvent'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when event was initiated
                        type: string
                        format: date-time
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/Mastercard3DSConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    MastercardTokenizationConnectionConfiguration:
      type: object
      description: |
        Mastercard Tokenization configuration for the merchant
      required:
        - token_src_dpa_id
        - token_service_id
      properties:
        token_src_dpa_id:
          type: string
        token_service_id:
          type: string
    MastercardTokenizationConnectionSignup:
      type: object
      required:
        - case_id
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
    MastercardTokenizationConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/MastercardTokenizationConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/MastercardTokenizationConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    PayExConnectionConfiguration:
      type: object
      description: |
        PayEx configuration for the merchant

        The PayEx configuration includes a `token` stored safely and never exposed
      properties:
        payee_id:
          type: string
        subsite:
          type: string
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
    PayExConnectionSignupContact:
      type: object
      required:
        - name
        - phone_number
        - email
      description: Contact information for the person in the given role
      properties:
        name:
          type: string
          example: John Doe
          description: Name of the contact person
        phone_number:
          type: string
          description: |
            Phone number for the contact person. A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        email:
          type: string
          description: Contact person's e-mail
          example: customer@example.com
    PayExConnectionSignup:
      type: object
      required:
        - payment_options
      properties:
        business_name:
          type: string
          description: Name of the merchant, if it differs from legal_name
        legal_name:
          type: string
        organization_number:
          type: string
          example: 123456789MVA
        applicant_contact:
          $ref: '#/components/schemas/PayExConnectionSignupContact'
        accounting_contact:
          $ref: '#/components/schemas/PayExConnectionSignupContact'
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        website:
          type: string
          description: Company's website url
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
    PayExConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            configuration:
              $ref: '#/components/schemas/PayExConnectionConfiguration'
            signup:
              allOf:
                - $ref: '#/components/schemas/PayExConnectionSignup'
                - required:
                    - created_at
                    - url
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    url:
                      type: string
                      description: |
                        Signup URL from PayEx, where merchant can complete the signup
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when PayEx approved the signup
    PayExConnectionConfigurationV2:
      type: object
      description: |
        PayEx configuration for the merchant

        The PayEx configuration includes a `token` stored safely and never exposed
      properties:
        payee_id:
          type: string
        subsite:
          type: string
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
                  - payex.swish
                  - payex.vipps
    PayExConnectionV2:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            creditcard:
              $ref: '#/components/schemas/PayExConnection'
            configuration:
              $ref: '#/components/schemas/PayExConnectionConfigurationV2'
            signup:
              allOf:
                - $ref: '#/components/schemas/PayExConnectionSignup'
                - required:
                    - created_at
                    - url
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    url:
                      type: string
                      description: |
                        Signup URL from PayEx, where merchant can complete the signup
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when PayEx approved the signup
    SwishConnectionConfiguration:
      type: object
      description: |
        Swish configuration for the merchant

        The Collector configuration includes a `password` stored safely and never exposed
      properties:
        swish_number:
          type: string
          description: The merchant's Swish number
          example: '1231182293'
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - swish.swish
    SwishConnectionSignup:
      type: object
      required:
        - legal_name
        - organization_number
        - website
        - payment_options
      properties:
        business_name:
          type: string
          description: Name of the merchant, if it differs from legal_name
        legal_name:
          type: string
        organization_number:
          type: string
          example: 123456789MVA
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        website:
          type: string
          description: Company's website url
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: SEK
              type:
                type: string
                enum:
                  - swish.swish
    SwishConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - type: object
          properties:
            configuration:
              $ref: '#/components/schemas/SwishConnectionConfiguration'
            signups:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - direct
                      - payfac
                  created_at:
                    type: string
                  callback_at:
                    type: string
                  data:
                    type: object
                    properties:
                      business_name:
                        type: string
                      legal_name:
                        type: string
                      organization_number:
                        type: string
                      bank_name:
                        type: string
                      account_number:
                        type: string
                      website:
                        type: string
                      case_id:
                        type: string
                      swish_number:
                        type: string
                      payment_options:
                        type: array
                        items:
                          type: object
                          properties:
                            currencies:
                              type: array
                              items:
                                type: string
                            type:
                              type: string
                              enum:
                                - swish.swish
            signup:
              description: Deprecated, replaced by signups
              allOf:
                - $ref: '#/components/schemas/SwishConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Swish approved the signup
    TwoPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - two.invoice_b2b
    TwoConnectionConfiguration:
      type: object
      description: |
        Two configuration for the merchant
      properties:
        merchant_id:
          description: The merchant ID registered in Two
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/TwoPaymentOptions'
    TwoConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/TwoPaymentOptions'
    TwoConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/TwoConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/TwoConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    VippsConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            signup:
              type: object
              required:
                - created_at
              properties:
                created_at:
                  description: |
                    The time when signup was initiated
                  type: string
                  format: date-time
                id:
                  type: string
                  description: |
                    Signup ID from Vipps
                  example: 81b83246-5c19-7b94-875b-ea6d1114f099
                url:
                  type: string
                  description: |
                    Signup URL from Vipps, where merchant can complete the signup
                callback_at:
                  type: string
                  format: date-time
                  description: |
                    Result from callback received from Vipps after merchant completed
                    the signup, and Vipps approved it.
                expires_at:
                  type: string
                  format: date-time
                  description: |
                    The Vipps signup URL expires after 30 days.
            configuration:
              description: |
                Vipps configuration for the merchant, received from signup callback
                The vipps configuration includes a `client_secret` stored safely and
                never exposed
              properties:
                payment_options:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        enum:
                          - vipps
                merchant_name:
                  type: string
                  example: Vipps
                created_time:
                  type: string
                  example: '00:00:00'
                merchant_serial_number:
                  type: string
                  example: '123456'
                client_id:
                  type: string
                  format: uuid
                  example: 51358942-08c8-4d50-99f4-a9aa970b5f5b
                subscription_keys:
                  type: array
                  items:
                    type: object
                    properties:
                      product:
                        type: string
                        example: Access
                      ocp_apim_subscription_key:
                        type: string
                        example: de897dbb-0cd3-4445-b003-ac8214ac4638
    VippsPspPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero_psp.vipps
    VippsPspConnectionConfiguration:
      type: object
      description: |
        Vipps PSP configuration for the merchant
      required:
        - merchant_serial_number
      properties:
        merchant_serial_number:
          description: Merchant serial number generated by vipps
          type: string
          pattern: ^[0-9]{6}$
          example: '123456'
        payment_options:
          $ref: '#/components/schemas/VippsPspPaymentOptions'
    VippsPspConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
        - logo
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/VippsPspPaymentOptions'
        logo:
          type: string
          description: |
            Base64 encoded string of merchant logo which will be displayed in Vipps app. 
            The logo must be in PNG format. Square images are recommended. 
            The longest side cannot be more than 1000 pixels. Minimum size is 100 x 100 pixels.
    VippsPspConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/VippsPspConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/VippsPspConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    VisaTokenizationConnectionConfiguration:
      type: object
      description: |
        Visa Tokenization configuration for the merchant
      required:
        - client_app_id
        - relationship_id
      properties:
        client_app_id:
          type: string
          description: |
            Unique identifier of merchant in VTS system
        relationship_id:
          type: string
          description: |
            Identifies relationship between merchant and us in VTS system
    VisaTokenizationConnectionSignup:
      type: object
      required:
        - case_id
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
    VisaTokenizationConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/VisaTokenizationConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/VisaTokenizationConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    SeitatechPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            maxItems: 1
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - seitatech.in_person
    SeitatechConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/SeitatechPaymentOptions'
    SeitatechConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            signups:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/SeitatechConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    AccountCheckoutGateway:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        progression:
          type: string
          enum:
            - not_applied
            - waiting_for_dintero
            - waiting_for_gateway
            - waiting_for_merchant
            - rejected
            - live
            - frozen
            - deactivated
    CheckoutAccountService:
      allOf:
        - $ref: '#/components/schemas/AccountService'
        - properties:
            features:
              $ref: '#/components/schemas/CheckoutServiceFeatures'
            gateways:
              type: object
              description: |
                All gateways requires an `enabled` connection
              properties:
                santander:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                collector:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                instabank:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                vipps:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                swish:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                bambora:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                payex:
                  type: object
                  properties:
                    creditcard:
                      $ref: '#/components/schemas/AccountCheckoutGateway'
                    swish:
                      $ref: '#/components/schemas/AccountCheckoutGateway'
                klarna:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                dintero_psp:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                kravia:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                two:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                seitatech:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
    AccountReadOnly:
      type: object
      properties:
        connections:
          type: object
          readOnly: true
          description: |
            Connections to external services registered on the merchant account
          properties:
            applepay:
              $ref: '#/components/schemas/ApplePayConnection'
            bambora:
              $ref: '#/components/schemas/BamboraConnection'
            collector:
              $ref: '#/components/schemas/CollectorConnection'
            common:
              $ref: '#/components/schemas/CommonConnection'
            dintero_psp:
              $ref: '#/components/schemas/DinteroPspConnection'
            instabank:
              $ref: '#/components/schemas/InstabankConnection'
            klarna:
              $ref: '#/components/schemas/KlarnaConnection'
            kravia:
              $ref: '#/components/schemas/KraviaConnection'
            mastercard_3ds:
              $ref: '#/components/schemas/Mastercard3DSConnection'
            mastercard_tokenization:
              $ref: '#/components/schemas/MastercardTokenizationConnection'
            payex:
              $ref: '#/components/schemas/PayExConnectionV2'
            swish:
              $ref: '#/components/schemas/SwishConnection'
            two:
              $ref: '#/components/schemas/TwoConnection'
            vipps:
              $ref: '#/components/schemas/VippsConnection'
            vipps_psp:
              $ref: '#/components/schemas/VippsPspConnection'
            visa_tokenization:
              $ref: '#/components/schemas/VisaTokenizationConnection'
            seitatech:
              $ref: '#/components/schemas/SeitatechConnection'
        services:
          type: object
          readOnly: true
          description: |
            Status on services enabled on the merchant account
          properties:
            checkout:
              $ref: '#/components/schemas/CheckoutAccountService'
            customers:
              $ref: '#/components/schemas/AccountService'
            discounts:
              $ref: '#/components/schemas/AccountService'
            shopping:
              $ref: '#/components/schemas/AccountService'
            receipts:
              $ref: '#/components/schemas/AccountService'
            wallets:
              $ref: '#/components/schemas/AccountService'
            payout:
              $ref: '#/components/schemas/PayoutAccountService'
            ledger:
              $ref: '#/components/schemas/AccountService'
    AccountApprovals:
      type: object
      properties:
        approvals_payments_statuses:
          type: object
          description: Count of statuses of payments approvals
          properties:
            ACTIVE:
              type: number
            DECLINED:
              type: number
            UNDER_MANUAL_REVIEW:
              type: number
            AUTOMATIC_REVIEW:
              type: number
            WAITING_FOR_SIGNATURE:
              type: number
            WAITING_FOR_DECLARATION:
              type: number
            WAITING_FOR_DETAILS:
              type: number
            ERROR:
              type: number
            ARCHIVED:
              type: number
            TERMINATED:
              type: number
        approvals_payout_destinations_statuses:
          type: object
          description: Count of statuses of payout destinations approvals (aka seller approvals)
          properties:
            ACTIVE:
              type: number
            DECLINED:
              type: number
            UNDER_MANUAL_REVIEW:
              type: number
            AUTOMATIC_REVIEW:
              type: number
            WAITING_FOR_SIGNATURE:
              type: number
            WAITING_FOR_DECLARATION:
              type: number
            WAITING_FOR_DETAILS:
              type: number
            ERROR:
              type: number
            ARCHIVED:
              type: number
            TERMINATED:
              type: number
    PartnerConfiguration:
      type: object
      description: |
        Configuration options for the account.
      properties:
        default_price_package:
          type: string
          description: |
            Default price package to assign to new merchants.

            Use the price package ID of the price package.

            Please note that the price package must exist and be available to the
            partner account in question.
    ExtendedAccount:
      allOf:
        - $ref: '#/components/schemas/Account'
        - $ref: '#/components/schemas/AccountPrivateDetails'
        - $ref: '#/components/schemas/AccountReadOnly'
        - $ref: '#/components/schemas/AccountApprovals'
        - type: object
          properties:
            configuration:
              $ref: '#/components/schemas/PartnerConfiguration'
    ApprovalsPaymentProduct:
      type: string
      description: |
        The type of product that the merchant wants to use for their business.
         - `checkout` the merchant accepts payouts to a single bank account
           (per currency).
         - `split_payment` needed for partners, marketplaces and platforms that
           will onboard sellers that will receive payouts to the sellers' own bank
           accounts.
      enum:
        - checkout
        - split_payment
    CddCaseUpdateEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - account
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: cdd_case_update
          enum:
            - cdd_case_update
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        account:
          $ref: '#/components/schemas/ExtendedAccount'
        payout_case:
          type: object
          description: |
            The payment case that was updated
          required:
            - id
            - created_at
            - updated_at
            - payout_reference
            - organization_number
            - products
          properties:
            id:
              type: string
              format: uuid
              example: 497f6eca-6276-4993-bfeb-53cbbbba6f08
            created_at:
              type: string
              format: date-time
            created_by:
              type: string
            updated_at:
              type: string
              format: date-time
            deleted_at:
              type: string
              format: date-time
            deleted_by:
              type: string
            payout_reference:
              type: string
            organization_number:
              type: string
            case_status:
              type: string
              enum:
                - ACTIVE
                - DECLINED
                - UNDER_MANUAL_REVIEW
                - AUTOMATIC_REVIEW
                - WAITING_FOR_SIGNATURE
                - WAITING_FOR_DECLARATION
                - ERROR
                - ARCHIVED
                - WAITING_FOR_DETAILS
            previous_case_status:
              type: string
              enum:
                - ACTIVE
                - DECLINED
                - UNDER_MANUAL_REVIEW
                - AUTOMATIC_REVIEW
                - WAITING_FOR_SIGNATURE
                - WAITING_FOR_DECLARATION
                - ERROR
                - ARCHIVED
                - WAITING_FOR_DETAILS
            products:
              type: array
              items:
                type: object
                required:
                  - product
                properties:
                  product:
                    $ref: '#/components/schemas/ApprovalsPaymentProduct'
            payment_methods:
              description: |
                Payment methods that the merchant wants to accept.
              type: array
              items:
                type: object
                required:
                  - payment_method
                properties:
                  payment_method:
                    type: string
                    enum:
                      - creditcard
                      - applepay
                      - clicktopay
                      - vipps
                      - swish
                      - mobilepay
                      - klarna
                      - walley
                      - santander
                      - netaxept
                      - instabank
                      - googlepay
                      - billie
        payout_destination_case:
          allOf:
            - $ref: '#/components/schemas/PayoutDestinationUpdateBase'
            - description: |
                The seller approval case that was updated or deleted
              required:
                - case_status
              properties:
                deleted_at:
                  type: string
                  format: date-time
                deleted_by:
                  type: string
                case_status:
                  type: string
                  enum:
                    - ARCHIVED
                    - ACTIVE
                    - DECLINED
                    - UNDER_MANUAL_REVIEW
                    - AUTOMATIC_REVIEW
                    - WAITING_FOR_SIGNATURE
                    - WAITING_FOR_DECLARATION
                    - ERROR
                    - WAITING_FOR_DETAILS
                previous_case_status:
                  type: string
                  enum:
                    - ARCHIVED
                    - ACTIVE
                    - DECLINED
                    - UNDER_MANUAL_REVIEW
                    - AUTOMATIC_REVIEW
                    - WAITING_FOR_SIGNATURE
                    - WAITING_FOR_DECLARATION
                    - ERROR
                    - WAITING_FOR_DETAILS
    CheckoutTransactionEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - transaction
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: checkout_transaction
          enum:
            - checkout_transaction
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        transaction:
          type: object
          description: The transaction details, see Checkout API /api-reference/transactions/transactions_id_get for complete description of all properties that can be included in the transaction object
          required:
            - id
            - session_id
            - merchant_reference
            - created_at
            - updated_at
          properties:
            id:
              type: string
              example: P12345678.465UfBENeLpkBvwmqfTC4k
            session_id:
              type: string
              description: The session id for the transaction
              example: P12345678.465U8CUzaPVpneu1wt8Wei
            merchant_reference:
              type: string
              description: |
                A reference specified by the merchant to identify the transaction
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            merchant_reference_2:
              type: string
              description: |
                A reference specified by the merchant to identify the transaction,
                can be updated after the transaction has been created
    CheckoutAuthorizationEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - authorization
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: checkout_authorization
          enum:
            - checkout_authorization
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        authorization:
          type: object
          required:
            - merchant_reference
            - session_id
          properties:
            merchant_reference:
              type: string
              description: |
                A reference by the merchant to identify the corresponding
                order for the Checkout Session
            session_id:
              type: string
              description: The ID of the Checkout Session
            transaction_id:
              type: string
              description: The ID of the Transaction created
            error:
              type: string
              example: cancelled
              enum:
                - cancelled
                - authorization
                - failed
        transaction:
          type: object
          description: |
            The transaction details, see Checkout API
            /api-reference/transactions/transactions_id_get
            for complete description of all properties that can be included in the transaction
            object

            No transaction will be included in the event if the authorization was
            cancelled by the user
          required:
            - id
            - session_id
            - merchant_reference
            - created_at
            - updated_at
          properties:
            id:
              type: string
              example: P12345678.465UfBENeLpkBvwmqfTC4k
            session_id:
              type: string
              description: The session id for the transaction
              example: P12345678.465U8CUzaPVpneu1wt8Wei
            merchant_reference:
              type: string
              description: |
                A reference specified by the merchant to identify the transaction
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            merchant_reference_2:
              type: string
              description: |
                A reference specified by the merchant to identify the transaction,
                can be updated after the transaction has been created
    PayoutDestinationId:
      type: string
      maxLength: 40
      pattern: ^[A-Za-z0-9_-]+$
      example: PD032
    StoreUpdateInput:
      type: object
      required:
        - store_name
        - phone_number
        - organization
      properties:
        organization:
          type: object
          description: The organization for the store
          required:
            - organization_number
          properties:
            organization_number:
              type: string
            country:
              type: string
              readOnly: true
              pattern: ^[A-Z]{2}$
              description: ISO 3166-1 country code for the organization number
              example: 'NO'
            type:
              type: string
              default: main_unit
              enum:
                - main_unit
                - sub_unit
            name:
              type: string
            trade_name:
              type: string
        store_name:
          type: string
        email:
          type: string
          format: email
        phone_number:
          type: string
          format: E.164
          pattern: ^\+[1-9]\d{1,14}$
          description: A phone number in E.164 format
          example: '+4799999999'
        address:
          allOf:
            - $ref: '#/components/schemas/Address'
            - required:
                - postal_code
        coordinates:
          type: object
          properties:
            latitude:
              type: number
              format: float
              example: 59.949923
            longitude:
              type: number
              format: float
              example: 10.766888
          required:
            - latitude
            - longitude
          description: The coordinates of the store
        website:
          type: string
        payout_destination:
          type: object
          description: |
            The payout destination associated with this store.

            A store with a payout destination will get all its properties
            (address, phone_number +++) set by validated data so you
            will not be allowed to set custom address when payout destination
            is set

            The organization_number must match the organization number of the
            payout destination

            These exceptions do not apply to payout destination's sub-units where
            different sub-unit organization_number is allowed and the details will
            be set by what is available in the public registers.
          required:
            - payout_destination_id
          properties:
            payout_destination_id:
              $ref: '#/components/schemas/PayoutDestinationId'
    StoreInput:
      allOf:
        - $ref: '#/components/schemas/StoreUpdateInput'
        - type: object
          properties:
            store_id:
              type: string
              example: S312
              maxLength: 20
              pattern: ^[A-Za-z0-9._~-]{1,20}$
              description: |
                Client-supplied store identifier. If omitted, the server generates
                one (e.g. T12345678-0001) and uses it as the store_id.
    LegalEntityType:
      type: string
      description: |
        - For a company seller select `company` or leave blank. Required fields are
          `organization_number` and `country_code`.
        - For an individual seller select `individual`. Provide optional fields in
          the individual object.
      enum:
        - company
        - individual
    StorePayoutDestination:
      type: object
      required:
        - status
        - type
      properties:
        merchant_category_code:
          type: string
          pattern: ^\d{1,4}
          format: mcc
          example: '2741'
        status:
          $ref: '#/components/schemas/ApprovalStatus'
        type:
          $ref: '#/components/schemas/LegalEntityType'
    OperatorPayoutDestination:
      type: object
      required:
        - payout_destination_id
        - status
        - type
      properties:
        payout_destination_id:
          type: string
          description: The unique identifier of the payout destination
        organization_number:
          type: string
          description: National organization number valid in the country specified
        name:
          type: string
          description: The name of the organization
        trade_name:
          type: string
          description: The trade name of the organization
        merchant_category_code:
          type: string
          pattern: ^\d{1,4}
          format: mcc
          example: '2741'
        status:
          $ref: '#/components/schemas/ApprovalStatus'
        type:
          $ref: '#/components/schemas/LegalEntityType'
    StoreReadOnly:
      type: object
      required:
        - id
        - created_at
        - created_by
        - updated_at
        - updated_by
        - status
        - verified
        - number_of_terminals
      properties:
        id:
          type: string
        created_at:
          type: string
        created_by:
          type: string
        updated_at:
          type: string
        updated_by:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - PENDING
            - SUSPENDED
            - DELETED
            - ERROR
        verified:
          type: boolean
          description: The store data have been verified
        number_of_terminals:
          type: integer
          description: Number of terminals associated with a store
        payout_destination:
          $ref: '#/components/schemas/StorePayoutDestination'
        operator_payout_destinations:
          type: array
          description: |
            Operator destinations associated with this store. Included when includes=operator_payout_destinations is used.
          items:
            $ref: '#/components/schemas/OperatorPayoutDestination'
    StoreBase:
      type: object
      required:
        - store_id
      allOf:
        - $ref: '#/components/schemas/StoreInput'
        - $ref: '#/components/schemas/StoreReadOnly'
    TerminalStatus:
      type: string
      description: The status of the terminal
      readOnly: true
      enum:
        - DELETED
        - PENDING
        - ACTION_REQUIRED
        - ACTIVE
        - INACTIVE
        - ERROR
    TerminalStatusReason:
      type: string
      description: Context explaining why the terminal has its current status.
      enum:
        - CHECK_UPDATE
    StoreTerminal:
      type: object
      required:
        - terminal_id
        - device_serial_number
      properties:
        terminal_id:
          type: string
          example: T312
        device_serial_number:
          type: string
          example: 181f1a3e-b81b-4460-a01b-2a3be2a253a1
        status:
          $ref: '#/components/schemas/TerminalStatus'
        status_reason:
          description: Context explaining why the terminal has its current status.
          allOf:
            - $ref: '#/components/schemas/TerminalStatusReason'
    StoreEnrollment:
      type: object
      description: |
        Details about the enrollment associated with this store.
      required:
        - type
        - status
        - pf_account_id
      properties:
        type:
          type: string
          enum:
            - bambora_ipp
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
        pf_account_id:
          type: string
          description: |
            Bambora IPP sub-merchant account identifier.
    StoreConfiguration:
      type: object
      properties:
        auto_end_of_day:
          type: object
          description: |
            Automatic end-of-day settlement for this store's terminals. Set
            `enabled` to false to disable the automatic timed end-of-day and
            trigger it manually via the terminal operations API instead.
          properties:
            enabled:
              type: boolean
              default: true
            time:
              type: string
              readOnly: true
              description: Automatic end-of-day time in HHMM format.
              example: '2300'
            timezone:
              type: string
              readOnly: true
              description: Automatic end-of-day time zone TZ name.
              example: Europe/Oslo
    Store:
      type: object
      allOf:
        - $ref: '#/components/schemas/StoreBase'
        - type: object
          properties:
            terminals:
              type: array
              description: |
                Terminals associated with this store.
              items:
                $ref: '#/components/schemas/StoreTerminal'
            enrollment:
              $ref: '#/components/schemas/StoreEnrollment'
            configuration:
              $ref: '#/components/schemas/StoreConfiguration'
    AccountStoreAddEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - store
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: account_store_add
          enum:
            - account_store_add
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        store:
          $ref: '#/components/schemas/Store'
    AccountStoreUpdateEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - store
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: account_store_update
          enum:
            - account_store_update
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        store:
          $ref: '#/components/schemas/Store'
    AccountStoreDeleteEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - store
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: account_store_delete
          enum:
            - account_store_delete
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        store:
          $ref: '#/components/schemas/Store'
    LegalEntityTypeReadOnly:
      type: string
      description: |
        Type of legal entity
      enum:
        - company
        - individual
    Individual:
      type: object
      description: |
        Used only if `type` is `individual`.
      additionalProperties: false
      properties:
        name:
          type: string
        birth_date:
          type: string
          format: date
        phone_number:
          type: string
        email:
          type: string
          format: email
        address_line:
          type: string
          example: Sommerkroveien 34
        address_line_2:
          type: string
          example: PB 123
        address_postal_code:
          type: string
          example: '0349'
        address_city:
          type: string
          example: Oslo
        address_country:
          type: string
          format: iso-3166-1
          description: |
            ISO 3166-1 country code
          example: 'NO'
    BankAccountCountryCode:
      type: string
      description: |
        Which country the bank account is registered in.
        Must be a two letter ISO 3166-1-alpha-2 country code.

        Supported bank account country codes:
          * `AT` (Austria)
          * `BE` (Belgium)
          * `HR` (Croatia)
          * `CY` (Cyprus)
          * `DK` (Denmark)
          * `EE` (Estonia)
          * `FI` (Finland)
          * `FR` (France)
          * `DE` (Germany)
          * `GR` (Greece)
          * `IE` (Ireland)
          * `IS` (Iceland)
          * `IT` (Italy)
          * `LV` (Latvia)
          * `LT` (Lithuania)
          * `LU` (Luxembourg)
          * `MT` (Malta)
          * `NL` (Netherlands)
          * `NO` (Norway)
          * `PT` (Portugal)
          * `SK` (Slovakia)
          * `SI` (Slovenia)
          * `ES` (Spain)
          * `SE` (Sweden)
          * `UK` (United Kingdoms)
          * `US` (United States of America)
      maxLength: 2
      minLength: 2
      pattern: ^[A-Z]{2}$
      example: 'NO'
    PayoutDestinationBankAccount:
      type: object
      required:
        - bank_account_currency
      properties:
        bank_name:
          type: string
          description: Name of the Bank used
        bank_account_number:
          type: string
          description: BBAN, national bank account number
        bank_account_number_type:
          type: string
          enum:
            - IBAN
            - BBAN
          description: |
            The type of bank account number. Will default to BBAN in bank_country_code
            is norwegian. Will default to IBAN in all other countries.
        bank_account_country_code:
          $ref: '#/components/schemas/BankAccountCountryCode'
        bank_account_currency:
          type: string
          format: iso4217-code
          example: NOK
          description: |
            The three-character ISO-4217 currency.
            https://en.wikipedia.org/wiki/ISO_4217
        bank_identification_code:
          type: string
          example: DNBANOKKXXX
          description: |
            A BIC code, or Bank Identifier Code also know as SWIFT code, consistin of
            8 to 11 alphanumeric characters.
    ApprovalLinks:
      type: array
      items:
        type: object
        properties:
          href:
            type: string
            description: The URL of the link.
            format: uri
          rel:
            type: string
            description: |
              Specifies the type of link
            enum:
              - contract_url
              - cdd_case_url
              - dintero_cdd_case_url
              - declaration_url
              - signed_contract_file_url
    AuthPayoutDestinationBaseReadOnly:
      type: object
      required:
        - id
        - created_at
        - created_by
        - updated_at
        - updated_by
        - account_id
        - case_status
        - type
      properties:
        id:
          type: string
        payout_destination_id:
          $ref: '#/components/schemas/PayoutDestinationId'
        created_at:
          type: string
        created_by:
          type: string
        updated_at:
          type: string
        updated_by:
          type: string
        account_id:
          type: string
          pattern: ^[PT]{1}\d{8}$
        case_status:
          $ref: '#/components/schemas/ApprovalStatus'
        type:
          $ref: '#/components/schemas/LegalEntityTypeReadOnly'
        merchant_category_code:
          type: string
          pattern: ^\d{1,4}
          format: mcc
          example: '2741'
        organization:
          type: object
          description: Organization data for company type of payout destination
          required:
            - organization_number
          properties:
            organization_number:
              type: string
            name:
              type: string
            trade_name:
              type: string
        individual:
          $ref: '#/components/schemas/Individual'
        address:
          $ref: '#/components/schemas/Address'
        bank_accounts:
          type: array
          minItems: 1
          maxItems: 2
          description: |
            Bank accounts associated with the payout destination.
          items:
            $ref: '#/components/schemas/PayoutDestinationBankAccount'
        payout_interval_type:
          type: string
          enum:
            - day
            - week
            - month
            - manual
        payout_reference:
          type: string
          description: Reference on transfers in bank statements
        email:
          type: string
          format: email
        website:
          type: string
          format: uri
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        payout_destination_name:
          type: string
          description: The name of the payout destination
        payout_destination_description:
          type: string
          description: Description of the payout destination
        links:
          $ref: '#/components/schemas/ApprovalLinks'
    AccountPayoutDestination:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuthPayoutDestinationBaseReadOnly'
    AccountPayoutDestinationAddEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - payout_destination
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: account_payout_destination_add
          enum:
            - account_payout_destination_add
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        payout_destination:
          $ref: '#/components/schemas/AccountPayoutDestination'
    AccountPayoutDestinationDeleteEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - payout_destination
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: account_payout_destination_delete
          enum:
            - account_payout_destination_delete
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        payout_destination:
          $ref: '#/components/schemas/AccountPayoutDestination'
    CardToken:
      type: object
      required:
        - id
        - payment_product_type
        - type
        - status
        - card_brand
      properties:
        id:
          type: string
        token:
          type: string
        type:
          type: string
          enum:
            - payment_token
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - SUSPENDED
            - CANCELLED
            - DELETED
        card_brand:
          type: string
          enum:
            - visa
            - mastercard
        masked_pan:
          type: string
          example: 476173******0416
        pan_expiry_date:
          type: string
          format: \d{2}/\d{4}
          example: 09/2030
        token_expiry_date:
          type: string
          format: \d{2}/\d{4}
          example: 09/2030
        links:
          type: array
          items:
            type: object
            required:
              - href
              - rel
            properties:
              href:
                type: string
              rel:
                type: string
                enum:
                  - digital_card_art
                  - digital_card_art_background
                  - card_symbol
                  - terms_and_conditions
              mime_type:
                type: string
                enum:
                  - image/png
                  - image/pdf
                  - text/plain
                  - text/html
        customer_id:
          type: string
        account_id:
          type: string
          example: P12345678
        relationship_id:
          type: string
          description: |
            Reference to the merchant entity for which the token is dedicated.
            Merchant-dedicated tokens are uniquely created per merchant_relationship_id.
        transaction_id:
          type: string
          format: checkout-id
          description: |
            Reference to the transaction where the token was created
        external_token_references:
          type: array
          items:
            type: string
          description: |
            External references to migrated card tokens
        payment_product_type:
          type: string
          example: dintero_psp.creditcard
    CardTokenRead:
      type: object
      allOf:
        - $ref: '#/components/schemas/CardToken'
        - required:
            - account_id
            - created_at
            - updated_at
          properties:
            account_id:
              type: string
              pattern: ^[PT]{1}\d{8}$
              minLength: 9
              maxLength: 9
            created_at:
              type: string
              format: date-time
            created_by:
              type: string
            updated_at:
              type: string
              format: date-time
            deleted_at:
              type: string
              format: date-time
            deleted_by:
              type: string
    CardTokenAdd:
      type: object
      allOf:
        - $ref: '#/components/schemas/CardTokenRead'
        - required:
            - token
            - masked_pan
            - token_expiry_date
    CardTokenUpdate:
      type: object
      allOf:
        - $ref: '#/components/schemas/CardTokenRead'
        - required:
            - token
            - masked_pan
            - token_expiry_date
    CardTokenDelete:
      type: object
      allOf:
        - $ref: '#/components/schemas/CardTokenRead'
        - required:
            - deleted_at
            - deleted_by
    CheckoutTokenEventBase:
      type: object
      properties:
        account_id:
          type: string
          example: P12345678
          pattern: ^[PT]\d{8}
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        event:
          type: string
          example: checkout_token_add
          enum:
            - checkout_token_add
            - checkout_token_update
            - checkout_token_delete
        token:
          type: object
      required:
        - account_id
        - event_delivery
        - event
        - token
    SecretBase:
      type: object
      properties:
        type:
          type: string
          enum:
            - HMAC-SHA1
            - AWS4-HMAC-SHA256
            - Authorization
      required:
        - type
