Skip to content

Latest commit

 

History

History
154 lines (118 loc) · 5.95 KB

payouts.md

File metadata and controls

154 lines (118 loc) · 5.95 KB

Payouts

const payoutsApi = client.payoutsApi;

Class Name

PayoutsApi

Methods

List Payouts

Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. To call this endpoint, set PAYOUTS_READ for the OAuth scope.

async listPayouts(
  locationId?: string,
  status?: string,
  beginTime?: string,
  endTime?: string,
  sortOrder?: string,
  cursor?: string,
  limit?: number,
  requestOptions?: RequestOptions
): Promise<ApiResponse<ListPayoutsResponse>>

Parameters

Parameter Type Tags Description
locationId string | undefined Query, Optional The ID of the location for which to list the payouts.
By default, payouts are returned for the default (main) location associated with the seller.
status string | undefined Query, Optional If provided, only payouts with the given status are returned.
beginTime string | undefined Query, Optional The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year.
endTime string | undefined Query, Optional The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time.
sortOrder string | undefined Query, Optional The order in which payouts are listed.
cursor string | undefined Query, Optional A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see Pagination.
If request parameters change between requests, subsequent results may contain duplicates or missing records.
limit number | undefined Query, Optional The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.
Default: 100
requestOptions RequestOptions | undefined Optional Pass additional request options.

Response Type

ListPayoutsResponse

Example Usage

try {
  const { result, ...httpResponse } = await payoutsApi.listPayouts();
  // Get more response info...
  // const { statusCode, headers } = httpResponse;
} catch(error) {
  if (error instanceof ApiError) {
    const errors = error.result;
    // const { statusCode, headers } = error;
  }
}

Get Payout

Retrieves details of a specific payout identified by a payout ID. To call this endpoint, set PAYOUTS_READ for the OAuth scope.

async getPayout(
  payoutId: string,
  requestOptions?: RequestOptions
): Promise<ApiResponse<GetPayoutResponse>>

Parameters

Parameter Type Tags Description
payoutId string Template, Required The ID of the payout to retrieve the information for.
requestOptions RequestOptions | undefined Optional Pass additional request options.

Response Type

GetPayoutResponse

Example Usage

const payoutId = 'payout_id6';
try {
  const { result, ...httpResponse } = await payoutsApi.getPayout(payoutId);
  // Get more response info...
  // const { statusCode, headers } = httpResponse;
} catch(error) {
  if (error instanceof ApiError) {
    const errors = error.result;
    // const { statusCode, headers } = error;
  }
}

List Payout Entries

Retrieves a list of all payout entries for a specific payout. To call this endpoint, set PAYOUTS_READ for the OAuth scope.

async listPayoutEntries(
  payoutId: string,
  sortOrder?: string,
  cursor?: string,
  limit?: number,
  requestOptions?: RequestOptions
): Promise<ApiResponse<ListPayoutEntriesResponse>>

Parameters

Parameter Type Tags Description
payoutId string Template, Required The ID of the payout to retrieve the information for.
sortOrder string | undefined Query, Optional The order in which payout entries are listed.
cursor string | undefined Query, Optional A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see Pagination.
If request parameters change between requests, subsequent results may contain duplicates or missing records.
limit number | undefined Query, Optional The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.
Default: 100
requestOptions RequestOptions | undefined Optional Pass additional request options.

Response Type

ListPayoutEntriesResponse

Example Usage

const payoutId = 'payout_id6';
try {
  const { result, ...httpResponse } = await payoutsApi.listPayoutEntries(payoutId);
  // Get more response info...
  // const { statusCode, headers } = httpResponse;
} catch(error) {
  if (error instanceof ApiError) {
    const errors = error.result;
    // const { statusCode, headers } = error;
  }
}