ordercloud-javascript-sdk
    Preparing search index...

    Class CreditCards

    Index
    • Returns this

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

      CreditCards.As().List() // lists CreditCards using the impersonated users' token
      
    • Delete a credit card Check out the docs for more info

      Parameters

      • buyerID: string

        ID of the buyer.

      • creditCardID: string

        ID of the credit card.

      • 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 credit card assignment Check out the docs for more info

      Parameters

      • buyerID: string

        ID of the buyer.

      • creditCardID: string

        ID of the credit card.

      • listOptions: { userGroupID?: string; userID?: string } = {}
        • OptionaluserGroupID?: string

          ID of the user group.

        • OptionaluserID?: string

          ID of the user.

      • 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 credit card Check out the docs for more info

      Type Parameters

      Parameters

      • buyerID: string

        ID of the buyer.

      • creditCardID: string

        ID of the credit card.

      • 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<TCreditCard>>

    • List credit cards Check out the docs for more info

      Type Parameters

      Parameters

      • buyerID: string

        ID of the buyer.

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "CardholderName" | "CardType" | "ExpirationDate")[];
            sortBy?: (
                | "ID"
                | "CardholderName"
                | "CardType"
                | "ExpirationDate"
                | "DateCreated"
                | "!ID"
                | "!DateCreated"
                | "!CardholderName"
                | "!CardType"
                | "!ExpirationDate"
            )[];
        } = {}
        • 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" | "CardholderName" | "CardType" | "ExpirationDate")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: (
              | "ID"
              | "CardholderName"
              | "CardType"
              | "ExpirationDate"
              | "DateCreated"
              | "!ID"
              | "!DateCreated"
              | "!CardholderName"
              | "!CardType"
              | "!ExpirationDate"
          )[]

          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<TCreditCard>>>

    • List credit card assignments Check out the docs for more info

      Type Parameters

      Parameters

      • buyerID: string

        ID of the buyer.

      • listOptions: {
            creditCardID?: string;
            level?: PartyType;
            page?: number;
            pageSize?: number;
            userGroupID?: string;
            userID?: string;
        } = {}
        • OptionalcreditCardID?: string

          ID of the credit card.

        • Optionallevel?: PartyType

          Level of the credit card assignment. Possible values: User, Group, Company, BuyerGroup.

        • 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.

        • OptionaluserGroupID?: string

          ID of the user group.

        • OptionaluserID?: string

          ID of the user.

      • 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<TCreditCardAssignment>>>

    • Create or update a credit card If an object with the same ID already exists, it will be overwritten. Check out the docs for more info

      Type Parameters

      Parameters

      • buyerID: string

        ID of the buyer.

      • creditCardID: string

        ID of the credit card.

      • creditCard: CreditCard
      • 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<TCreditCard>>

    • Create or update a credit card assignment Check out the docs for more info

      Parameters

      • buyerID: string

        ID of the buyer.

      • creditCardAssignment: CreditCardAssignment

        Required fields: CreditCardID

      • 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>