---
agentTools:
  projectIndex: https://docs.instamojo.com/llms.txt
---

# Create an Order using Payment Request ID (For SDK only)

This will create a Order on Instamojo. You need to use a token that is obtained using the Application Based Authentication.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "API v2",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://api.instamojo.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-default": "Bearer {{access_token}}"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v2/gateway/orders/payment-request/": {
      "post": {
        "summary": "Create an Order using Payment Request ID (For SDK only)",
        "description": "This will create a Order on Instamojo. You need to use a token that is obtained using the Application Based Authentication.",
        "operationId": "create-an-order-using-payment-request-id-1",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "Bearer <your-token>"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Payment Request ID"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"order_id\": \"3b56d216-74c2-4189-83f3-9c2e93bad1be\",\n  \"name\": \"Vedhavyas\",\n  \"email\": \"vedhavyas@instamojo.com\",\n  \"phone\": \"+919663445546\",\n  \"amount\": \"100.00\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "order_id": {
                      "type": "string",
                      "example": "3b56d216-74c2-4189-83f3-9c2e93bad1be"
                    },
                    "name": {
                      "type": "string",
                      "example": "Vedhavyas"
                    },
                    "email": {
                      "type": "string",
                      "example": "vedhavyas@instamojo.com"
                    },
                    "phone": {
                      "type": "string",
                      "example": "+919663445546"
                    },
                    "amount": {
                      "type": "string",
                      "example": "100.00"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": [\n    \"This field is required.\"\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "This field is required."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"success\": false,\n  \"message\": \"Authentication credentials were not provided.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Authentication credentials were not provided."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "php",
              "code": "<?php\n\n$ch = curl_init();\n\ncurl_setopt($ch, CURLOPT_URL, 'https://api.instamojo.com/v2/gateway/orders/payment-request/');\ncurl_setopt($ch, CURLOPT_HEADER, FALSE);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\ncurl_setopt($ch, CURLOPT_HTTPHEADER,array('Authorization: Bearer y70kak2K0Rg7J4PAL8sdW0MutnGJEl'));\n\n$payload = Array(\n    'id' => '9c337d3c5e3242fca818937366b915b4'\n);\n\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));\n$response = curl_exec($ch);\ncurl_close($ch); \n\n?>"
            },
            {
              "language": "python",
              "code": "import requests\n\nheaders = { \n\t\"Authorization\": \"Bearer y70kak2K0Rg7J4PAL8sdW0MutnGJEl\"\n}\npayload = {\n  'id': '9c337d3c5e3242fca818937366b915b4',\n}\nresponse = requests.post(\n  \"https://api.instamojo.com/v2/gateway/orders/payment-request/\", \n  data=payload, \n  headers=headers\n)      "
            }
          ],
          "samples-languages": [
            "php",
            "python"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "63053f959807941f67a92cf5:5e427abe99dd44001f03b082"
}
```