> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paytring.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Order

> This API is used to initiate a payment request for a specific order.

This API is used to initiate a payment request for a specific order.

### Request Body

```json theme={null}
{
  "email": "string", // End User Email
  "callback_url": "https://httpbin.org/post", // Default callback URL
  "currency": "INR", // Default currency
  "pg": "string", // Payment gateway code (optional)
  "pg_pool_id": "string", // Payment gateway pool ID (optional)
  "hash": "string" // Calculated hash for request validation
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "order_id": "string",
  "message": "Order created successfully"
}
```

#### 400 Bad Request

```json theme={null}
{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}
```


## OpenAPI

````yaml POST /api/v2/order/create
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/order/create:
    post:
      summary: Create Order
      description: This API is used to initiate a payment request for a specific order.
      operationId: create-order
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - amount
                - cname
                - phone
                - receipt_id
                - callback_url
                - hash
                - email
              properties:
                key:
                  type: string
                  description: Merchant key, available in dashboard profile section
                  default: test_123
                amount:
                  type: integer
                  description: Amount will always be in paisa/cents.
                  default: 100
                  format: int32
                cname:
                  type: string
                  description: End User/Payes Name
                  default: Jhon Doe
                phone:
                  type: string
                  description: End Users Phone
                  default: '9897969594'
                receipt_id:
                  type: string
                  description: a random string a sting provided by merchant for reference.
                  default: xx00011
                callback_url:
                  type: string
                  description: >-
                    callback url of merchant website on which will we redirect
                    to , once payment is done.
                  default: https://httpbin.org/post
                hash:
                  type: string
                  description: >-
                    to be calculated by key sort of all non-object key values of
                    this request
                email:
                  type: string
                  description: End User Email
                currency:
                  type: string
                  description: Please Get Currency Active by our team
                  default: INR
                billing_address:
                  type: object
                  properties:
                    line1:
                      type: string
                      description: does not accept any special charecter
                    line2:
                      type: string
                      description: does not accept any special charecter
                    city:
                      type: string
                    state:
                      type: string
                    zipcode:
                      type: integer
                      format: int32
                    country:
                      type: string
                    phone:
                      type: string
                    firstname:
                      type: string
                      description: min 3 chars
                    lastname:
                      type: string
                      description: min 3 chars
                shipping_address:
                  type: object
                  properties:
                    line1:
                      type: string
                      description: does not accept any special charecter
                    line2:
                      type: string
                      description: does not accept any special charecter
                    city:
                      type: string
                    state:
                      type: string
                    zipcode:
                      type: integer
                      format: int32
                    country:
                      type: string
                    phone:
                      type: string
                    firstname:
                      type: string
                      description: min 3 chars
                    lastname:
                      type: string
                      description: min 3 chars
                notes:
                  type: object
                  description: These fields can be used for reporting
                  properties:
                    udf1:
                      type: string
                      description: max length 255, no special chars
                    udf2:
                      type: string
                      description: max length 255, no special chars
                    udf3:
                      type: string
                      description: max length 255, no special chars
                    udf4:
                      type: string
                      description: max length 255, no special chars
                    udf5:
                      type: string
                      description: max length 255, no special chars
                pg:
                  type: string
                  description: >-
                    if you pass a pg code then only that payment gateway will be
                    used to process this transection. eg, payu
                pg_pool_id:
                  type: string
                  description: >-
                    this can be grabbed from pg integration manager available in
                    your dashboard..
                tpv:
                  type: array
                  description: add  tpv info
                  items:
                    properties:
                      account_number:
                        type: string
                        description: account number of end user
                      name:
                        type: string
                        description: name of end user
                      ifsc:
                        type: string
                        description: end users bank account ifsc code.
                    type: object
                split_settlement:
                  type: array
                  items:
                    properties:
                      vendor_id:
                        type: string
                        description: can be created via api or paytring dashboard
                      amount:
                        type: string
                        description: >-
                          amount in paise or cents in case of fixed and percent
                          in case of percent
                    required:
                      - vendor_id
                      - amount
                    type: object
                split_type:
                  type: string
                  default: percent
                  enum:
                    - '"percent"'
                    - '"fixed"'
                autocapture:
                  type: string
                  description: >-
                    if merchant wan't they can disable autocapture by sending
                    false in request
                  default: 'true'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "status": true,
                      "url": "aHR0cHM6Ly91YXQubWNzYW0uaW4vcGVnYXN1cy9hc0b2tlbi80ODg2NDUxNjAxODQzMTYwMTE=",
                      "order_id": "48864xxxxxxxxxx"
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  url:
                    type: string
                    example: >-
                      aHR0cHM6Ly91YXQubWNzYW0uaW4vcGVnYXN1cy9hc0b2tlbi80ODg2NDUxNjAxODQzMTYwMTE=
                  order_id:
                    type: string
                    example: 48864xxxxxxxxxx
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": false,
                        "error": {
                            "message": "Hash is not verified",
                            "code": 204
                        }
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Hash is not verified
                      code:
                        type: integer
                        example: 204
                        default: 0
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````