---
updatedAt: 2026-05-22T18:18:28.000Z
agentTools:
  projectIndex: https://docs.kyshi.co/llms.txt
---

# Initialise payment link

Creates a hosted checkout URL for one customer and one amount. Create links server-side: a link created in the browser is a link whose amount the customer can change.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/v1/pay/initialize": {
      "post": {
        "description": "Creates a hosted checkout URL for one customer and one amount. Create links server-side: a link created in the browser is a link whose amount the customer can change.",
        "operationId": "initializePaymentLink",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiatePaymentLinkIntegrationDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessResponseDto"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/PublicPaymentLinkDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid request parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "No valid API key provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "The API key lacks permission for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found. A 404 on an object you just created is usually a test/live mode mismatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "Business rule failure, such as an unsupported currency or insufficient balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Kyshi’s end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Initialise payment link",
        "tags": [
          "Payment Links"
        ],
        "x-readme": {
          "code-samples": [
            {
              "language": "typescript",
              "name": "Kyshi SDK",
              "code": "import { Kyshi } from '@kyshi/mor-sdk';\n\nconst kyshi = new Kyshi({ secretKey: process.env.KYSHI_SECRET_KEY! });\n\nconst result = await kyshi.paymentLinks.create({\n  \"customer\": {\n    \"firstName\": \"Dom\",\n    \"lastName\": \"Aba\",\n    \"email\": \"dom@yopmail.com\",\n    \"phoneNumber\": \"2348012345678\"\n  },\n  \"expiresAt\": \"2026-02-01T23:59:59Z\",\n  \"localCurrency\": \"NGN\",\n  \"description\": \"Invoice\",\n  \"metadata\": [\n    {\n      \"name\": \"Website design\",\n      \"amount\": 100,\n      \"quantity\": 1\n    }\n  ],\n  \"feeBearer\": \"CUSTOMER\",\n  \"taxChargeable\": \"EXCLUSIVE\",\n  \"taxEnabled\": false\n});",
              "install": "npm install @kyshi/mor-sdk"
            },
            {
              "language": "curl",
              "code": "curl --request POST \\\n  --url 'https://api.kyshi.co/v1/pay/initialize' \\\n  --header 'x-api-key: YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"customer\": {\n    \"firstName\": \"Dom\",\n    \"lastName\": \"Aba\",\n    \"email\": \"dom@yopmail.com\",\n    \"phoneNumber\": \"2348012345678\"\n  },\n  \"expiresAt\": \"2026-02-01T23:59:59Z\",\n  \"localCurrency\": \"NGN\",\n  \"description\": \"Invoice\",\n  \"metadata\": [\n    {\n      \"name\": \"Website design\",\n      \"amount\": 100,\n      \"quantity\": 1\n    }\n  ],\n  \"feeBearer\": \"CUSTOMER\",\n  \"taxChargeable\": \"EXCLUSIVE\",\n  \"taxEnabled\": false\n}'"
            },
            {
              "language": "javascript",
              "name": "Node.js (fetch)",
              "code": "const response = await fetch('https://api.kyshi.co/v1/pay/initialize', {\n  method: 'POST',\n  headers: {\n    'x-api-key': process.env.KYSHI_API_KEY,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"customer\": {\n    \"firstName\": \"Dom\",\n    \"lastName\": \"Aba\",\n    \"email\": \"dom@yopmail.com\",\n    \"phoneNumber\": \"2348012345678\"\n  },\n  \"expiresAt\": \"2026-02-01T23:59:59Z\",\n  \"localCurrency\": \"NGN\",\n  \"description\": \"Invoice\",\n  \"metadata\": [\n    {\n      \"name\": \"Website design\",\n      \"amount\": 100,\n      \"quantity\": 1\n    }\n  ],\n  \"feeBearer\": \"CUSTOMER\",\n  \"taxChargeable\": \"EXCLUSIVE\",\n  \"taxEnabled\": false\n}),\n});\n\nconst result = await response.json();"
            }
          ]
        }
      }
    }
  },
  "info": {
    "title": "Kyshi MoR Public API",
    "description": "Public API reference for Kyshi integrators.",
    "version": "1.0",
    "contact": {}
  },
  "tags": [
    {
      "name": "Payment Links",
      "description": "Hosted checkout URLs created for one customer and one amount."
    }
  ],
  "servers": [
    {
      "url": "https://api.kyshi.co",
      "description": "Production and Sandbox"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "SuccessResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": true,
            "description": "`true` on success."
          },
          "message": {
            "type": "string",
            "example": "Success"
          },
          "code": {
            "type": "number",
            "example": 200,
            "description": "Mirrors the HTTP status code."
          },
          "data": {
            "type": "object",
            "example": {},
            "description": "The endpoint-specific payload."
          }
        },
        "required": [
          "status",
          "message",
          "code",
          "data"
        ]
      },
      "ErrorResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": false,
            "description": "`false` on failure."
          },
          "message": {
            "type": "string",
            "example": "Unsupported Merchant Currency",
            "description": "Human-readable summary. Log it, but do not branch on it: the wording can change."
          },
          "code": {
            "type": "number",
            "example": 422,
            "description": "Mirrors the HTTP status code."
          },
          "data": {
            "type": "object",
            "example": {},
            "description": "Always empty on failure."
          }
        },
        "required": [
          "status",
          "message",
          "code",
          "data"
        ]
      },
      "CustomerInput": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Dom"
          },
          "lastName": {
            "type": "string",
            "example": "Aba"
          },
          "email": {
            "type": "string",
            "example": "dom@yopmail.com"
          },
          "customerCode": {
            "type": "string",
            "example": "CUS-100045"
          },
          "phoneNumber": {
            "type": "string",
            "example": "2348012345678"
          },
          "integrationId": {
            "type": "string",
            "example": "int_7f2f9170"
          },
          "metadata": {
            "type": "string",
            "example": "{\"orderId\":\"ORDER-100045\"}"
          },
          "riskAction": {
            "type": "string",
            "example": "default"
          },
          "internationalFormatPhone": {
            "type": "string",
            "example": "+2348012345678"
          }
        },
        "required": [
          "firstName",
          "lastName",
          "email",
          "customerCode",
          "phoneNumber",
          "integrationId",
          "metadata",
          "riskAction",
          "internationalFormatPhone"
        ]
      },
      "PublicPaymentLinkDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "pl_7f2f9170"
          },
          "reference": {
            "type": "string",
            "example": "KYSHI-1790057506631"
          },
          "link": {
            "type": "string",
            "example": "https://merchant.kyshi.co/pay/abc123"
          },
          "paymentLink": {
            "type": "string",
            "example": "https://merchant.kyshi.co/pay/abc123"
          },
          "amount": {
            "type": "number",
            "example": 1500
          },
          "currency": {
            "type": "string",
            "example": "NGN"
          },
          "status": {
            "type": "string",
            "example": "PENDING"
          },
          "customer": {
            "type": "object",
            "additionalProperties": true,
            "example": {}
          },
          "createdAt": {
            "type": "string",
            "example": "2026-09-22T06:11:46.331Z"
          }
        },
        "required": [
          "id"
        ]
      },
      "IntegrationMetadataInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Item or service name",
            "example": "Website design"
          },
          "amount": {
            "type": "number",
            "description": "Amount in the merchant settlement currency (e.g USD)",
            "example": 100
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the item",
            "example": 1
          }
        },
        "required": [
          "name",
          "amount",
          "quantity"
        ]
      },
      "InitiatePaymentLinkIntegrationDto": {
        "type": "object",
        "properties": {
          "customer": {
            "description": "Customer information",
            "example": {
              "firstName": "Dom",
              "lastName": "Aba",
              "email": "dom@yopmail.com",
              "phoneNumber": "2348012345678"
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerInput"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "description": "ISO 8601 expiration date of the payment link",
            "example": "2026-02-01T23:59:59Z"
          },
          "localCurrency": {
            "type": "string",
            "description": "Local currency the customer will pay in",
            "enum": [
              "NGN",
              "KES",
              "ZAR",
              "GHS",
              "XOF",
              "USD"
            ],
            "example": "NGN"
          },
          "description": {
            "type": "string",
            "description": "Payment description shown to the customer",
            "example": "Invoice"
          },
          "metadata": {
            "description": "Line items for the payment link",
            "example": [
              {
                "name": "Website design",
                "amount": 100,
                "quantity": 1
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationMetadataInput"
            }
          },
          "feeBearer": {
            "type": "string",
            "description": "Who bears platform fees",
            "enum": [
              "MERCHANT",
              "CUSTOMER"
            ],
            "example": "CUSTOMER"
          },
          "taxChargeable": {
            "type": "string",
            "description": "Tax behavior if tax is enabled",
            "enum": [
              "INCLUSIVE",
              "EXCLUSIVE"
            ],
            "example": "EXCLUSIVE"
          },
          "taxEnabled": {
            "type": "boolean",
            "description": "Enable Stripe automatic tax for USD payment links",
            "example": false
          }
        },
        "required": [
          "customer",
          "expiresAt",
          "localCurrency",
          "description",
          "metadata"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
```