//native
type Square = {
token: string;
};
/**
* RetrieveDisputeEvidence
* Returns the metadata for the evidence specified in the request URL path.
You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it.
*/
export async function main(
auth: Square,
dispute_id: string,
evidence_id: string,
) {
const url = new URL(
`https://connect.squareup.com/v2/disputes/${dispute_id}/evidence/${evidence_id}`,
);
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.json();
}
Submitted by hugo697 235 days ago