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

# Initiate Checkout

Use this api to generate a checkout page url to start accepting payment.

> 👍 Good to Know
>
> This is mostly the easy way to request payment from users across various mobile network providers.

# 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": {
    "/checkouts/new": {
      "post": {
        "summary": "Initiate Checkout",
        "description": "Use this api to generate a checkout page url to start accepting payment.",
        "operationId": "initiate-checkout",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "reference_code",
                  "transaction_note",
                  "redirect_url"
                ],
                "properties": {
                  "amount": {
                    "type": "integer",
                    "description": "Amount customer is supposed to pay",
                    "format": "int32"
                  },
                  "reference_code": {
                    "type": "string",
                    "description": "Reference code to process transaction, will be auto generated if not provided, must be uuidv4."
                  },
                  "transaction_note": {
                    "type": "string",
                    "description": "Transaction message to show customers when making payment"
                  },
                  "redirect_url": {
                    "type": "string",
                    "description": "The Link users would redirected to when transaction is either successful or failed"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\": true,\n\t\"message\": \"Checkout created successful\",\n\t\"result\": {\n\t\t\"transaction_ref\": \"6dd9f93b-5633-43b4-b545-961c99810044\",\n\t\t\"checkout_url\": \"https://app.momofy.com/checkout/fa645dec-2ba5-4f73-8f1d-169b2f0863ea\"\n\t},\n\t\"meta\": {}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Checkout created successful"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "transaction_ref": {
                          "type": "string",
                          "example": "6dd9f93b-5633-43b4-b545-961c99810044"
                        },
                        "checkout_url": {
                          "type": "string",
                          "example": "https://app.momofy.com/checkout/fa645dec-2ba5-4f73-8f1d-169b2f0863ea"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"status_code\": 401,\n\t\"message\": \"Unauthorized to perform action\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status_code": {
                      "type": "integer",
                      "example": 401,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Unauthorized to perform action"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6596a7aab805b8001c561159:65e059a0b5715600103f6616"
}
```