{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "http:\/\/merchant.pensopay.com"
        }
    ],
    "info": {
        "name": "pensopay merchant api",
        "_postman_id": "ce0d0bf2-d7c4-41f1-b6f3-bd4254abcd2c",
        "description": "",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Merchants",
            "description": "\nEndpoints for managing merchants.\n\n**Changes**\n- 2024-06-17: Support for non-DK countries added, requires input in `company_information` array-field.\n- 2024-06-17: The `information` field has been renamed to `company_information`.",
            "item": [
                {
                    "name": "Create a merchant",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/merchants",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/merchants"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"reference_id\":\"398475\",\"contact_name\":\"John Doe\",\"contact_email\":\"johndoe@example.com\",\"company_phone\":\"77344388\",\"business_model_description\":\"hic\",\"country\":\"DK\",\"cvr\":\"36410876\",\"iban\":\"DK9230055205310542\",\"company_information\":[\"sapiente\"],\"url\":\"https:\\\/\\\/pensopay.com\",\"webhook\":\"https:\\\/\\\/example.com\\\/webhooks\",\"addons\":[\"asperiores\"]}"
                        },
                        "description": "If a webhook **is not** provided, the request will take up to 10 seconds.\n\nIf a webhook **is** provided, the request will use the webhook to inform\nwhen the merchant creation process is done."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n    \"data\": {\n        \"uuid\": \"3af2082e-e6c6-4a53-be24-2741eff37a3d\",\n        \"reference_id\": 398475,\n        \"state\": \"live_awaiting_approval\",\n        \"country\": \"DK\",\n        \"cvr\": \"36410876\",\n        \"contact_name\": \"John Doe\",\n        \"contact_email\": \"johndoe@pensopay.com\",\n        \"url\": \"https:\/\/pensopay.com\",\n        \"company_information\": {\n            \"cvr\": 36410876,\n            \"city\": \"Vejle\",\n            \"name\": \"PENSOPAY A\/S\",\n            \"email\": \"contact@pensopay.com\",\n            \"phone\": \"77344388\",\n            \"address\": \"Roms Hule 4, 3. sal\",\n            \"zipcode\": 7100\n        },\n        \"created_at\": \"2022-04-20T13:37:00.000000Z\",\n        \"credentials\": {\n            \"pensopay\": {\n                \"token\": \"9037c9b0b8690aa148b2d28b9d2a949e8a664055570df4c5b964c503a2047422\",\n                \"account_id\": 112233,\n                \"private_key\": \"b9f11f2b2cd3feb6b682322890dc7d9946a20d118a84607451291c298bd60f78\"\n            }\n        },\n        \"addons\": {\n            \"mobilepay\": true\n        }\n    }\n}",
                            "name": "Successful request without a webhook"
                        },
                        {
                            "header": [],
                            "code": 401,
                            "body": "{\n \"message\": \"Unauthenticated.\"\n}",
                            "name": "Unauthorized (missing or invalid API token)"
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\n \"message\": \"This action is unauthorized.\"\n}",
                            "name": "Insufficient API token permissions"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n \"message\": \"The given data was invalid.\",\n \"errors\": {\n     \"contact_name\": [\n         \"The name field is required.\"\n     ],\n     \"contact_email\": [\n         \"The email field is required.\"\n     ],\n     \"iban\": [\n         \"The iban field is required.\"\n     ],\n     \"cvr\": [\n         \"The cvr field is invalid.\"\n     ]\n}",
                            "name": "Validation error of input"
                        },
                        {
                            "header": [],
                            "code": 500,
                            "body": "{\n \"message\": \"An internal error occured. Pensopay has been notified.\"\n}",
                            "name": "Internal server error"
                        }
                    ]
                },
                {
                    "name": "List merchants",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/merchants",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "41",
                                    "description": "Which page to display. Must be at least 1.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "5",
                                    "description": "How many items to display per page. Must be at least 1. Must not be greater than 50.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/merchants?page=41&per_page=5"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "List all merchants created by authenticated user"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n     {\n         \"uuid\": \"3af2082e-e6c6-4a53-be24-2741eff37a0d\",\n         \"reference_id\": 398475,\n         \"state\": \"live_awaiting_approval\",\n         \"cvr\": \"36410876\",\n         \"contact_name\": \"John Doe\",\n         \"contact_email\": \"johndoe@pensopay.com\",\n         \"url\": \"https:\/\/pensopay.com\",\n         \"company_information\": {\n             \"cvr\": 36410876,\n             \"city\": \"Vejle\",\n             \"name\": \"PENSOPAY A\/S\",\n             \"email\": \"contact@pensopay.com\",\n             \"phone\": \"77344388\",\n             \"address\": \"Roms Hule 4, 3. sal\",\n             \"zipcode\": 7100\n         },\n         \"created_at\": \"2022-04-20T13:37:00.000000Z\",\n         \"credentials\": {\n             \"pensopay\": {\n                 \"token\": \"9837c9b0b8690aa148b2d28b9d2a949e8a664055570df4c5b964c503a1047422\",\n                 \"account_id\": 112233,\n                 \"private_key\": \"b9f10f2b2cd3feb6b682322890cc7d9946a20d118a84607451291c298bd60f78\"\n              }\n         },\n        \"addons\": {\n            \"mobilepay\": true\n        }\n     }\n ]\n}",
                            "name": "Collection of merchants created"
                        }
                    ]
                },
                {
                    "name": "Show single merchant",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/merchants\/:merchant_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/merchants\/:merchant_id",
                            "variable": [
                                {
                                    "id": "merchant_id",
                                    "key": "merchant_id",
                                    "value": "culpa",
                                    "description": "The merchant's VAT or UUID"
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\":\n     {\n         \"uuid\": \"3af2082e-e6c6-4a53-be24-2741eff37a0d\",\n         \"reference_id\": 398475,\n         \"state\": \"live_awaiting_approval\",\n         \"cvr\": \"36410876\",\n         \"contact_name\": \"John Doe\",\n         \"contact_email\": \"johndoe@pensopay.com\",\n         \"url\": \"https:\/\/pensopay.com\",\n         \"company_information\": {\n             \"cvr\": 36410876,\n             \"city\": \"Vejle\",\n             \"name\": \"PENSOPAY A\/S\",\n             \"email\": \"contact@pensopay.com\",\n             \"phone\": \"77344388\",\n             \"address\": \"Roms Hule 4, 3. sal\",\n             \"zipcode\": 7100\n         },\n         \"created_at\": \"2022-04-20T13:37:00.000000Z\",\n         \"credentials\": {\n             \"pensopay\": {\n                 \"token\": \"9837c9b0b8690aa148b2d28b9d2a949e8a664055570df4c5b964c503a1047422\",\n                 \"account_id\": 112233,\n                 \"private_key\": \"b9f10f2b2cd3feb6b682322890cc7d9946a20d118a84607451291c298bd60f78\"\n              }\n         },\n       \"addons\": {\n            \"mobilepay\": true\n        }\n     }\n}",
                            "name": "Merchant"
                        }
                    ]
                },
                {
                    "name": "Request merchant off-boarding",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/merchants\/:merchant_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/merchants\/:merchant_id",
                            "variable": [
                                {
                                    "id": "merchant_id",
                                    "key": "merchant_id",
                                    "value": "labore",
                                    "description": "The merchant's VAT or UUID"
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 204,
                            "body": "",
                            "name": "Successful request"
                        },
                        {
                            "header": [],
                            "code": 401,
                            "body": "{\n \"message\": \"Unauthenticated.\"\n}",
                            "name": "Unauthorized (missing or invalid API token)"
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\n \"message\": \"This action is unauthorized.\"\n}",
                            "name": "Insufficient API token permissions"
                        },
                        {
                            "header": [],
                            "code": 500,
                            "body": "{\n \"message\": \"An internal error occured. Pensopay has been notified.\"\n}",
                            "name": "Internal server error"
                        }
                    ]
                },
                {
                    "name": "Update a merchant",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/merchants\/:merchant_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/merchants\/:merchant_id",
                            "variable": [
                                {
                                    "id": "merchant_id",
                                    "key": "merchant_id",
                                    "value": "iusto",
                                    "description": "The merchant's VAT or UUID"
                                }
                            ]
                        },
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "[]"
                        },
                        "description": "Partially update a merchant."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": {\n         \"uuid\": \"3af2082e-e6c6-4a53-be24-2741eff37a0d\",\n         \"reference_id\": 398475,\n         \"state\": \"live_awaiting_approval\",\n         \"cvr\": \"36410876\",\n         \"contact_name\": \"John Doe\",\n         \"contact_email\": \"johndoe@pensopay.com\",\n         \"url\": \"https:\/\/pensopay.com\",\n         \"company_information\": {\n             \"cvr\": 36410876,\n             \"city\": \"Vejle\",\n             \"name\": \"PENSOPAY A\/S\",\n             \"email\": \"contact@pensopay.com\",\n             \"phone\": \"77344388\",\n             \"address\": \"Roms Hule 4, 3. sal\",\n             \"zipcode\": 7100\n         },\n         \"created_at\": \"2022-04-20T13:37:00.000000Z\",\n         \"credentials\": {\n             \"pensopay\": {\n                 \"token\": \"9837c9b0b8690aa148b2d28b9d2a949e8a664055570df4c5b964c503a1047422\",\n                 \"account_id\": 112233,\n                 \"private_key\": \"b9f10f2b2cd3feb6b682322890cc7d9946a20d118a84607451291c298bd60f78\"\n              }\n         },\n        \"addons\": {\n            \"mobilepay\": true\n        }\n }",
                            "name": "Update merchant"
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "key",
                "type": "string"
            }
        ]
    }
}