---
agentTools:
  projectIndex: https://chimoney.readme.io/llms.txt
---

# Simulate Interac funding. Only works in staging or sandbox.

Simulates a complete Interac e-Transfer funding flow.

**Using `reference`:** Pass an issueID, t_id, or p_id as the `reference` field.
The system auto-detects the type. If it resolves to an existing unpaid CAD transaction,
it simulates the Pateno webhook completing it. If it resolves to a p_id, provide `amount`
to simulate a direct auto-deposit for that user/team.

**Using `amount` only:** Creates a new funding transaction for the authenticated user
and processes it immediately.

At least `reference` or `amount` must be provided.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Chimoney API Docs",
    "version": "0.2.4",
    "description": "This is the latest version of the Chimoney API. For deprecated version routes, please refer to /v0.2/api-docs."
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.chimoney.io/",
      "description": "Prod Server"
    },
    {
      "url": "https://api-v2-sandbox.chimoney.io",
      "description": "Sandbox API v2 (v0.2.4)"
    }
  ],
  "paths": {
    "/v0.2.4/payment/simulate-interac-funding": {
      "post": {
        "summary": "Simulate Interac funding. Only works in staging or sandbox.",
        "description": "Simulates a complete Interac e-Transfer funding flow.\n\n**Using `reference`:** Pass an issueID, t_id, or p_id as the `reference` field.\nThe system auto-detects the type. If it resolves to an existing unpaid CAD transaction,\nit simulates the Pateno webhook completing it. If it resolves to a p_id, provide `amount`\nto simulate a direct auto-deposit for that user/team.\n\n**Using `amount` only:** Creates a new funding transaction for the authenticated user\nand processes it immediately.\n\nAt least `reference` or `amount` must be provided.\n",
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "description": "An issueID, t_id, or p_id. Auto-detected.",
                    "example": "userId_100.00_1707000000000"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount in CAD (max 1000). Required with p_id references or for standalone funding.",
                    "example": 100
                  },
                  "senderName": {
                    "type": "string",
                    "description": "Name of the simulated sender.",
                    "default": "Test Sender"
                  },
                  "senderEmail": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the simulated sender.",
                    "default": "test@example.com"
                  }
                }
              },
              "examples": {
                "completeByIssueID": {
                  "summary": "Complete existing payment by issueID",
                  "value": {
                    "reference": "userId_100.00_1707000000000"
                  }
                },
                "completeByTId": {
                  "summary": "Complete existing payment by t_id",
                  "value": {
                    "reference": "123456789012345"
                  }
                },
                "fundByPId": {
                  "summary": "Direct fund by p_id",
                  "value": {
                    "reference": "12345678",
                    "amount": 100
                  }
                },
                "directFunding": {
                  "summary": "Direct funding (no reference)",
                  "value": {
                    "amount": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Interac funding simulated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "message": {
                      "type": "string",
                      "example": "Interac funding simulated successfully"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "simulated": {
                          "type": "boolean",
                          "example": true
                        },
                        "simulatedAmount": {
                          "type": "number",
                          "example": 100
                        },
                        "chiRef": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "example": "paid"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden - Can only simulate in staging or sandbox environments."
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Access to this resource is not available for unauthenticated users.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Unauthorized"
            }
          }
        }
      },
      "ServerError": {
        "description": "Indicates an internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ServerError"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Validation error in the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      }
    },
    "schemas": {
      "Unauthorized": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the response.",
            "example": "error"
          },
          "error": {
            "type": "string",
            "description": "Error message indicating unauthorized access.",
            "example": "API key is not defined. Generate a new one from the developer portal."
          }
        }
      },
      "ServerError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the error.",
            "example": "error"
          },
          "type": {
            "type": "string",
            "description": "Type of server error.",
            "example": "server error"
          },
          "code": {
            "type": "string",
            "description": "Specific error code for server issues.",
            "example": "INTERNAL_SERVER_ERROR"
          },
          "message": {
            "type": "string",
            "description": "Detailed message explaining the issue.",
            "example": "An internal server error occurred."
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the validation error.",
            "example": "error"
          },
          "type": {
            "type": "string",
            "description": "Type of validation error.",
            "example": "Validation Error"
          },
          "code": {
            "type": "string",
            "description": "Error code indicating validation issue.",
            "example": "INVALID_REQUEST"
          },
          "message": {
            "type": "string",
            "description": "Detailed validation error message.",
            "example": "The request parameters are invalid."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Payments",
      "description": "Collect payment from card, crypto and other options."
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 208,
      "2": 243,
      "3": 240,
      "4": 73,
      "5": 214,
      "6": 34,
      "7": 0,
      "8": 37,
      "9": 190,
      "10": 200,
      "11": 166
    }
  }
}
```