{
  "auth": {
    "bearer": [
      {
        "key": "token",
        "type": "string",
        "value": "{{secret_key}}"
      }
    ],
    "type": "bearer"
  },
  "info": {
    "_postman_id": "5b8f2c41-3a9d-4e77-b2c1-cedilink01",
    "description": "CediLink API v1 \u2014 direct MoMo collections in Ghana (GHS) on the live Yebeck rail, plus bank transfer, USSD and card in Nigeria (NGN) on the Flutterwave rail, checkout, webhooks, refunds and payouts.\n\nSet the collection variables before you start: `secret_key` (your sk_live_... or sk_test_... from Dashboard \u2192 Developers), and after creating an intent, `intent_id` and `client_secret` from the 201 response.\n\nAmounts are integers in minor units: GH\u20b5 250.00 is 25000, \u20a65,000.00 is 500000. Live API: https://cedilinkweb-production.up.railway.app/v1 \u2014 full reference: download cedilink-api-reference.md from Dashboard \u2192 Developers, or read https://cedilink.vercel.app/docs.",
    "name": "CediLink API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1/collection.json"
  },
  "item": [
    {
      "item": [
        {
          "name": "Create \u2014 Ghana mobile money",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 25000,\n  \"currency\": \"GHS\",\n  \"method\": \"mobile_money\",\n  \"network\": \"MTN\",\n  \"customer\": { \"phone\": \"0244123456\", \"email\": \"ama@example.com\" },\n  \"reference\": \"order-4471\",\n  \"description\": \"Order #4471\",\n  \"metadata\": { \"cart_id\": \"c_9912\" }\n}"
            },
            "description": "Creates a payment intent (201, no prompt sent yet \u2014 initiation is deferred). Copy `id` \u2192 {{intent_id}} and `client_secret` \u2192 {{client_secret}} from the 201 response, then use the Checkout requests: account check \u2192 MoMo prompt. Or open `checkout_url` \u2014 the ?cs= client secret in it is required.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "payment_intents"
              ],
              "raw": "{{base_url}}/payment_intents"
            }
          }
        },
        {
          "name": "Create \u2014 Nigeria bank transfer",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 500000,\n  \"currency\": \"NGN\",\n  \"method\": \"bank_transfer\",\n  \"customer\": { \"email\": \"chidi@example.com\" },\n  \"reference\": \"order-4472\"\n}"
            },
            "description": "Returns a dynamic virtual account in next_action (accountNumber, bankName, expiresAt \u2014 typically 1 hour).",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "payment_intents"
              ],
              "raw": "{{base_url}}/payment_intents"
            }
          }
        },
        {
          "name": "Create \u2014 Nigeria USSD",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 250000,\n  \"currency\": \"NGN\",\n  \"method\": \"ussd\",\n  \"bank_code\": \"058\",\n  \"customer\": { \"email\": \"ngozi@example.com\" },\n  \"reference\": \"order-4473\"\n}"
            },
            "description": "bank_code is the customer's own bank's numeric code (058 = GTBank). Fetch valid codes from the Banks requests below.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "payment_intents"
              ],
              "raw": "{{base_url}}/payment_intents"
            }
          }
        },
        {
          "name": "Create \u2014 Card",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 250000,\n  \"currency\": \"NGN\",\n  \"method\": \"card\",\n  \"customer\": {\n    \"email\": \"ngozi@example.com\"\n  },\n  \"reference\": \"order-4474\",\n  \"return_url\": \"https://yourshop.com/thanks\"\n}"
            },
            "description": "Card is NGN only. Expect a redirect or submit_otp next_action; easiest via the hosted checkout_url in the response.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "payment_intents"
              ],
              "raw": "{{base_url}}/payment_intents"
            }
          }
        },
        {
          "name": "Retrieve a payment intent",
          "request": {
            "description": "Returns { id, object, status, amount, currency }. Another merchant's intent returns 404, not 403.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "payment_intents",
                "{{intent_id}}"
              ],
              "raw": "{{base_url}}/payment_intents/{{intent_id}}"
            }
          }
        },
        {
          "name": "Validate OTP",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"otp\": \"123456\"\n}"
            },
            "description": "Use when the intent's next_action.type is submit_otp. A wrong code returns 402 otp_invalid.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "payment_intents",
                "{{intent_id}}",
                "validate"
              ],
              "raw": "{{base_url}}/payment_intents/{{intent_id}}/validate"
            }
          }
        }
      ],
      "name": "Payment intents"
    },
    {
      "description": "Public calls authenticated by the intent's client_secret (?cs=), safe from a browser. No API key.",
      "item": [
        {
          "name": "Get checkout intent",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "Everything a checkout page needs: amount_minor, merchant_name, method, network, masked customer_hint, next_action, expires_at.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "checkout",
                "{{intent_id}}"
              ],
              "query": [
                {
                  "key": "cs",
                  "value": "{{client_secret}}"
                }
              ],
              "raw": "{{base_url}}/checkout/{{intent_id}}?cs={{client_secret}}"
            }
          }
        },
        {
          "name": "Check account name",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"phone\": \"0244123456\",\n  \"network\": \"MTN\"\n}"
            },
            "description": "Step 1 of the direct MoMo flow: looks the number up and returns the registered account name (201), binding phone + network + name to the intent. The lookup never refuses: a lookup that finds no account, answers without a name, or cannot run returns 201 with account_name null \u2014 the prompt itself is the final check. The body may be empty \u2014 it then falls back to the phone and network the intent was created with. No prompt is sent here.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "checkout",
                "{{intent_id}}",
                "yebeck"
              ],
              "raw": "{{base_url}}/checkout/{{intent_id}}/yebeck?cs={{client_secret}}",
              "query": [
                {
                  "key": "cs",
                  "value": "{{client_secret}}"
                }
              ]
            }
          }
        },
        {
          "name": "Start MoMo collection",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"phone\": \"0244123456\",\n  \"network\": \"MTN\"\n}"
            },
            "description": "Step 2 of the direct MoMo flow: sends the prompt to the customer's phone. network must be MTN, TELECEL or AIRTELTIGO. Returns 201 { status, next_action }. The body may be empty \u2014 it then uses the number bound by the account check. 409 already_submitted when a prompt is already waiting: poll instead, never a second prompt.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "checkout",
                "{{intent_id}}",
                "momo"
              ],
              "query": [
                {
                  "key": "cs",
                  "value": "{{client_secret}}"
                }
              ],
              "raw": "{{base_url}}/checkout/{{intent_id}}/momo?cs={{client_secret}}"
            }
          }
        },
        {
          "name": "Validate OTP at checkout",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"otp\": \"123456\"\n}"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "checkout",
                "{{intent_id}}",
                "validate"
              ],
              "query": [
                {
                  "key": "cs",
                  "value": "{{client_secret}}"
                }
              ],
              "raw": "{{base_url}}/checkout/{{intent_id}}/validate?cs={{client_secret}}"
            }
          }
        }
      ],
      "name": "Checkout (client secret)"
    },
    {
      "item": [
        {
          "name": "Get API version",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "Public, no key. Answers the build the live API is running: { status, commit }. Confirm a deploy landed before you test against it.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{api_root}}"
              ],
              "path": [
                "version"
              ],
              "raw": "{{api_root}}/version"
            }
          }
        },
        {
          "name": "List banks \u2014 Nigeria",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "Public \u2014 no key needed. Returns { data: [{ code, name }] } for the USSD bank picker. On the live Ghana rail (Yebeck) this answers 502 \u2014 Yebeck lists Ghana banks only \u2014 and the Nigeria list is served when the Flutterwave rail is configured.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "banks"
              ],
              "query": [
                {
                  "key": "country",
                  "value": "NG"
                }
              ],
              "raw": "{{base_url}}/banks?country=NG"
            }
          }
        },
        {
          "name": "List banks \u2014 Ghana",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "banks"
              ],
              "query": [
                {
                  "key": "country",
                  "value": "GH"
                }
              ],
              "raw": "{{base_url}}/banks?country=GH"
            }
          }
        },
        {
          "name": "Check your key",
          "request": {
            "description": "Returns { merchant_id, mode } for the key in {{secret_key}}. The fastest way to confirm a key works and which mode it is in.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "account"
              ],
              "raw": "{{base_url}}/account"
            }
          }
        },
        {
          "name": "Verify a number",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"phone\": \"0244123456\",\n  \"network\": \"MTN\",\n  \"amount_minor\": 5000,\n  \"currency\": \"GHS\"\n}"
            },
            "description": "Secret-key only. Confirms the number holds a live MoMo account on the network and returns the registered account name plus the total the customer will pay (requested + 2% customer fee). Only verified: true approves sending the prompt. no_account means do not prompt; a 502 means the check could not run \u2014 retry later.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "verify-number"
              ],
              "raw": "{{base_url}}/verify-number"
            }
          }
        }
      ],
      "name": "Reference data"
    },
    {
      "item": [
        {
          "name": "Register an endpoint",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"url\": \"https://yourshop.com/hooks/cedilink\",\n  \"events\": [\"*\"]\n}"
            },
            "description": "The 201 response contains the whsec_ signing secret \u2014 shown ONCE. Deliveries are signed in the X-CediLink-Signature header (t=<unix>,v1=HMAC-SHA256(secret, t + '.' + raw body)). Verify before trusting; see the reference for the code sample.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhook_endpoints"
              ],
              "raw": "{{base_url}}/webhook_endpoints"
            }
          }
        }
      ],
      "name": "Webhooks"
    },
    {
      "description": "Session-authenticated (cookie), NOT API-key \u2014 the same endpoints the dashboard's Settlements page uses. Set {{session_cookie}} from a signed-in browser session. Withdrawals run through the payout account: move money there first (5% commission taken at the move), then send it. The send is instant at any amount \u2014 no approval lock (owner order, 2026-11-27). There is deliberately no secret-key endpoint that moves money out.",
      "item": [
        {
          "name": "Move to payout account",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_minor\": 100000,\n  \"currency\": \"GHS\"\n}"
            },
            "description": "Moves money from your balance into your payout account. The 5% withdrawal commission is taken here (an admin override can change the rate; the default is 5%). 201 returns the move with commission_minor and net_minor.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "{{session_cookie}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "me",
                "payout-account",
                "move"
              ],
              "raw": "{{base_url}}/me/payout-account/move"
            }
          }
        },
        {
          "name": "Send from payout account",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_minor\": 100000,\n  \"currency\": \"GHS\",\n  \"account\": \"0244123456\",\n  \"account_name\": \"Ama Serwaa\",\n  \"network\": \"MTN\"\n}"
            },
            "description": "Creates a disbursement from the payout account. The account name is looked up first \u2014 ADVISORY-ONLY: a lookup that finds no account, answers without a name, or cannot run never refuses the payout; the verified name replaces the typed one when it comes back, and the disbursement itself is the final check. account_name is optional on Yebeck (the lookup supplies the verified name) and required on rails that do not verify. It is sent instantly at any amount \u2014 no approval lock (owner order, 2026-11-27). Omit network for a bank destination. The old POST /v1/me/payouts answers 410 withdrawals_replaced.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "{{session_cookie}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "me",
                "payout-account",
                "disburse"
              ],
              "raw": "{{base_url}}/me/payout-account/disburse"
            }
          }
        },
        {
          "name": "List payouts",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "Latest 50, newest first: { data: [{ id, amountMinor, commissionMinor, netMinor, currency, status, destination, requestedAt, completedAt, failureReason }] }.",
            "header": [
              {
                "key": "Cookie",
                "value": "{{session_cookie}}"
              }
            ],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "me",
                "payouts"
              ],
              "raw": "{{base_url}}/me/payouts"
            }
          }
        },
        {
          "name": "List payments",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "Latest 100 charges, newest first, optional ?status= filter. Amounts are strings in minor units; customer numbers arrive pre-masked.",
            "header": [
              {
                "key": "Cookie",
                "value": "{{session_cookie}}"
              }
            ],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "me",
                "payments"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "failed"
                }
              ],
              "raw": "{{base_url}}/me/payments?status=failed"
            }
          }
        },
        {
          "name": "Admin direct withdrawal",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_minor\": 500000,\n  \"account\": \"0248774213\",\n  \"network\": \"MTN\",\n  \"account_name\": \"Danny\",\n  \"narration\": \"owner draw\"\n}"
            },
            "description": "Admin-only \u2014 no API key. Withdraws straight from the Yebeck float to a MoMo number, on demand, with an admin session (cedilink_admin cookie). NO commission on this path (owner order, 2026-11-28): the 5% is the merchant withdrawal commission, and an admin taking their own money from the float pays none \u2014 commission is always 0, net == gross, whatever any per-merchant override says; no 2% platform fee rides here either. Provider send fee 0 on Yebeck. The actual amount withdrawn is net = gross \u2212 commission \u2212 send fee, which here is just the gross: GH\u20b55,000 \u2192 GH\u20b50 commission \u2192 GH\u20b55,000.00 sent. The account name is looked up first \u2014 ADVISORY-ONLY: a lookup that finds no account, answers without a name, or cannot run never refuses the withdrawal; the verified name replaces the typed one when it comes back, and the disbursement itself is the final check. Goes through the same dispatcher as every merchant payout (atomic claim, re-query-before-resend, amount guard, two-strike rule). At most GH\u20b510,000 per withdrawal (400 amount_too_large); if the float cannot cover the full amount it answers 400 insufficient_float and nothing is sent. Send Idempotency-Key: a retry with the same key returns the original payout and never pays twice. Finance and owner roles only. Needs database migration 041 \u2014 before it runs, the endpoint answers 409 migration_required.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "9f2c1a77-..."
              },
              {
                "key": "Cookie",
                "value": "{{session_cookie}}"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "withdraw"
              ],
              "raw": "{{base_url}}/admin/withdraw"
            }
          }
        }
      ],
      "name": "Payouts (dashboard session)"
    },
    {
      "description": "Public \u2014 no API key. A refund is matched to a succeeded charge by its provider reference and the number it was paid with, so only someone who knows both can ask for one. An admin approves it before any money moves.",
      "item": [
        {
          "name": "Request a refund",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"provider_ref\": \"MVN-261126-CF3D0D56\",\n  \"phone\": \"0244123456\",\n  \"reason\": \"Customer requested a refund\"\n}"
            },
            "description": "201 returns { data: { id, status: \"pending\" } } \u2014 copy id \u2192 {{refund_id}}. A second request for the same payment returns 200 already_requested: true; no matching succeeded charge returns 404 refund_not_matched. The refund amount is the charge amount minus the PIN fee.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "refunds",
                "request"
              ],
              "raw": "{{base_url}}/refunds/request"
            }
          }
        },
        {
          "name": "Check refund status",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "200 returns { data: { id, status, amount_minor, created_at } }; unknown id returns 404.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "refunds",
                "status",
                "{{refund_id}}"
              ],
              "raw": "{{base_url}}/refunds/status/{{refund_id}}"
            }
          }
        }
      ],
      "name": "Refunds"
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "type": "string",
      "value": "https://cedilinkweb-production.up.railway.app/v1"
    },
    {
      "key": "api_root",
      "type": "string",
      "value": "https://cedilinkweb-production.up.railway.app"
    },
    {
      "key": "secret_key",
      "type": "string",
      "value": "sk_test_REPLACE_ME"
    },
    {
      "key": "publishable_key",
      "type": "string",
      "value": "pk_test_REPLACE_ME"
    },
    {
      "key": "intent_id",
      "type": "string",
      "value": "pi_01HXYZ"
    },
    {
      "key": "client_secret",
      "type": "string",
      "value": "cs_REPLACE_ME"
    },
    {
      "key": "session_cookie",
      "type": "string",
      "value": "cedilink_session=REPLACE_ME"
    },
    {
      "key": "refund_id",
      "type": "string",
      "value": "rfd_01HXYZ"
    }
  ]
}