Skip to content
Navigation

Submit a payment for an order

POST
https://api.nicer.travel/commerce/orders/{orderId}/payments

Submits a payment attempt against the order and returns the outcome, including any next action the client must perform, such as card authentication. Requires an Idempotency-Key. Reachable without a token so a traveler can pay from a checkout link.

Authorization

  • bearerAuth
    optional
    HTTP Bearer (JWT)

    Authorization: Bearer <token>

Path parameters

  • orderId
    string
    required

Header parameters

  • Idempotency-Key
    string
    required

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

Request body JSON required

  • method
    required

    One of the following:

    • object
      • kind
        string
        required
    • object
      • kind
        string
        required
      • paymentMethodId
        string
        required
        maxLength: 255 · minLength: 1
    • object
      • kind
        string
        required
      • paymentCredentialId
        string
        required
        maxLength: 255 · minLength: 1
  • saveFor
    optional
    default: {"kind":"NONE"}

    One of the following:

    • object
      • kind
        string
        required
    • object
      • kind
        string
        required
    • object
      • consentAccepted
        boolean
        required
      • kind
        string
        required
      • travelersTripId
        string
        required
        minLength: 1
    • object
      • consentAccepted
        boolean
        required
      • consentCopy
        string
        required

        The statement the payer accepted: the order's saveCardConsentCopy exactly as shown. The server refuses the payment's save when it is no longer the statement for the order's advisor.

        minLength: 1
      • kind
        string
        required

Returns

200

OK

JSON

Any of the following:

  • PaymentAttempt
    • amount
      object
      required
      • amountMinor
        integer
        required
        maximum: 9007199254740991 · minimum: 0
      • currency
        string
        required
        pattern: ^[A-Z]{3}$
    • createdAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
    • nextAction
      required

      Any of the following:

      • Option 1

        One of the following:

        • object
          • type
            string
            required
          • clientSecret
            optional
            string

            Stripe's client secret, to finish the action (3-D Secure) in the browser. Only the payer gets it: the caller who submitted the payment, and on the order a caller on its pay flow (through the order's payment link or checkout session) or the signed-in user the order records as its payer.

            minLength: 1
      • null
    • paymentAttemptId
      string
      required
      minLength: 1
    • purpose
      NICER_CHARGE
      or
      PROVIDER_GUARANTEE
      or
      PROVIDER_PAYMENT
      required
    • reason
      required

      Any of the following:

      • object
        • code
          string
          required
          minLength: 1
        • message
          string
          required
          minLength: 1
        • retryable
          boolean
          required
      • null
    • status
      string
      ·
      one of 7 values
      required
      Allowed values: REQUIRES_ACTION, AUTHORIZED, PROCESSING, SUCCEEDED, DECLINED, UNKNOWN, CANCELLED
    • usedMethod
      optional

      Any of the following:

      • object
        • brand
          required

          Any of the following:

          • string
          • null
        • last4
          required

          Any of the following:

          • string
          • null
        • funding
          optional

          Credit, debit or prepaid. Only the order's payer and Nicer staff get it.

          Any of the following:

          • string
          • null
        • wallet
          optional

          The wallet that paid (Apple Pay, Google Pay). Only the order's payer and Nicer staff get it.

          Any of the following:

          • string
          • null
      • null
  • object
    • action
      object
      required
      • token
        string
        required
        minLength: 1
      • url
        string
        required
        minLength: 1
    • collectionId
      string
      required
      minLength: 1
    • expiresAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
    • status
      string
      required
    • type
      string
      required

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