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

# Create Payment Request

> Create a payment request to collect payments via cards, PayNow, FPX, GrabPay, and other methods



## OpenAPI

````yaml POST /v1/payment-requests
openapi: 3.1.1
info:
  title: HitPay API
  description: >-
    Accept PayNow, FPX, QRIS, GrabPay, cards, and 40+ payment methods with a
    single API. Production base URL: https://api.hit-pay.com, Sandbox:
    https://api.sandbox.hit-pay.com
  version: '1.0'
servers:
  - url: https://api.hit-pay.com
    description: Production
  - url: https://api.sandbox.hit-pay.com
    description: Sandbox
security: []
paths:
  /v1/payment-requests:
    post:
      summary: Create Payment Request
      description: >-
        This endpoint creates a new payment request. This is the first step of
        the payment flow, once you have all the details from the user and are
        ready to collect payment use this API to create a payment request.

        Since this is a server-to-server communication, if you have a mobile or
        Web client that communicates with your REST API, you must have a new
        endpoint E.g. /create-order, or reuse an existing endpoint. This
        endpoint will be responsible for making the payment request API call to
        HitPay.
      operationId: create-payment-request
      parameters:
        - name: X-BUSINESS-API-KEY
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
              properties:
                amount:
                  type: number
                  description: >-
                    It's required field. Amount related to the payment. Example:
                    2500
                  format: double
                  example: 100
                  minimum: 0.3
                  maximum: 999999999.99
                currency:
                  type: string
                  maxLength: 3
                  example: SGD
                  description: It's required field. Currency related to the payment.
                payment_methods:
                  type: array
                  description: >-
                    They're available payment methods supported on your
                    account.(Example: paynow_online , card, wechat, alipay,
                    grabpay_direct, grabpay_paylater, shopee_pay ... etc.). If
                    we don't pass, use the available methods
                  items:
                    type: string
                  example:
                    - card
                email:
                  type: string
                  format: email
                  description: Buyer’s email
                name:
                  type: string
                  description: Buyer’s name
                phone:
                  type: string
                  format: phone
                  description: Buyer’s phone number
                wifi_terminal_id:
                  type: string
                  description: >-
                    It's terminal id and it's required if payment method is
                    wifi_card_reader
                staff_id:
                  type: string
                  format: uuid
                  description: It's active staff id from the dashboard
                  example: 98888a24-d6b2-430d-9063-d2be76d443cd
                location_id:
                  type: string
                  format: uuid
                  example: 9dd07721-d215-4947-9c79-2b8ec25f69db
                  description: >-
                    The active location belongs to business. Support both
                    `location_id` and `business_location_id` for backward
                    compatibility, but we recommend using `business_location_id`
                    for future use.
                business_location_id:
                  type: string
                  format: uuid
                  example: 9dd07721-d215-4947-9c79-2b8ec25f69db
                  description: The active location belongs to business.
                purpose:
                  type: string
                  description: Purpose of the Payment request.
                  maxLength: 255
                reference_number:
                  type: string
                  maxLength: 255
                  description: >-
                    Arbitrary reference number that you can map to your internal
                    reference number. This value cannot be edited by the
                    customer
                redirect_url:
                  type: string
                  format: uri
                  maxLength: 1028
                  example: https://www.google.com
                  description: >-
                    URL where we redirect the user after a payment. Query
                    arguments reference (payment request id) and status are sent
                    along
                webhook:
                  type: string
                  format: uri
                  example: https://www.google.com
                  description: URL where our server do POST request after a payment If done
                allow_repeated_payments:
                  type: string
                  description: >-
                    If set to true, multiple payments can be paid on a payment
                    request link. Default value is false
                  default: 'false'
                  enum:
                    - 'true'
                    - 'false'
                expiry_date:
                  type: string
                  description: >-
                    Time after which the payment link will be expired (time in
                    SG with YYYY-MM-DD HH:mm:ss format). Applicable for repeated
                    payments.
                expires_after:
                  type: string
                  description: >-
                    E.g "30 mins" Other supported keys are "mins", "hours",
                    "days"
                  example: 5 minutes
                add_admin_fee:
                  type: string
                  description: If set to true, the admin fee will be included in total.
                  default: 'false'
                  enum:
                    - 'true'
                    - 'false'
                send_email:
                  type: string
                  description: >-
                    It's "true" or "false". If set to true, an email receipt
                    will be sent to the customer after the payment is completed.
                    Default is false
                  default: 'false'
                  enum:
                    - 'true'
                    - 'false'
                send_sms:
                  type: string
                  description: >-
                    It's "true" or "false". If set to "true", SMS will be sent
                    to the customer after the payment is completed. Default is
                    false
                  default: 'true'
                  enum:
                    - 'true'
                    - 'false'
                address:
                  type: object
                  required:
                    - line1
                    - city
                    - state
                    - country
                    - postal_code
                  properties:
                    line1:
                      type: string
                    line2:
                      type: string
                    city:
                      type: string
                    country:
                      type: string
                    state:
                      type: string
                    postal_code:
                      type: string
                generate_qr:
                  type: boolean
                  default: false
                  description: >-
                    Only valid for paynow_online, qrph_netbank, doku_qris and
                    shopee_pay if generate_qr was true
                metadata:
                  type: object
                  properties:
                    key:
                      type: string
                  description: >-
                    Support the key-value. The value must be string type, and
                    the max length of the value is 500 characters, up to 50
                    key-value. Example: {"car_model": "toyota", "car_color":
                    "red"}
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 9ef68e2e-3569-4f69-9f68-04c7e4bb007c
                    name: Harvey Friesen
                    email: test@gmail.com
                    phone: '+65489505050'
                    amount: '10.00'
                    currency: sgd
                    is_currency_editable: false
                    status: pending
                    purpose: Purpose_1747817845
                    reference_number: '1747817845'
                    payment_methods:
                      - card
                    url: >-
                      https://securecheckout.sandbox.hit-pay.com/payment-request/@qasg/9ef68e2e-3569-4f69-9f68-04c7e4bb007c/checkout
                    redirect_url: https://google.com
                    webhook: https://webhook.site/8cbdef58-cd15-441a-986d-9446235223ea
                    send_sms: true
                    send_email: true
                    sms_status: pending
                    email_status: pending
                    allow_repeated_payments: false
                    expiry_date: '2025-05-26T15:10:00'
                    address:
                      line1: 177 River Valley Road
                      line2: 177 River Valley Road
                      city: Singapore
                      state: Central
                      country: SG
                      postal_code: '10015'
                    line_items: null
                    executor_id: 1363
                    created_at: '2025-05-21T16:57:25'
                    updated_at: '2025-05-21T16:57:25'
                    staff_id: 98888a69-2d7a-4695-811d-6df8cee30264
                    business_location_id: 9e42e6be-2ff8-4b37-ac14-07970d2e79ca
                    metadata:
                      key1: value1
                      key2: value2
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 974ee233-bc3e-4aac-a212-15af0d155133
                  name:
                    type: string
                    example: Buyer_Name_1663650582
                  email:
                    type: string
                    example: buyer_1663650582@gmail.com
                  phone:
                    type: string
                    examples:
                      - '+6539393939'
                  amount:
                    type: string
                    examples: '900'
                  currency:
                    type: string
                    example: SGD
                  status:
                    type: string
                    enum:
                      - pending
                      - completed
                      - failed
                      - expired
                      - canceled
                      - inactive
                    example: pending
                  purpose:
                    type: string
                    examples:
                      - Testing
                  reference_number:
                    type: string
                    example: '12345678'
                  payment_methods:
                    type: array
                    items:
                      type: string
                    examples:
                      - card
                  url:
                    type: string
                    example: >-
                      https://securecheckout.sandbox.hit-pay.com/payment-request/@ban/974ee233-bc3e-4aac-a212-15af0d155133/checkout
                  redirect_url:
                    type: string
                    example: https://hit-pay.postman.co/
                  webhook:
                    type: string
                    example: https://hit-pay.postman.co/
                  send_sms:
                    type: boolean
                  send_email:
                    type: boolean
                    example: true
                    default: true
                  sms_status:
                    type: string
                    example: pending
                  email_status:
                    type: string
                    example: pending
                  allow_repeated_payments:
                    type: boolean
                    example: false
                    default: false
                  expiry_date:
                    type: string
                    example: '2022-10-10T01:01:01'
                  created_at:
                    type: string
                    example: '2022-09-20T13:09:42'
                  updated_at:
                    type: string
                    example: '2022-09-20T13:09:42'
                  staff_id:
                    type:
                      - string
                      - 'null'
                    example: 98888a69-2d7a-4695-811d-6df8cee30264
                  business_location_id:
                    type:
                      - string
                      - 'null'
                    example: 9dd07721-d215-4947-9c79-2b8ec25f69db
                  metadata:
                    type: object
                    properties:
                      key:
                        type: string
                    example:
                      key1: value1
                      key2: 'value2 '
        '422':
          description: '422'
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: The currency field is required.
                    errors:
                      currency:
                        - The currency field is required.
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        type: string
                        examples:
                          - The given data was invalid.
                      errors:
                        type: object
                        properties:
                          amount:
                            type: array
                            items:
                              type: string
                              examples:
                                - The amount field is required.
                          currency:
                            type: array
                            items:
                              type: string
                              examples:
                                - The currency field is required.
                  - type: object
                    properties:
                      message:
                        type: string
                        examples:
                          - The given data was invalid.
                      errors:
                        type: object
                        properties:
                          amount:
                            type: array
                            items:
                              type: string
                              examples:
                                - >-
                                  The amount must be between 0.3 and
                                  999999999.99.
                  - type: object
                    properties:
                      message:
                        type: string
                        examples:
                          - The given data was invalid.
                      errors:
                        type: object
                        properties:
                          payment_methods:
                            type: array
                            items:
                              type: string
                              examples:
                                - The selected payment methods is invalid.
      deprecated: false
      security: []

````