/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Chariot from "../../../index"; export declare namespace Nonprofits { interface Options { environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; } } export declare class Nonprofits { protected readonly _options: Nonprofits.Options; constructor(_options?: Nonprofits.Options); /** * Retrieves a nonprofit organization by an [Employee Identification Number](https://www.irs.gov/charities-non-profits/employer-identification-number) (EIN). * The EIN is a unique number that identifies the organization to the Internal Revenue Service (IRS). * * In the case that the organization does not exist within Chariot's system, you can create one by calling the [Create Nonprofit](/api/nonprofits/create) API endpoint. * * @param {string} ein - The unique federal employer identification number (EIN) of the nonprofit. * This value should be exactly 9 digits and should not contain any special characters such as dashes. * @param {Nonprofits.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.NotFoundError} * @throws {@link Chariot.InternalServerError} * * @example * await client.nonprofits.getByEin("530196605") */ getByEin(ein: string, requestOptions?: Nonprofits.RequestOptions): Promise; /** * Create a nonprofit organization. * * This is useful for integration partners to use after a nonprofit consents to use the Chariot payment option on their donation forms. * * * If a nonprofit does not already exist for the EIN, this will return a `201 Created` status. * If a nonprofit already exists for the given EIN on the system, this will return a `200 OK` status. * * * * Handling errors: * - If the nonprofit does not exist within Chariot's database, a `404 Not Found` status is returned. * - If the nonprofit exists but does not pass Chariot's compliance checks, a `412 Precondition Failed` status is returned with a reason. * * * @param {Chariot.NonprofitsCreateRequest} request * @param {Nonprofits.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.NotFoundError} * @throws {@link Chariot.PreconditionFailedError} * @throws {@link Chariot.InternalServerError} * * @example * await client.nonprofits.create({ * user: { * email: "ben.give@co.com" * }, * ein: "043567500" * }) */ create(request: Chariot.NonprofitsCreateRequest, requestOptions?: Nonprofits.RequestOptions): Promise; /** * Retrieves the nonprofit organization with the given ID. * * @param {string} id - The unique identifier for the nonprofit * @param {Nonprofits.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.NotFoundError} * @throws {@link Chariot.InternalServerError} * * @example * await client.nonprofits.getById("g33ee4ee-f881-42a0-85e3-1dde7118w9k2") */ getById(id: string, requestOptions?: Nonprofits.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }