Passa al contenuto principale

Exports Payments Create​

Requests an export of the payments matching the given filters, selection or segment, with the chosen columns, and returns it straight away in PENDING state. The file is generated in background: poll the export until it is COMPLETED, then download it. Requires the PAYMENT_EXPORT permission.

Request Body required
    format object

    An enumeration.

    fields string[] required

    Keys of the columns to export, in the order they should appear. The record identifier is always added, whether or not it is listed. Read the available keys from the fields endpoint of the same kind.

    filters object

    Filters selecting the records, with the same keys as the filters of the GraphQL domain input of the same kind (SupporterFilters, DonationFilters, PaymentFilters), in camelCase or snake_case. Omitted or empty, the export covers every record. Ignored when ids or segment_id is given.

    ids integer[]

    Explicit selection of records to export, by id. Takes precedence over filters.

    segment_id Segment Id

    Saved segment to export. Its filters are copied into the export when it is requested, so editing the segment later does not change what this export means. Takes precedence over filters.

    script Script

    Python script run over the finished file before it is published: it reads /work/input.csv and writes /work/output.csv, with the standard library only, no network, 128 MB of memory and 20 minutes at most. CSV exports only. When it fails the export fails, with its error in error_message.

Responses

OK


Schema
    id Id required

    Unique identifier of the export.

    kind object

    An enumeration.

    format object

    An enumeration.

    state object

    An enumeration.

    label Label required

    Human-readable name of the export, built from its kind and the moment it ran.

    filename Filename

    Name of the generated file. Null until it is ready.

    rows_total Rows Total required

    Records written to the file.

    file_size File Size required

    Size of the file in bytes.

    expires_date date-time

    When the file is deleted. The export itself is kept as history.

    download_count Download Count required

    How many times the file has been downloaded.

    last_download_date date-time

    When the file was last downloaded.

    attempts Attempts required

    How many times the generation was attempted, retries included.

    task_id Task Id

    Identifier of the background task generating the file.

    filters object required

    The filters the export ran with, copied when it was requested. Empty when it ran over everything.

    from_selection From Selection required

    Whether the export ran over an explicit selection of records rather than filters.

    staff_name Staff Name

    Name of the staff member who requested the export. Null when it was not started by a person.

    segment_name Segment Name

    Name of the saved segment the export ran over. Null when it ran over ad-hoc filters.

    fields object[] required

    The columns the export was asked to produce, in the order they appear in the file.

  • Array [
  • key Key required

    Identifier of the column, as written in the file header.

    label Label required

    Human-readable name of the column. Falls back to the key when the column no longer exists.

  • ]
  • error_code object

    An enumeration.

    error_message Error Message

    Details of the failure. Null when it did not fail.

    script Script

    Post-processing script the export ran with. Null when it had none.

    download_url Download Url

    Address the file is served from with an Authorization: Bearer header. Null when the file is not ready or no longer available. Only administrators of the organization can download it.

    create_date date-time required

    When the export was requested.

    update_date date-time required

    When the export was last modified.

Loading...