{
  "info": {
    "name": "Mavunta Pay API",
    "description": "Accept M-Pesa, card, PayPal, Mavunta Balance, and crypto payments. Set the `apiKey` collection variable to a cwk_test_\u2026 (sandbox) or cwk_live_\u2026 (live) secret key. Full reference: https://developers.mavunta.com",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://sandbox-api.mavunta.com/v1",
      "description": "Sandbox base URL (cwk_test_ keys). Live keys use https://api.mavunta.com/v1."
    },
    {
      "key": "apiKey",
      "value": "cwk_test_sk_xxx"
    }
  ],
  "item": [
    {
      "name": "Verify key",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/auth/verify",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "auth",
            "verify"
          ]
        }
      }
    },
    {
      "name": "Get rates",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/rates",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rates"
          ]
        }
      }
    },
    {
      "name": "Create quote",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"source_currency\": \"KES\",\n  \"target_asset\": \"USDT\",\n  \"amount\": \"2500\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/quotes",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "quotes"
          ]
        }
      }
    },
    {
      "name": "Create payment intent",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "order-1001"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"amount\": \"2500\",\n  \"currency\": \"KES\",\n  \"settlement_currency\": \"USDT\",\n  \"payment_methods\": [\"mpesa\", \"card\", \"mavunta_balance\"],\n  \"merchant_reference\": \"ORDER-1001\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/payment-intents",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-intents"
          ]
        }
      }
    },
    {
      "name": "List payment intents",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/payment-intents?limit=20",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-intents"
          ],
          "query": [
            {
              "key": "limit",
              "value": "20"
            }
          ]
        }
      }
    },
    {
      "name": "Retrieve payment intent",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/payment-intents/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-intents",
            ":id"
          ],
          "variable": [
            {
              "key": "id",
              "value": "pi_test_xxx"
            }
          ]
        }
      }
    },
    {
      "name": "Cancel payment intent",
      "request": {
        "method": "POST",
        "url": {
          "raw": "{{baseUrl}}/payment-intents/:id/cancel",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-intents",
            ":id",
            "cancel"
          ],
          "variable": [
            {
              "key": "id",
              "value": "pi_test_xxx"
            }
          ]
        }
      }
    },
    {
      "name": "Request refund",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reason\": \"Customer returned item\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/payment-intents/:id/refund-request",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-intents",
            ":id",
            "refund-request"
          ],
          "variable": [
            {
              "key": "id",
              "value": "pi_test_xxx"
            }
          ]
        }
      }
    },
    {
      "name": "Create payment link",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"title\": \"Website design deposit\",\n  \"amount\": \"15000\",\n  \"currency\": \"KES\",\n  \"max_payments\": 1\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/payment-links",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-links"
          ]
        }
      }
    },
    {
      "name": "Retrieve payment link",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/payment-links/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment-links",
            ":id"
          ],
          "variable": [
            {
              "key": "id",
              "value": "pl_test_xxx"
            }
          ]
        }
      }
    }
  ]
}