ordercloud-javascript-sdk
    Preparing search index...

    Class Payments

    Index
    • Returns this

      enables impersonation by calling the subsequent method with the stored impersonation token

      Payments.As().List() // lists Payments using the impersonated users' token
      
    • Create a payment transaction Check out the docs for more info

      Type Parameters

      • TPayment extends Payment<any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • paymentID: string

        ID of the payment.

      • paymentTransaction: PaymentTransaction

        Required fields: Type, DateExecuted

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TPayment>>

    • Delete a payment Check out the docs for more info

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • paymentID: string

        ID of the payment.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Delete a payment transaction Check out the docs for more info

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • paymentID: string

        ID of the payment.

      • transactionID: string

        ID of the transaction.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Retrieve a payment Check out the docs for more info

      Type Parameters

      • TPayment extends Payment<any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • paymentID: string

        ID of the payment.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TPayment>>

    • List payments Check out the docs for more info

      Type Parameters

      • TPayment extends Payment<any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "Description")[];
            sortBy?: (
                | "ID"
                | "DateCreated"
                | "!ID"
                | "!DateCreated"
                | "Type"
                | "CreditCardID"
                | "SpendingAccountID"
                | "!Type"
                | "!CreditCardID"
                | "!SpendingAccountID"
            )[];
        } = {}
        • Optionalfilters?: Filters

          An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

        • Optionalpage?: number

          Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

        • OptionalpageSize?: number

          Number of results to return per page.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ID" | "Description")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: (
              | "ID"
              | "DateCreated"
              | "!ID"
              | "!DateCreated"
              | "Type"
              | "CreditCardID"
              | "SpendingAccountID"
              | "!Type"
              | "!CreditCardID"
              | "!SpendingAccountID"
          )[]

          Comma-delimited list of fields to sort by.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TPayment>>>

    • Partially update a payment PUT is not a supported method for payments due to the implications associated with modifying certain properties. Patch is only permitted on certain properties that vary depending on order status Check out the docs for more info

      Type Parameters

      • TPayment extends Payment<any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • paymentID: string

        ID of the payment.

      • payment: PartialDeep<Payment>
      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TPayment>>