gocardless-nodejs
gocardless-nodejs copied to clipboard
list_for_billing_request doesn't take in a billing request ID
I'm trying to use list_for_billing_request as documented here in step 5 https://developer.gocardless.com/billing-requests/billing-request-actions:
const constants = require('gocardless-nodejs/constants');
const gocardless = require('gocardless-nodejs');
const client = gocardless('your_access_token_here', constants.Environments.Sandbox);
// List of billing request institutions for a country code.
const institutions = await client.institutions.list_for_billing_request("BR123", { countryCode: 'GB'});
I switched to using Typescript after that code didn't work, and it seems there just isn't a first argument for the billing request ID.
It's defined like so, ids
in InstitutionListForBillingRequestRequest
is for ids of the institutions. Also you can see it's country_code not countryCode as in the documentation.
interface InstitutionListForBillingRequestRequest {
country_code: string;
ids?: string[];
search?: string;
}
export declare class InstitutionService {
private api;
constructor(api: any);
list(requestParameters: InstitutionListRequest): Promise<InstitutionListResponse>;
list_for_billing_request(requestParameters: InstitutionListForBillingRequestRequest): Promise<InstitutionListResponse>;
}
No matter how I try to call it, I get an error saying resource not found and you can see the path the request is made to is:
/billing_requests/:identity/institutions?country_code=gb
I can't see anyway to get the ID of the billing request in place of the :identity