Direct Debit · API reference · charges
Create Charge
Base URL not set in the spec · operationId create_charge_charges_post
Create a new charge.
Authorization
The spec does not declare an authentication scheme for this endpoint.
Headers
X-API-Key string | null Idempotency-Key string (uuid) | null Optional UUID for safely retrying charge creation. Reusing the same key with an identical request body returns the original charge instead of creating a duplicate. Keys are scoped to your organization and expire 24 hours after the request.
Request body application/json · required
currency string requiredCurrency of the charge
mxn cop brl usd eur gbp instrument_id string (uuid) | null ID of the payment instrument
customer_id string (uuid) | null ID of the customer
amount number requiredCharge amount
reference string | null Reference provided by tenant
inline_instrument ChargeCreateInlineInstrument | null Inline instrument data
type inline_instrument.type string requiredType of instrument
mx_direct_debit_card mx_clabe identifier inline_instrument.identifier string requiredIdentifier of the instrument
bank inline_instrument.bank string | null Bank of the instrument
inline_customer ChargeCreateInlineCustomer | null Inline customer data
name inline_customer.name string requiredName of the customer
document_type inline_customer.document_type string requiredType of document (e.g., 'mx_rfc', 'mx_curp')
mx_rfc mx_curp passport document_number inline_customer.document_number string requiredDocument number
email inline_customer.email string | null Email of the customer
phone_number inline_customer.phone_number string | null Phone number of the customer
Responses
201 Successful Response application/json
org_id string (uuid) requiredID of the organization
instrument_id string (uuid) | null ID of the payment instrument
customer_id string (uuid) | null ID of the customer
amount number requiredCharge amount
currency string | null Currency code
mxn cop brl usd eur gbp reference string | null Reference provided by tenant
inline_instrument object | null Inline instrument data
inline_customer object | null Inline customer data
id string (uuid) requiredstatus string requiredCharge status enum.
verification_in_progress pending processing confirmed declined chargeback canceled declined_reason string | null insufficient_funds account_blocked undetermined risk_engine account_does_not_exist account_canceled account_in_other_currency account_not_belongs_to_bank transaction_duplicated client_order_declined_pay_to_issuer client_order_amount_is_more_than_authorized client_order_canceled client_service_not_authorized payment_order_expired client_rejected_charge declined_reason_rail string | null created_at string (date-time) requiredupdated_at string (date-time) | null chargeback_at string (date-time) | null result_at string (date-time) | null risk_status string | null pending ok cancelled_by_risk risk_evaluated_at string (date-time) | null risk_reasons array of string | null 422 Validation Error, or the Idempotency-Key was reused with a different request body. application/json
detail array of ValidationError loc detail[].loc array of (string | integer) requiredmsg detail[].msg string requiredtype detail[].type string requiredRequest
curl -X POST "$BASE_URL/charges" \
-H "X-API-Key: $API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY"const res = await fetch(`${BASE_URL}/charges`, {
method: "POST",
headers: {
"X-API-Key": API_KEY,
"Idempotency-Key": IDEMPOTENCY_KEY,
},
});
const data = await res.json();import requests
res = requests.post(
f"{BASE_URL}/charges",
headers={
"X-API-Key": API_KEY,
"Idempotency-Key": IDEMPOTENCY_KEY,
},
)
data = res.json()