VitrinaAPI

Método de pago

El proveedor de pago del workspace y el estado de su mandato — lo que habilita activar complementos por autoservicio — y la escritura que lo conecta con Fintoc o Mercado Pago.

Beta
Puede cambiar en cualquier momento, con una entrada en el changelog y aviso a quienes la llamaron recientemente — ver versionado.

Descarga la proyección completa de la API pública: openapi.json.

MétodoRutaQué hace
GET/billing/payment-methodCurrent payment provider + mandate status for the tenant
POST/billing/payment-method/setupConnect a payment provider (Fintoc hosted PAC redirect, or MercadoPago tokenized card)

GET /billing/payment-method

Current payment provider + mandate status for the tenant

The workspace's chosen payment provider (fintoc for a PAC bank mandate, mercadopago for a tokenized card) and the status of its newest mandate: active means add-ons can be activated self-serve (POST /entitlements/\{feature\}/activate), pending means the Fintoc hosted setup was started but not finished. All three fields are null before any enrollment. Carries no payment instrument data — no card number, bank account or provider token is ever returned.

curl https://api.vitrinadev.com/api/v1/billing/payment-method \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": {
    "provider": "fintoc",
    "status": "active",
    "mandateId": "f1f1f1f1-0000-4000-8000-000000000001"
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

POST /billing/payment-method/setup

Connect a payment provider (Fintoc hosted PAC redirect, or MercadoPago tokenized card)

Makes provider the workspace's single payment account and creates its mandate. Fintoc answers status: "pending" with a setupUrl to send the owner to (the hosted PAC setup, which returns to returnUrl); MercadoPago takes a cardToken minted client-side by MercadoPago's own SDK — never a raw card number — and answers status: "active" with setupUrl: null. email (the payer) is required by both providers; rut (optional) goes on the Fintoc customer. Requires billing:write, which only the workspace owner holds.

Cuerpo

CampoTipoObligatorioRestricciones
providerfintoc \mercadopago
returnUrlstringuri, máx. 2048
cardTokenstringmín. 1, máx. 256
emailstringemail, máx. 320
namestringmín. 1, máx. 256
rutstringmín. 1, máx. 32
curl -X POST https://api.vitrinadev.com/api/v1/billing/payment-method/setup \
  -H "Authorization: Bearer $VITRINA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "fintoc",
    "returnUrl": "https://app.vitrinadev.com/settings/complementos",
    "email": "[email protected]",
    "rut": "76.123.456-7"
  }'

Ejemplo de respuesta (200)

{
  "data": {
    "provider": "fintoc",
    "status": "pending",
    "mandateId": "f1f1f1f1-0000-4000-8000-000000000002",
    "setupUrl": "https://pay.fintoc.com/subscriptions/setup/example"
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

En esta página