Skip to content
Navigation

Complete a card authorization

POST
https://api.nicer.travel/commerce/payment-methods/complete-card-link

Completes a single-use card authorization link with the card the card page has just stored: the body names that card (paymentMethodId) and echoes the exact statement the page showed, which must still be the link's. No card number travels on this route. Whoever holds the link may complete it: its capability travels as Authorization: PaymentLink <token> or X-Payment-Link-Token, and a link for a personal card also needs its owner signed in. The card is then authorized to whom the link names (the advisor who made it, its trip, or its owner), and the answer is COMPLETED with the card's paymentMethodId. Requires an Idempotency-Key. Errors: 401 ERROR_AUTHENTICATION_REQUIRED without a capability; 409 COMMERCE_PAYMENT_METHOD_CONSENT_CHANGED when the statement changed since the page showed it; 409 COMMERCE_PAYMENT_METHOD_LINK_CONSUMED for a link already completed with another card.

Authorization

  • bearerAuth
    optional
    HTTP Bearer (JWT)

    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

  • consentAccepted
    boolean
    required
  • consentCopy
    string
    required

    The statement the person accepted: the link's consentCopy exactly as the card page showed it. The server refuses the completion when it is no longer the link's statement.

    minLength: 1
  • paymentMethodId
    string
    required
    maxLength: 255 · pattern: ^paym_.*
  • type
    string
    required

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

429

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

Type to search…

↑↓ navigate↵ selectEsc close