# Create a payment request

Create a new payment request for an existing payment method.

> 📘 Idempotency Keys
>
> This method supports idempotency keys.

Endpoint: POST /payment_requests
Version: 1.0.0
Security: ApiKeyAuth, ApiKeySecret

## Header parameters:

  - `Idempotency-Key` (string)
    (Optional, but highly recommended.) A unique identifier for this request to support idempotency. Use a UUID or
similar identifier. For more information, see our dedicated Idempotency article.

## Request fields (application/json):

  - `amount` (number, required)
    The amount to debit from the customer.
    Example: 1000

  - `currency` (string, required)
    The three-letter ISO 4217 currency code of the transaction. At the moment, we only support mxn.
    Enum: "mxn"

  - `reference` (string, required)
    Your internal reference for the payment request.
    Example: "J-789029-PAY-3X"

  - `paymentMethodId` (string, required)
    The unique identifier created by Belvo used to reference the payment method.
    Example: "0d1a377b-b4c5-4a94-9e2e-83e59d1f6a9c"

  - `loanInformation` (object)
    (Optinal) Metadata about the loan associated with the payment request.

  - `loanInformation.reference` (string)
    Your reference for the loan associated with the payment request.
    Example: "Camera Purchase 1432"

  - `loanInformation.disbursementDate` (string)
    The date when the loan was disbursed, in YYYY-MM-DD format.
    Example: "2025-01-01"

  - `loanInformation.installmentNumber` (integer)
    The number of the installment being paid.
    Example: 1

  - `loanInformation.installmentAmount` (number)
    The amount of the installment being paid.
    Example: 100.02

  - `loanInformation.installmentDueDate` (string)
    The due date of the installment being paid, in YYYY-MM-DD format.
    Example: "2025-03-01"

  - `loanInformation.totalAmount` (number)
    The total amount of the loan.
    Example: 12000.24

  - `loanInformation.totalInstallments` (integer)
    The total number of installments for the loan.
    Example: 12

## Response 201 fields (application/json):

  - `paymentRequestId` (string)
    The unique identifier created by Belvo used to reference the payment request.
    Example: "0d1a377b-b4c5-4a94-9e2e-83e59d1f6a9c"

## Response 400 fields (application/json):

  - `statusCode` (integer)
    The HTTP status code for this error.
    Example: 400

  - `error` (string)
    The HTTP status code description for this error.
    Example: "Bad Request"

  - `message` (any)
    A short description of the error, indicating what is wrong with the request.
> Note: We return either a string or an array of strings, depending on the validation error(s). 

The description can be (among others):

  - id must be a UUID
  - Not enough balance
  - amount is not a valid decimal number.
  - currency must be one of the following values: cop, mxn, usd
  - reference must be a string
  - Customer not found for merchant
  - documentType is a required field
    Example: "id must be a UUID"

## Response 401 fields (application/json):

  - `statusCode` (integer)
    The HTTP status code for this error.
    Example: 401

  - `error` (string)
    The HTTP status code description for this error.
    Example: "Unauthorized"

  - `message` (string)
    A short description of the error, indicating what is wrong with the request.
In the case of a 401 Unauthorized error, the message is:

  - Unauthorized credentials
    Example: "Unauthorized credentials"

## Response 404 fields (application/json):

  - `statusCode` (integer)
    The HTTP status code for this error.
    Example: 404

  - `error` (string)
    The HTTP status code description for this error.
    Example: "Not Found"

  - `message` (string)
    A short description of the error, indicating what is wrong with the request.
The description can be (among others):

  - Payout Target not found
  - Payment method not found
  - Customer not found
    Example: "Payout Target not found"


