Skip to content
Navigation

List or set up payment methods

POST
https://api.nicer.travel/commerce/payment-methods/actions

Runs a payment-method action: listing the stored methods the caller may use, starting a card setup, creating the link a client opens to authorize a card to the advisor who makes it, or revoking a saved card or an authorization. A verified user session and an Idempotency-Key are required. Repeating the same CREATE_TRIP_CARD_LINK request while the link is active returns its original URL and expiresAt. LIST omits private advisor notes unless the eligible advisor explicitly requests them.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • Idempotency-Key
    string
    required

    Unique key (8–255 chars) per request; replays return the original result.

Request body JSON required

One of the following:

  • object
    • type
      string
      required
    • includeAdvisorNotes
      optional
      boolean

      Include private notes on the caller’s own advisor authorizations.

    • travelerId
      optional
      string

      A CRM traveler of the caller's agency: only the cards whose authorization names that traveler, as their CRM profile shows them. A traveler of another agency answers 404 COMMERCE_TRAVELER_NOT_FOUND.

      maxLength: 64 · minLength: 1
    • travelersTripId
      optional
      string

      A trip the caller works: its cards are listed too, and when the trip has CRM travelers the cards clients authorized to the caller are limited to theirs, plus those that name no traveler.

      minLength: 1
  • object
    • saveFor
      required

      One of the following:

      • object
        • kind
          string
          required
      • object
        • kind
          string
          required
      • object
        • consentAccepted
          boolean
          required
        • kind
          string
          required
        • travelersTripId
          string
          required
          minLength: 1
    • type
      string
      required
    • usage
      string
      required
  • object
    • type
      string
      required
    • recipientEmail
      optional
      string

      Where the link is also emailed, in the agency's brand. Recorded on the authorization, so the advisor who made the link can tell one client's card from another.

      format: email · pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
    • travelerId
      optional
      string

      The CRM traveler the link is sent to, recorded on the authorization as whose card it is. From a trip, one of the trip's travelers; left out there, the trip's one traveler whose email is recipientEmail, else none. Without a trip it is required and must be a traveler of the caller's agency. A traveler who is not on the trip, or not at the agency, answers 404 COMMERCE_TRAVELER_NOT_FOUND.

      maxLength: 64 · minLength: 1
    • travelersTripId
      optional
      string

      The trip the link is made from, recorded as where the authorization came from. Left out for a card asked from the traveler's CRM profile, which then needs travelerId (400 COMMERCE_CARD_LINK_TARGET_REQUIRED without either). Either way, completing the link authorizes the card to the advisor who made it, for this client's purchases on any of their trips.

      minLength: 1
  • object
    • paymentMethodId
      string
      required
      maxLength: 255 · minLength: 1
    • scope
      required

      One of the following:

      • object
        • kind
          string
          required
      • object
        • kind
          string
          required
        • travelersTripId
          string
          required
          minLength: 1
      • object
        • kind
          string
          required
        • advisorUserId
          optional
          string
          minLength: 1
    • type
      string
      required
  • object
    • type
      string
      required
    • paymentMethodId
      string
      required
      maxLength: 255 · minLength: 1
    • note
      required

      A private label for this authorization. Use null to clear it.

      Any of the following:

      • string
      • null
    • advisorUserId
      optional
      string

      Defaults to the caller. Only an active admin of the agency can edit another advisor’s grant.

      minLength: 1

Returns

200

OK

JSON

One of the following:

  • object
    • methods
      array of
      object
      required
      • authorizations
        array of
        object
        required

        The card's live TRIP and ADVISOR authorizations the caller may see: enough to pick the right client's card (when it was authorized, the trip it came from and its title, the recipient named, the CRM traveler it belongs to). Empty for a card that is only the caller's own.

        default: []
        • advisorUserId
          required

          ADVISOR: the advisor the card is authorized to. Null for TRIP.

          Any of the following:

          • string
          • null
        • authorizedAt
          required

          When consent was given; null when none was recorded.

          Any of the following:

          • string
          • null
        • kind
          TRIP
          or
          ADVISOR
          required

          TRIP: anyone working travelersTripId may use the card (an authorization given before advisor grants). ADVISOR: advisorUserId may use it for this client's purchases on any of their trips.

        • travelersTripId
          required

          TRIP: the trip. ADVISOR: the trip the authorization came from (the trip the link was made from, or the paid order's trip); null when it came from none.

          Any of the following:

          • string
          • null
        • note
          optional
          string

          The advisor’s private note about this authorization, included on request when listing their own grants.

          maxLength: 100
        • advisorName
          optional

          The display name of the advisor the card is authorized to; null when it is unknown. Only the person who gave the authorization gets it: the advisor reading their own entry does not.

          Any of the following:

          • string
          • null
        • recipientEmail
          optional

          The recipient the advisor named on the link that collected the card; null when none was named or the card was authorized at payment. Only that advisor gets it.

          Any of the following:

          • string
          • null
        • travelerId
          optional

          ADVISOR: the CRM traveler whose card it is, the one the advisor sent the link to (named on the link, or the trip's traveler with the recipient's email). Absent or null when none was recorded: the link named or matched none, the card was authorized at payment, or before travelers were recorded. Only the advisor the card is authorized to gets it.

          Any of the following:

          • TravelerId
          • null
        • tripTitle
          optional

          The title of travelersTripId, so the advisor can tell which client's trip the card came from; null when the trip has no title or there is no trip. Only the advisor the card is authorized to gets it.

          Any of the following:

          • string
          • null
      • brand
        required

        Any of the following:

        • string
        • null
      • expiry
        required

        Any of the following:

        • string
        • null
      • label
        string
        required
        maxLength: 200 · minLength: 1
      • last4
        required

        Any of the following:

        • string
        • null
      • paymentMethodId
        string
        required
        maxLength: 255 · minLength: 1
      • scopes
        array of
        USER
        or
        TRIP
        or
        ADVISOR
        required
      • usable
        boolean
        required
      • usableUntil
        required

        Any of the following:

        • string
        • null
    • status
      string
      required
  • object
    • collection
      object
      required
      • collectionToken
        string
        required
        minLength: 1
      • collectionUrl
        string
        required
        minLength: 1
      • type
        string
        required
    • setupId
      string
      required
      minLength: 1
    • status
      string
      required
  • object
    • nextAction
      object
      required
      • clientSecret
        string
        required
        minLength: 1
      • type
        string
        required
    • setupId
      string
      required
      minLength: 1
    • status
      string
      required
  • object
    • expiresAt
      required

      Any of the following:

      • string
      • null
    • paymentMethodId
      required

      Any of the following:

      • string
      • null
    • status
      string
      required
    • travelersTripId
      required

      Any of the following:

      • string
      • null
    • url
      required

      Any of the following:

      • string
      • null

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close