Edits history of script submission #12589 for ' Get partner status (mollie)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Mollie = {
      token: string;
    };
    /**
     * Get partner status
     * Retrieve partnership details about the currently authenticated organization. Only relevant for so-called *partner accounts*.
    
    > 🔑 Access with
    >
    > Access token with **organizations.read**
     */
    export async function main(auth: Mollie) {
      const url = new URL(`https://api.mollie.com/v2/organizations/me/partner`);
    
      const response = await fetch(url, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + auth.token,
        },
        body: undefined,
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.text();
    }
    

    Submitted by hugo697 428 days ago