Create a payment request
POST {{baseUrl}}/payment_requests
Documentation
In our sandbox environment, you can change the value in the reference field to mock different flows. You will receive webhook notifications for each status change.
| Flow | Reference | Result |
|---|---|---|
| Success | successful | The payment request follows these statuses: initial -> processing -> successful. |
| Failed | failed | The payment request follows these statuses: initial -> processing -> failed. |
| Chargeback | chargeback | The payment request follows these statuses: initial -> processing -> successful->chargeback. |
| Default | (blank) | The payment request follows these statuses: initial -> processing -> successful. |
Create a new payment request for an existing payment method.
📘 Idempotency Keys
This method supports idempotency keys.
| Parameter | Type | Required | Description |
|---|---|---|---|
paymentMethodId | string | true | The paymentMethodId that you want to pull (debit) funds from. |
currency | string | true | The three-letter ISO 4217 currency code of the transaction. Can be either: mxn or usd. |
amount | string | true | The amount of the transaction. |
reference | string | true | A description for the direct debit (to appear on the customer's statement). |
Request Body
{"paymentMethodId"=>"{{payment_method_id}}", "amount"=>1000, "currency"=>"mxn", "reference"=>"successful/failed/chargeback"}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
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 <a href="https://developers.belvo.com/docs/direct-debit-idempotency-and-whitelisting" target="_blank">Idempotency</a> article. | |||
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"paymentRequestId":"0d1a377b-b4c5-4a94-9e2e-83e59d1f6a9c"}