---
updatedAt: 2026-06-24T16:20:45.000Z
agentTools:
  projectIndex: https://docs.kyshi.co/llms.txt
---

# Simulate subscription event

Drives a subscription through a billing event immediately instead of waiting for the real schedule. Test mode only.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/v1/subscriptions/{id}/simulate": {
      "post": {
        "description": "Drives a subscription through a billing event immediately instead of waiting for the real schedule. Test mode only.",
        "operationId": "simulateSubscription",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateSubscriptionFlowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessResponseDto"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/PublicSubscriptionActionDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "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": "Simulate subscription event",
        "tags": [
          "Subscriptions"
        ],
        "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.subscriptions.simulate(\"9f8fca44-c60b-4a31-878b-6fd4bcaad53c\", {\n  \"event\": \"due_charge\",\n  \"redirectUrl\": \"https://merchant.example.com/subscriptions/return\"\n});",
              "install": "npm install @kyshi/mor-sdk"
            },
            {
              "language": "curl",
              "code": "curl --request POST \\\n  --url 'https://api.kyshi.co/v1/subscriptions/9f8fca44-c60b-4a31-878b-6fd4bcaad53c/simulate' \\\n  --header 'x-api-key: YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"event\": \"due_charge\",\n  \"redirectUrl\": \"https://merchant.example.com/subscriptions/return\"\n}'"
            },
            {
              "language": "javascript",
              "name": "Node.js (fetch)",
              "code": "const response = await fetch('https://api.kyshi.co/v1/subscriptions/9f8fca44-c60b-4a31-878b-6fd4bcaad53c/simulate', {\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  \"event\": \"due_charge\",\n  \"redirectUrl\": \"https://merchant.example.com/subscriptions/return\"\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": "Subscriptions",
      "description": "Bill a customer on a repeating schedule, with automatic retries and dunning."
    }
  ],
  "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"
        ]
      },
      "PublicFeeBreakdownDto": {
        "type": "object",
        "properties": {
          "fee": {
            "type": "number",
            "example": 57
          },
          "vat": {
            "type": "number",
            "example": 180
          },
          "processorFee": {
            "type": "number",
            "example": 0
          },
          "stampDuty": {
            "type": "number",
            "example": 0
          },
          "allInclusiveKyshiFee": {
            "type": "number",
            "example": 57
          },
          "totalFees": {
            "type": "number",
            "example": 237
          },
          "others": {
            "type": "object",
            "additionalProperties": true,
            "example": {}
          }
        },
        "required": [
          "fee",
          "vat",
          "processorFee",
          "stampDuty",
          "allInclusiveKyshiFee",
          "totalFees",
          "others"
        ]
      },
      "PublicTransactionMetaDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 2.41
          },
          "symbol": {
            "type": "string",
            "example": "$"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "fxRate": {
            "type": "number",
            "example": 622.78,
            "nullable": true
          }
        },
        "required": [
          "amount",
          "symbol",
          "currency"
        ]
      },
      "PublicTransactionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "2f17fa50-a89e-41b8-b4dc-8da39c3c34db"
          },
          "amount": {
            "type": "number",
            "example": 1500
          },
          "type": {
            "type": "string",
            "enum": [
              "DR",
              "CR"
            ],
            "example": "CR"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "SUCCESS",
              "IN_REVIEW",
              "FAILED",
              "REVERSAL",
              "COLLECTED"
            ],
            "example": "SUCCESS"
          },
          "reference": {
            "type": "string",
            "example": "KYSHI-1790057506631"
          },
          "currency": {
            "type": "string",
            "example": "XOF"
          },
          "channel": {
            "type": "string",
            "example": "card"
          },
          "processor": {
            "type": "string",
            "enum": [
              "PROVIDUS_BANK",
              "STERLING",
              "VFD",
              "PAYSTACK",
              "FLUTTERWAVE",
              "CHOICE",
              "STITCH",
              "PAGA",
              "STRIPE",
              "ASSET_MFB",
              "MOMENTPAY",
              "PAWAPAY"
            ],
            "example": "PAWAPAY"
          },
          "feeBearer": {
            "type": "string",
            "enum": [
              "MERCHANT",
              "CUSTOMER"
            ],
            "example": "CUSTOMER"
          },
          "meta": {
            "$ref": "#/components/schemas/PublicTransactionMetaDto"
          },
          "feeBreakdown": {
            "$ref": "#/components/schemas/PublicFeeBreakdownDto"
          },
          "createdAt": {
            "type": "string",
            "example": "2026-09-22T06:11:46.331Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2026-09-22T06:11:54.677Z"
          }
        },
        "required": [
          "id",
          "amount",
          "type",
          "status",
          "reference",
          "currency",
          "createdAt",
          "updatedAt"
        ]
      },
      "PublicPlanDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "plan_7f2f9170"
          },
          "name": {
            "type": "string",
            "example": "Monthly Pro"
          },
          "amount": {
            "type": "number",
            "example": 5000
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "interval": {
            "type": "string",
            "example": "monthly"
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "createdAt": {
            "type": "string",
            "example": "2026-09-22T06:11:46.331Z"
          }
        },
        "required": [
          "id",
          "name",
          "amount",
          "currency"
        ]
      },
      "PublicSubscriptionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "sub_7f2f9170"
          },
          "status": {
            "type": "string",
            "example": "ACTIVE"
          },
          "plan": {
            "$ref": "#/components/schemas/PublicPlanDto"
          },
          "customer": {
            "type": "object",
            "additionalProperties": true,
            "example": {}
          },
          "nextChargeAt": {
            "type": "string",
            "example": "2026-10-22T00:00:00.000Z"
          },
          "createdAt": {
            "type": "string",
            "example": "2026-09-22T06:11:46.331Z"
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "PublicSubscriptionActionDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "subscription": {
            "$ref": "#/components/schemas/PublicSubscriptionDto"
          },
          "transaction": {
            "$ref": "#/components/schemas/PublicTransactionDto"
          },
          "message": {
            "type": "string",
            "example": "Subscription updated."
          }
        },
        "required": [
          "success"
        ]
      },
      "SimulateSubscriptionFlowDto": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "pre_charge_reminder",
              "due_charge",
              "payment_failed",
              "retry_due",
              "retry_failed_cancel",
              "manual_invoice_due",
              "manual_overdue_reminder"
            ],
            "example": "due_charge"
          },
          "redirectUrl": {
            "type": "string",
            "example": "https://merchant.example.com/subscriptions/return"
          }
        },
        "required": [
          "event"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
```