mcp-niubiz

v0.1.0
io.github.codespar/mcp-niubiz Checked 9 hours ago Published 5 months ago

MCP server for Niubiz — Peru card acquirer: security token, session, authorize, reverse

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_security_token

Fetch the Niubiz API bearer token (POST /api.security/v1/security, Basic auth). Other tools fetch and cache this automatically — call it explicitly only to verify credentials or force a refresh.

ParameterTypeDescription
forcebooleanForce a fresh token even if one is cached

create_session_token

Create a checkout session (POST /api.ecommerce/v2/ecommerce/token/session/{merchantId}). Returns the sessionKey the Niubiz checkout form needs. Send the purchase amount and the customer's IP for antifraud scoring.

ParameterTypeDescription
amount *numberPurchase amount (e.g. 100.00)
clientIp *stringCustomer IP address (antifraud)
channelstringSales channel: web (default) | mobile
merchantDefineDataobjectOptional MDD antifraud fields (MDD4 email, MDD21 frequent-flyer, etc.)

authorize_transaction

Authorize a purchase (POST /api.authorization/v3/authorization/ecommerce/{merchantId}). Pass the transactionToken the Niubiz checkout form returned after the customer entered the card, plus your purchaseNumber and the amount.

ParameterTypeDescription
amount *numberAmount to authorize (must match the session)
purchaseNumber *stringYour unique purchase number (numeric string, max 12 digits)
transactionToken *stringtokenId returned by the Niubiz checkout form
captureTypestringmanual | automatic (default automatic)
channelstringSales channel: web (default) | mobile
countablebooleantrue = sale (capture), false = preauth only
currencystringPEN (default) or USD

reverse_transaction

Reverse (void) an authorization (POST /api.authorization/v3/reverse/ecommerce/{merchantId}). Same-day undo of an authorized transaction by transactionId or purchaseNumber.

ParameterTypeDescription
purchaseNumberstringYour purchase number (alternative reference)
transactionIdstringNiubiz transaction id to reverse