{
    "info": {
        "name": "RailBot API v1",
        "description": "Set api_key in a private environment. Set a distinct request key for each new paid read or top-up. Keep it unchanged when retrying.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{api_key}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "base_url",
            "value": "https://railbot.5.75.206.151.sslip.io"
        },
        {
            "key": "api_key",
            "value": ""
        },
        {
            "key": "app_id",
            "value": "17"
        },
        {
            "key": "invoice_reference",
            "value": ""
        },
        {
            "key": "topup_amount",
            "value": "10.00"
        },
        {
            "key": "credential_request_key",
            "value": ""
        },
        {
            "key": "topup_request_key",
            "value": ""
        }
    ],
    "item": [
        {
            "name": "Wallet balance",
            "request": {
                "method": "GET",
                "url": "{{base_url}}/api/v1/wallet",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ]
            }
        },
        {
            "name": "List apps",
            "request": {
                "method": "GET",
                "url": "{{base_url}}/api/v1/apps",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ]
            }
        },
        {
            "name": "Read app credentials (paid)",
            "request": {
                "method": "POST",
                "url": "{{base_url}}/api/v1/apps/{{app_id}}/credentials",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{credential_request_key}}"
                    }
                ]
            }
        },
        {
            "name": "Create top-up invoice",
            "request": {
                "method": "POST",
                "url": "{{base_url}}/api/v1/wallet/topups",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    },
                    {
                        "key": "Idempotency-Key",
                        "value": "{{topup_request_key}}"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"amount\": \"{{topup_amount}}\"\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Check top-up invoice",
            "request": {
                "method": "GET",
                "url": "{{base_url}}/api/v1/wallet/topups/{{invoice_reference}}",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json"
                    }
                ]
            }
        }
    ]
}