import type { HttpClient } from '../HttpClient.js'; import type { RequestOptions } from '../types/common.js'; import type { Merchant, MerchantCreateParams, MerchantInviteParams, MerchantListParams, MerchantPortalInviteResponse, CrmKey, CrmKeyCreated, CrmKeyCreateParams, PartnerEnrollParams, ProcessingEnrollment } from '../types/partners.js'; import { PartnerProcessingTpas, PartnerProcessingSubMerchants, PartnerProcessingOnboarding, PartnerProcessingApplications, ProcessingAcquirers, ProcessingReads, ProcessingWebhookEndpoints } from './Processing.js'; /** * `tagada.partners.*` — the partner ("on behalf of") namespace. A partner * provisions and manages merchants and TPAs for its own sub-merchants. * * The namespace mirrors the platform's two domains: * - `partners.crm.*` → CRM provisioning (merchants + CRM keys), * served on `/api/public/v1/partner/*`. * - `partners.processing.*` → TagadaPay provisioning (TPAs, KYB, keys), * served on `/api/tagadapay/v1/partner/*`. * * All write operations require a partner key (`tp_sk_partner_*`). * * @see https://docs.tagadapay.com/developer-tools/partners/introduction */ /** CRM keys (`sk_crm_…`) for a merchant. `partners.crm.merchants.keys.*`. */ export declare class PartnerCrmKeys { private readonly client; constructor(client: HttpClient); /** * Mint a CRM Key for a merchant. The plaintext `token` is returned ONLY on * creation. New tokens use the `sk_crm_…` format. * * @example * const key = await tagada.partners.crm.merchants.keys.create('acc_xxx'); * // key.token = 'sk_crm_live_…' */ create(accountId: string, params?: CrmKeyCreateParams, opts?: RequestOptions): Promise; list(accountId: string, opts?: RequestOptions): Promise<{ data: CrmKey[]; }>; /** Revoke a CRM Key. Subsequent calls with that token get HTTP 401. */ revoke(keyId: string, opts?: RequestOptions): Promise<{ id: string; status: 'revoked'; }>; } /** Merchants (`acc_xxx`) managed by a partner. `partners.crm.merchants.*`. */ export declare class PartnerCrmMerchants { private readonly client; readonly keys: PartnerCrmKeys; constructor(client: HttpClient); /** * Create a CRM merchant. CRM-only is valid — a merchant needs no TPA. Pass * `externalRef` for idempotency. Pass `email` to invite the merchant * contact to the CRM dashboard (they set their own password). * * @example * const merchant = await tagada.partners.crm.merchants.create({ * legalName: 'Acme SAS', * externalRef: 'merchant_42', * email: 'owner@acme.com', // optional — sends a CRM invitation * }); * // merchant.id = 'acc_xxx' * // merchant.portalInvite?.status = 'invited' */ create(params: MerchantCreateParams, opts?: RequestOptions): Promise; /** * Invite the merchant contact to claim an existing merchant in the CRM * dashboard. Idempotent — a pending invitation replays as * `status: 'already_invited'`. * * @example * const invite = await tagada.partners.crm.merchants.invite('acc_xxx', { * email: 'owner@acme.com', * }); */ invite(accountId: string, params: MerchantInviteParams, opts?: RequestOptions): Promise; retrieve(accountId: string, opts?: RequestOptions): Promise; /** Look up a merchant by your own external reference. Returns `null` if none match. */ retrieveByExternalRef(externalRef: string, opts?: RequestOptions): Promise; list(params?: MerchantListParams, opts?: RequestOptions): Promise<{ data: Merchant[]; hasMore: boolean; }>; } /** Aggregator for `tagada.partners.crm`. */ export declare class PartnerCrm { readonly merchants: PartnerCrmMerchants; constructor(client: HttpClient); } /** Aggregator for `tagada.partners.processing`. */ export declare class PartnerProcessing { /** * TPAs (`tpa_xxx`) with nested `keys`, `requirements`, `documents`, plus * `create` (**payfac partners only**). */ readonly tpas: PartnerProcessingTpas; /** * Entity applications for sub-merchants — same payload as merchant * `processing.applications.*`. Preferred for CRM-only partners. */ readonly applications: PartnerProcessingApplications; /** * Merchant-of-Record sub-merchants (`subMerchants.create()`) — provisioned * under the partner's own payfac umbrella (shared account holder + balance * account), each with its own store + statement descriptor. */ readonly subMerchants: PartnerProcessingSubMerchants; /** * Embed onboarding (iframe) — mint a partner-branded KYB session URL for * `TagadaOnboarding.mount` / raw iframe. */ readonly onboarding: PartnerProcessingOnboarding; /** Acquirers the partner has signed and may use (`acquirers.list()`). */ readonly acquirers: ProcessingAcquirers; /** Charges for a TPA (`partners.processing.charges.list({ account })`, `.retrieve()`, `.refund()`). */ readonly charges: ProcessingReads['charges']; /** Confirmed refunds for a TPA (`partners.processing.refunds.list({ account })`). */ readonly refunds: ProcessingReads['refunds']; /** Disputes for a TPA (`partners.processing.disputes.list({ account })`, `.retrieve()`, `.submitEvidence()`, `.accept()`). */ readonly disputes: ProcessingReads['disputes']; /** Payouts for a TPA (`partners.processing.payouts.list({ account })`). */ readonly payouts: ProcessingReads['payouts']; /** Live provider balance for a TPA (`partners.processing.balance.retrieve({ account })`). */ readonly balance: ProcessingReads['balance']; /** Balance-ledger entries for a TPA (`partners.processing.balanceTransactions.list({ account })`). */ readonly balanceTransactions: ProcessingReads['balanceTransactions']; /** Pre-dispute chargeback alerts for a TPA (`partners.processing.chargebackAlerts.list({ account })`). */ readonly chargebackAlerts: ProcessingReads['chargebackAlerts']; /** * Webhook endpoints + delivery log/replay. A partner-level endpoint * receives events for ALL the partner's TPAs (`event.account` = TPA id). */ readonly webhookEndpoints: ProcessingWebhookEndpoints; private readonly client; private readonly prefix; constructor(client: HttpClient); /** * Enroll a sub-merchant for processing — mint a merchant-scoped `tp_sk_…` * for `accountId` (after Tagada has promoted their application to a TPA). * Same wire as merchant `processing.enroll()`, with required `accountId`. * * @example * const { key } = await partner.partners.processing.enroll({ * accountId: 'acc_xxx', * mode: 'live', * }); */ enroll(params: PartnerEnrollParams, opts?: RequestOptions): Promise; } export declare class Partners { /** CRM provisioning (merchants + CRM keys). */ readonly crm: PartnerCrm; /** TagadaPay processing provisioning (TPAs, KYB, processing keys). */ readonly processing: PartnerProcessing; constructor(client: HttpClient); } //# sourceMappingURL=Partners.d.ts.map