@pulgueta/wompi

API Reference

Merchants

Fetch merchant info and the presigned acceptance token required for every transaction.

The merchant endpoint is the only one that needs no authentication header — the public key travels as part of the URL. Use it to fetch merchant metadata and, crucially, the presigned acceptance token you must include in every createTransaction call.

getMerchant()

GET /merchants/{publicKey}. Returns the merchant record. Requires only the public key (passed at client construction).

ts
const [error, response] = await wompi.merchants.getMerchant();
if (error) throw error;

const merchant = response;

merchant.name;          // string | undefined
merchant.legal_name;    // string | undefined
merchant.accepted_payment_methods;  // string[] | undefined
merchant.presigned_acceptance?.acceptance_token; // string

Response shape

Field Type Notes
idnumberWompi merchant id.
namestring?Public merchant name.
legal_namestring?Legal entity name.
legal_id / legal_id_typestring?NIT or CC.
accepted_payment_methodsstring[]?"CARD", "NEQUI", "PSE", …
accepted_currencies"COP"[]?Always ["COP"] today.
presigned_acceptanceobject?See below.

Presigned acceptance

The presigned_acceptance object proves the customer accepted the merchant's end-user policy. Show permalink to the customer; pass acceptance_token when you create a transaction.

ts
const [error, response] = await wompi.merchants.getMerchant();
if (error) throw error;

const acceptance = response.presigned_acceptance;

// Persist for the duration of a single transaction — Wompi rotates these.
return {
  token: acceptance?.acceptance_token,
  termsUrl: acceptance?.permalink,
};
  • acceptance_token — string, expires; fetch once per transaction.
  • permalink — URL to the merchant's terms.
  • type — always "END_USER_POLICY".

Errors

The endpoint is public, so authentication errors don't apply. Possible error values:

  • WompiNotFoundError — public key doesn't match any merchant.
  • WompiRequestError — any other non-2xx response.
Navigation