Create a new payin
Creates a new payin to collect funds from a payer using their payment method. A payin represents an ACH debit transaction that pulls money from the payer’s bank account. Supports both regular payins and subaccount payins (test entities only).
Request Body
Examples:
- For USD,
amount_in_minor_units: 2500is 2500 cents = $25.00 - For USD,
amount_in_minor_units: 10075is 10075 cents = $100.75
Response Body
Note: Use amount_in_minor_units in request bodies. The amount_in_cents field is deprecated and retained in responses for backward compatibility.
Idempotency Key
You can include an Idempotency-Key header to ensure that duplicate requests are handled safely. When you retry a request with the same idempotency key:
- 200 OK: If a payin with the same idempotency key already exists and no further work is needed for this request, the existing payin is returned.
- 201 Created: If no payin exists with the provided idempotency key, a new payin is created.
- With
auto_approve=true, an idempotency match that is stillCREATEDcontinues approve→initiate. A match inCANCELEDorFAILEDreturns 409.
Success Responses
Error Responses
Auto-approve behavior
When auto_approve=true, the API creates the payin (or continues from an idempotent CREATED match) and continues approval and async initiation as far as this request allows. You may receive 201, 202, 207, or 503 depending on outcome:
- 201 / 202: The payin id is always in the response. If you receive 202, poll
GET /api/payins/{id}untilstatusreaches a value you treat as final for your integration. - 207: Creation succeeded but approval failed; read
warningandstatus(stillCREATED). Standalone approve returns 4xx for the same approval failure. - 503: Transient error while starting async initiation—retry the create; use the response
message(anderror_code) for support and automation.
Authentication
RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.
Headers
Request
Amount in the currency’s minor units (e.g. cents for USD).
Payment rail (standard_ach, same_day_ach). Uses default if not provided.
Specific payment method ID (uses default if not provided)
Subaccount to credit to (test entities only)
Calendar day to release the transfer in its schedule timezone (currently America/New_York). Omitted for immediate. Not the beneficiary credit date. Resolved to 09:00 in that timezone.
Deprecated. Use amount_in_minor_units instead. Still accepted and returned for backward compatibility.
Response
Payin retrieved successfully (idempotency retry)