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

# Request Payment

This endpoint will let initiate transaction from your customers

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Sandbox",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.momofy.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/transactions/request": {
      "post": {
        "summary": "Request Payment",
        "description": "This endpoint will let initiate transaction from your customers",
        "operationId": "request-payment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "description": "Your provider's code",
                    "default": "MTN"
                  },
                  "transaction_note": {
                    "type": "string",
                    "description": "Message we will show to customers when initiating transaction."
                  },
                  "channel": {
                    "type": "string",
                    "description": "transaction channel",
                    "default": "mobile_money"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency of your transaction, should be the currency from your country"
                  },
                  "amount": {
                    "type": "string",
                    "description": "Amount to charge customers"
                  },
                  "reference_code": {
                    "type": "string",
                    "description": "Optional, we will generate a reference code if you don't provide"
                  },
                  "customer": {
                    "type": "object",
                    "description": "Information of your customer",
                    "required": [
                      "name",
                      "phone_number"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of your customer"
                      },
                      "email": {
                        "type": "string",
                        "description": "Email of your customer"
                      },
                      "phone_number": {
                        "type": "string",
                        "description": "Customer phone number"
                      }
                    }
                  }
                }
              },
              "examples": {
                "Request payment ": {
                  "value": {
                    "provider": "MTN",
                    "transaction_note": "Paid a service for users",
                    "channel": "mobile_money",
                    "currency": "GHS",
                    "amount": 60,
                    "reference_code": "",
                    "customer": {
                      "name": "Eric Mensah",
                      "email": "ericmensah@gmail.com",
                      "phone_number": "024567893"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\": true,\n\t\"message\": \"Transaction has been initiated\",\n\t\"result\": {\n\t\t\"reference_code\": \"2f1b73bc-e18b-40c4-8e9a-7f0fb4f46188\"\n\t},\n\t\"meta\": {}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Transaction has been initiated"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "reference_code": {
                          "type": "string",
                          "example": "2f1b73bc-e18b-40c4-8e9a-7f0fb4f46188"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"errors\": [\n\t\t{\n\t\t\t\"rule\": \"enum\",\n\t\t\t\"field\": \"channel\",\n\t\t\t\"message\": \"enum validation failed\",\n\t\t\t\"args\": {\n\t\t\t\t\"choices\": [\n\t\t\t\t\t\"mobile_money\"\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rule": {
                            "type": "string",
                            "example": "enum"
                          },
                          "field": {
                            "type": "string",
                            "example": "channel"
                          },
                          "message": {
                            "type": "string",
                            "example": "enum validation failed"
                          },
                          "args": {
                            "type": "object",
                            "properties": {
                              "choices": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "example": "mobile_money"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6596a7aab805b8001c561159:65c0e04dec8ca50073c61986"
}
```