Skip to Content
Paycose Docs
Setup intents

Setup intents

The setup_intent object

A setup intent saves a payment method for a customer without charging it. Create one, send the customer to the returned link, and the payment method is saved when they finish. A setup intent can be retrieved for 30 days after it is created.

Attributes

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the setup intent was created in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • customer_idstringRequired

    ID of the customer the payment method is saved for.

  • providerstringRequired

    Payment provider that will store the payment method, such as stripe.

  • metadataobjectRequired

    Key-value pairs you sent when creating the setup intent. Keys the payment provider added while starting the setup are left out.

  • next_actionarray of objects

    Steps the customer must complete to finish the setup, such as a redirect; omitted when there are none.

    Show child attributes
    • next_action.typestringRequired

      The kind of step. It decides which of url, client_secret, payment_method, qr_data and qr_image_url are set.

      • redirect

        Send the payer to url to finish the payment.

      • share_link

        Send the hosted payment link in url to the customer so they can complete authentication themselves.

      • confirm_inline

        Show the card form in your page and confirm the payment with client_secret.

      • show_qr

        Show qr_data as a QR code, or the image at qr_image_url, for the payer to scan.

      • qr

        Show qr_data as a QR code for the payer to scan.

      • otp

        Ask the payer for the one-time password their bank sent and submit it to confirm the payment.

    • next_action.titlestringRequired

      Short heading for the step, in English, suitable to show the payer.

    • next_action.descriptionstringRequired

      One-sentence explanation of the step, in English, suitable to show the payer.

    • next_action.urlstring

      For redirect, the page to send the payer to: a 3-D Secure page, a wallet's approval page or a banking app link. For share_link, a hosted payment page you can send to the customer; the link is valid for 24 hours. Omitted for other types.

    • next_action.client_secretstring

      For confirm_inline, the provider's client secret the card form uses to confirm or authenticate the payment. For otp, the provider's reference of the payment that the one-time password confirms. Omitted for other types.

    • next_action.payment_methodstring

      For confirm_inline after a payment was refused off-session, the provider's payment method to authenticate. For show_qr, the QR payment method the code is for, such as alipay, wechat_pay or qr_cross_border. Omitted otherwise.

    • next_action.qr_datastring

      For show_qr and qr, the raw QR payload to render as a QR code for the payer to scan. Omitted for other types.

    • next_action.qr_image_urlstring

      For show_qr, a link to the provider's image of the QR code, for when the provider sends no raw payload (such as an Omise PromptPay charge): show the image for the payer to scan. Omitted when the provider sends none.

    • next_action.cryptoobjectNullable
      Show child attributes
      • next_action.crypto.networkstringRequired
      • next_action.crypto.chain_idstringRequired
      • next_action.crypto.testnetbooleanRequired
      • next_action.crypto.deposit_addressstringRequired
      • next_action.crypto.token_currencystringRequired
      • next_action.crypto.token_contract_addressstringRequired
      • next_action.crypto.token_amountstringRequired
      • next_action.crypto.token_unitsintegerRequired
      • next_action.crypto.token_decimalsintegerRequired
      • next_action.crypto.exchange_ratestring
      • next_action.crypto.explorer_urlstring
      • next_action.crypto.expires_attimestampRequired

        Unix timestamp in seconds.

  • countrystringRequired

    Two-letter code of the country the setup intent was created in.

  • statusenumRequired

    requires_payment_method until the payer saves a method on the page in next_action, then succeeded.

    • requires_payment_method

      The payer has not saved a payment method yet.

    • succeeded

      The payment method is saved and can be charged.

  • payment_methodstringRequiredNullable

    ID of the payment method the setup intent saved; null until it succeeds.