VitrinaAPI

Payment method

The workspace's payment provider and its mandate status — what unlocks self-serve add-on activation — and the write that connects it through Fintoc or Mercado Pago.

Beta
This may change at any time, with a changelog entry and a notice to recent callers — see versioning.

Download the full API pública projection: openapi.json.

MethodPathWhat it does
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"

Example response (200)

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

Answers: 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.

Body

FieldTypeRequiredConstraints
providerfintoc \mercadopagoyes
returnUrlstring—uri, máx. 2048
cardTokenstring—mín. 1, máx. 256
emailstring—email, máx. 320
namestring—mín. 1, máx. 256
rutstring—mí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"
  }'

Example response (200)

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

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

On this page