# Collect card payments Prepare your application and back end to collect card payments using Stripe Terminal. # Server-driven For BBPOS WisePOS E and Stripe Reader S700/S710, we recommend server-side integration because it uses the Stripe API instead of a Terminal SDK to collect payments. New to the Payment Intents API? Here are some helpful resources: - [The Payment Intents API](https://docs.stripe.com/payments/payment-intents.md) - [The PaymentIntent object](https://docs.stripe.com/api/payment_intents.md) - [More payment scenarios](https://docs.stripe.com/payments/more-payment-scenarios.md) Collecting payments with Stripe Terminal requires writing a payment flow in your application. Use the Stripe Terminal SDK to create and update a [PaymentIntent](https://docs.stripe.com/api.md#payment_intents), an object representing a single payment session. While the core concepts are similar to SDK-based integrations, you follow slightly different steps with the server-driven integration: 1. [Create a PaymentIntent](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#create-payment). You can define whether to [automatically](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-capture_method) or [manually](https://docs.stripe.com/payments/place-a-hold-on-a-payment-method.md) capture your payments. 1. [Process the payment](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#process-payment). Authorization on the customer’s card takes place when the reader processes the payment. 1. (Optional) [Capture the PaymentIntent](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#capture-payment). > This integration shape doesn’t support [offline card payments](https://docs.stripe.com/terminal/features/operate-offline/collect-card-payments.md). ## Create a PaymentIntent - [Create a PaymentIntent](https://docs.stripe.com/api/payment_intents/create.md) The first step in collecting payments is to start the payment flow. When a customer begins checking out, your backend must create a [PaymentIntent](https://docs.stripe.com/api/payment_intents.md) object that represents a new payment session on Stripe. With the server-driven integration, you create the PaymentIntent server-side. In a sandbox, you can use [test amounts](https://docs.stripe.com/terminal/references/testing.md#physical-test-cards) to simulate different error scenarios. In live mode, the amount of the PaymentIntent displays on the reader for payment. For Terminal payments, the `payment_method_types` parameter must include `card_present`. To accept Interac payments in Canada, you must also include `interac_present` in `payment_method_types`. Learn about [regional considerations for Canada](https://docs.stripe.com/terminal/payments/regional.md?integration-country=CA#create-a-paymentintent). To accept non-card payment methods in supported countries, you must also specify your preferred types in `payment_method_types`. Learn about [additional payment methods](https://docs.stripe.com/terminal/payments/additional-payment-methods.md). You can control the payment flow as follows: - To fully control the payment flow for `card_present` payments, set the `capture_method` to `manual`. This allows you to add a reconciliation step before finalizing the payment. - To authorize and capture payments in one step, set the `capture_method` to `automatic`. > Don’t recreate a PaymentIntent if a card is declined. Instead, re-use the same PaymentIntent to help [avoid double charges](https://docs.stripe.com/terminal/payments/collect-card-payment.md#avoiding-double-charges). ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d currency=usd \ -d "payment_method_types[]=card_present" \ -d capture_method=manual \ -d amount=1000 ``` ## Process the payment You can process a payment immediately with the card presented by a customer, or instead inspect card details before proceeding to process the payment. For most use cases, we recommend processing immediately, as it’s a simpler integration with less API calls and webhook events. However, if you would like to insert your own business logic before the card is authorized, you can use the two-step collect-and-confirm flow. #### Process immediately - [Process a PaymentIntent](https://docs.stripe.com/api/terminal/readers/process_payment_intent.md) After you create a PaymentIntent, the next step is to process the payment. The reader prompts the customer to insert or tap their card and then authorizes the payment. To collect payment, make a request to Stripe with the ID of the PaymentIntent you created and the reader you want to use for the transaction. ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/process_payment_intent \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" ``` Processing the payment happens asynchronously. A cardholder might take a few seconds to get their card from their wallet or pose a question to the operator during payment. When you process a payment, Stripe immediately responds to the request with an HTTP `200` status code as an acknowledgement that the reader received the action. In most cases, the request returns a [reader](https://docs.stripe.com/api/terminal/readers.md) with an `in_progress` status. However, because processing occurs asynchronously, the action status might already reflect the final state (`succeeded` or `failed`) if the payment completes quickly. Simultaneously, the reader screen switches to a UI that prompts the customer to insert their card. To [verify the reader state](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#verify-reader), listen to the `terminal.reader.action_succeeded` webhook or poll the Reader and PaymentIntent status to receive the status of the payment. ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}} \ -u "<>:" ``` ```json { "id": "{{READER_ID}}", "object": "terminal.reader", ... "status": "online", "action": { "type": "process_payment_intent", "process_payment_intent": { "payment_intent": "{{PAYMENT_INTENT_ID}}" }, "status": "in_progress", "failure_code": null, "failure_message": null } } ``` #### Collect, inspect, and confirm After you create a PaymentIntent, the next step is to process the payment. The reader prompts the customer to insert or tap their card and then creates a PaymentMethod. ### Collect a PaymentMethod - [Collect a payment method](https://docs.stripe.com/api/terminal/readers/collect_payment_method.md) To collect payment, make a request to Stripe with the ID of the PaymentIntent you created and the reader you want to use for the transaction. ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/collect_payment_method \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" ``` > After payment method collection you must authorize the payment or cancel collection within 30 seconds. Collecting the payment happens asynchronously. A cardholder might take a few seconds to get their card from their wallet or pose a question to the operator during payment. When you start collecting a payment method, Stripe immediately responds to the request with an HTTP `200` status code and returns a reader with an action status of `in_progress`. Simultaneously, the reader screen switches to a UI that prompts the customer to insert their card. After the reader collects card data, the PaymentMethod attaches to the server-side PaymentIntent and stores on the Reader object as `action.collect_payment_method.payment_method`. To [verify the reader state](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#verify-reader), listen to the `terminal.reader.action_updated` webhook or poll the Reader action status to inspect the PaymentMethod. At this point, you can access attributes like card brand, funding, and other useful data from the PaymentMethod. Stripe attempts to detect whether a mobile wallet is used in a transaction as shown in the `wallet.type` attribute. However, the attribute isn’t populated if the card’s issuing bank doesn’t support reader-driven identification of a mobile wallet, so accurate detection isn’t guaranteed. After authorization in the [confirmation](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) step, Stripe receives up-to-date information from the networks and updates `wallet.type` reliably. ### Confirm the PaymentIntent - [Confirm a PaymentIntent](https://docs.stripe.com/api/terminal/readers/confirm_payment_intent.md) After successfully collecting a PaymentMethod, you can proceed to authorize the payment. ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/confirm_payment_intent \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" ``` Confirming the PaymentIntent is asynchronous. You can listen to the `terminal.reader.action_succeeded` webhook or poll the Reader and PaymentIntent status to receive the status of the payment. If you’re using a simulated reader, use the [present_payment_method](https://docs.stripe.com/terminal/references/testing.md#simulated-card-presentment) endpoint to simulate a cardholder tapping or inserting their card on the reader. Use [test cards](https://docs.stripe.com/terminal/references/testing.md#standard-test-cards) to simulate different success or failure scenarios. ## Capture the payment If you defined `capture_method` as `manual` during PaymentIntent creation in [Step 1](https://docs.stripe.com/terminal/payments/collect-card-payment.md#create-payment), the SDK returns an authorized but not captured PaymentIntent to your application. Learn more about the difference between [authorization and capture](https://docs.stripe.com/payments/place-a-hold-on-a-payment-method.md). When your application receives a confirmed PaymentIntent, make sure it notifies your backend to capture the PaymentIntent. To do so, create an endpoint on your backend that accepts a PaymentIntent ID and sends a request to the Stripe API to capture it. ```curl curl -X POST https://api.stripe.com/v1/payment_intents/{{PAYMENTINTENT_ID}}/capture \ -u "<>:" ``` A successful capture call results in a PaymentIntent with a status of `succeeded`. To make sure the application fee captured is correct for connected accounts, inspect each PaymentIntent and modify the application fee (if needed), before manually capturing the payment. > You must manually capture `PaymentIntents` within two days or the authorization expires and funds are released to the customer. ### Collect tips (US only) In the US, eligible users can [collect a tip on the receipt when capturing payments](https://docs.stripe.com/terminal/features/collecting-tips/on-receipt.md). ## Verify the reader state To make sure the reader completed an action, your application must verify the reader state before initiating a new reader action or continuing to capture the payment. In most cases, this verification allows you to confirm a successful (approved) payment and show any relevant UX to your operator for them to complete the transaction. In other cases, you might need to [handle errors](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=api#handle-errors), including declined payments. Use one of the following to check the reader status: - [Listen to webhooks](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#webhooks) - [Poll the Stripe API](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#stripe-api) - [Use the PaymentIntent](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#payment-intent) - [Use the reader object](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#reader-object) #### Listen to webhooks (Recommended) For maximum resiliency, we recommend your application listens to [webhooks](https://docs.stripe.com/webhooks.md) from Stripe to receive real-time notifications of the reader status. Stripe sends three webhooks to notify your application of a reader’s action status: | Status | Description | | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | `terminal.reader.action_succeeded` | Sent when a reader action succeeds, such as when a payment is authorized successfully. | | `terminal.reader.action_failed` | Sent when a reader action fails, such as when a card is declined due to insufficient funds. | | `terminal.reader.action_updated` (Preview) | Sent when a reader action is updated, such as when a payment method is collected (only triggered for the `collect_payment_method` action). | To listen for these webhooks, create a [webhook](https://docs.stripe.com/webhooks.md) endpoint. We recommend having a dedicated webhook endpoint for only these events because they’re high priority and in the critical payment path. ```curl curl https://api.stripe.com/v1/webhook_endpoints \ -u "<>:" \ -d "enabled_events[]=terminal.reader.action_succeeded" \ -d "enabled_events[]=terminal.reader.action_failed" \ --data-urlencode "url=https://example.com/my/webhook/endpoint" ``` #### Poll the Stripe API In case of webhook delivery issues, you can poll the Stripe API by adding a `check status` button to your point-of-sale interface that the operator can invoke, if needed. #### Use the PaymentIntent You can retrieve the PaymentIntent that you passed to the reader for processing. When you create a PaymentIntent it has an initial status of `requires_payment_method`. After you successfully collect the payment method, the status updates to `requires_confirmation`. After the payment processes successfully, the status updates to `requires_capture`. ```curl curl https://api.stripe.com/v1/payment_intents/{{PAYMENTINTENT_ID}} \ -u "<>:" ``` #### Use the reader object You can use the [Reader](https://docs.stripe.com/api/terminal/readers/object.md) object, which contains an [action](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action) attribute that shows the latest action received by the reader and its status. Your application can [retrieve a Reader](https://docs.stripe.com/api/terminal/readers/retrieve.md) to check if the [status](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-status) of the reader action has changed. ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}} \ -u "<>:" ``` The Reader object is also returned as the response to the process payment step. The `action` type when processing a payment is `process_payment_intent`. The `action.status` updates to `succeeded` for a successful payment. This means you can proceed with completing the transaction. Other values for `action.status` include `failed` or `in_progress`. ## Handle errors The following errors are the most common types your application needs to handle: - [Avoiding double charges](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#avoiding-double-charges) - [Payment failures](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#payment-failures) - [Payment timeout](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#payment-timeout) - [Payment cancellation](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#payment-cancellation) - [Reader busy](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#reader-busy) - [Reader timeout](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#reader-timeout) - [Reader offline](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#reader-offline) - [Missing webhooks](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#missing-webhooks) - [Delayed webhooks](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#delayed-webhooks) ### Avoiding double charges The PaymentIntent object enables money movement at Stripe—use a single PaymentIntent to represent a transaction. Re-use the same PaymentIntent after a card is declined (for example, if it has insufficient funds), so your customer can try again with a different card. If you edit the PaymentIntent, you must call [process_payment_intent](https://docs.stripe.com/api/terminal/readers/process_payment_intent.md) to update the payment information on the reader. A PaymentIntent must be in the `requires_payment_method` state before Stripe can process it. An authorized, captured, or canceled PaymentIntent can’t be processed by a reader and results in an `intent_invalid_state` error: ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/process_payment_intent \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" ``` ```json { "error": { "code": "intent_invalid_state", "doc_url": "https://docs.stripe.com/error-codes#intent-invalid-state", "message": "Payment intent must be in the requires_payment_method state to be processed by a reader.", "type": "invalid_request_error" } } ``` ### Payment failures The most common payment failure is a failed payment authorization (for example, a payment that’s declined by the customer’s bank due to insufficient funds). When a payment authorization fails, Stripe sends the `terminal.reader.action_failed` webhook. The information available to your integration depends on the reader software version. #### Reader software version 2.42 and later Readers running software version 2.42 or later include an [api_error](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-api_error) hash on the action when the failure originates from the Stripe API (such as a card decline). When the failure originates from the reader itself (such as a customer cancellation), `api_error` is null. Use `api_error.type` to determine whether the error message can be shown to the cardholder. When the type is `card_error`, you can display `api_error.message` to the cardholder so they can take action. Use `api_error.doc_url` for guidance on handling each specific error code. ```json { "id": "{{READER_ID}}", "object": "terminal.reader","action": { "failure_code": "card_declined", "failure_message": "Your card has insufficient funds.", "api_error": { "type": "card_error", "code": "card_declined", "decline_code": "insufficient_funds", "message": "Your card has insufficient funds.", "doc_url": "https://docs.stripe.com/error-codes#card-declined", "request_log_url": "https://dashboard.stripe.com/logs/{{REQUEST_ID}}" }, "process_payment_intent": { "payment_intent": "{{PAYMENT_INTENT_ID}}" }, "status": "failed", "type": "process_payment_intent" }, ... } ``` > Don’t parse `api_error.message` for programmatic logic. Instead, use `api_error.type` or `api_error.code`. The `api_error.message` field is for display only and can change at any time. If you need additional error details beyond what `api_error` provides (such as `network_decline_code` or the associated `charge`), retrieve the PaymentIntent and inspect [last_payment_error](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-last_payment_error). #### Reader software versions before 2.42 Readers on software versions before 2.42 always return `api_error` as null. Check the [action.failure_code](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-failure_code) and [action.failure_message](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-failure_message) attributes to know why a payment is declined: ```json { "id": "{{READER_ID}}", "object": "terminal.reader","action": { "failure_code": "card_declined", "failure_message": "Your card has insufficient funds.", "api_error": null, "process_payment_intent": { "payment_intent": "{{PAYMENT_INTENT_ID}}" }, "status": "failed", "type": "process_payment_intent" }, ... } ``` To determine the error type and whether the message can be shown to the cardholder, retrieve the PaymentIntent and inspect [last_payment_error](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-last_payment_error). #### Handling declined cards In the case of a declined card, prompt the customer for an alternative form of payment. Use the same PaymentIntent in another request to the [process_payment_intent](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-process_payment_intent) endpoint. If you create a new PaymentIntent, you must [cancel](https://docs.stripe.com/api/payment_intents/cancel.md) the failed PaymentIntent to prevent double charges. For card read errors (for example, an error reading the chip), the reader automatically prompts the customer to retry without any notification to your application. If multiple retries fail, you can prompt for another payment method by making another [process_payment_intent](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-process_payment_intent) request. ### Payment timeout A reader with unreliable internet connectivity can fail to process a payment because of a networking request timeout when authorizing the card. The reader shows a processing screen for several seconds, followed by a failure screen, and you receive a `terminal.reader.action_failed` webhook with a `failure_code` of `connection_error`: ```json { "id": "{{READER_ID}}", "object": "terminal.reader","action": { "failure_code": "connection_error", "failure_message": "Could not connect to Stripe.", "process_payment_intent": { "payment_intent": "{{PAYMENT_INTENT_ID}}" }, "status": "failed", "type": "process_payment_intent" }, ... } ``` The payment confirmation request might have been processed by Stripe’s backend systems, but the reader might have disconnected before receiving the response from Stripe. When receiving a webhook with this failure code, fetch the PaymentIntent `status` to verify if the payment is successfully authorized. Make sure your network meets our [network requirements](https://docs.stripe.com/terminal/network-requirements.md) to minimize timeouts. ### Payment cancellation #### Programmatic cancellation You might need to cancel an in-flight payment. For example, if a customer adds items to their purchase after your integration has already initiated payment collection on the reader. Use the [cancel_action](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-cancel_action) endpoint to reset the reader: ```curl curl -X POST https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/cancel_action \ -u "<>:" ``` > You can’t cancel a reader action in the middle of a payment authorization. If a customer has already presented their card to pay on the reader, you must wait for processing to complete. An authorization normally takes a few seconds to complete. Calling [cancel_action](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-cancel_action) during an authorization results in a `terminal_reader_busy` error. #### Customer-initiated cancellation Users can set the value of `enable_customer_cancellation` on these endpoints: - [process_payment_intent](https://docs.stripe.com/api/terminal/readers/process_payment_intent.md) - [process_setup_intent](https://docs.stripe.com/api/terminal/readers/process_setup_intent.md) - [collect_payment_method](https://docs.stripe.com/api/terminal/readers/collect_payment_method.md) - [refund_payment](https://docs.stripe.com/api/terminal/readers/refund_payment.md) ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/process_payment_intent \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" \ -d "process_config[enable_customer_cancellation]=true" ``` When set to true, smart reader users see a cancel button. ![Payment collection screen with customer cancellation button](https://b.stripecdn.com/docs-statics-srv/assets/customer-cancellation-light-mode.c9ff8361795a2bf4d9e307eee8669775.png) Payment collection with cancellation enabled Tapping the cancel button cancels the active transaction. Stripe sends a `terminal.reader.action_failed` webhook with a failure_code of `customer_canceled`. ```json { "action": { "failure_code": "customer_canceled", "failure_message": "This action could not be completed due to an error on the card reader.", "process_payment_intent": { "payment_intent": "{{PAYMENT_INTENT_ID}}", "process_config": { "enable_customer_cancellation": true } }, "status": "failed", "type": "process_payment_intent" } } ``` ### Reader busy A reader can process only one payment at a time. While it’s processing a payment, attempting a new payment fails with a `terminal_reader_busy` error: ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/process_payment_intent \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" ``` ```json { "error": { "code": "terminal_reader_busy", "doc_url": "https://docs.stripe.com/error-codes#terminal-reader-timeout", "message": "Reader is currently busy processing another request. Please reference the integration guide at https://stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#handle-errors for details on how to handle this error.", "type": "invalid_request_error" } } ``` Payments that have not begun processing can be replaced with a new payment. A reader also rejects an API request if it’s busy performing updates, changing settings or if a card is inserted from the previous transaction. ### Reader timeout On rare occasions, a reader might fail to respond to an API request on time because of temporary networking issues. If this happens, you receive a `terminal_reader_timeout` error code: ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/process_payment_intent \ -u "<>:" \ -d "payment_intent={{PAYMENTINTENT_ID}}" ``` ```json { "error": { "code": "terminal_reader_timeout", "doc_url": "https://docs.stripe.com/error-codes#terminal-reader-timeout", "message": "There was a timeout when sending this command to the reader. Please reference the integration guide at https://stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#handle-errors for details on how to handle this error.", "type": "invalid_request_error" } } ``` In this case, we recommend you retry the API request. Make sure your network meets our [network requirements](https://docs.stripe.com/terminal/network-requirements.md) to minimize timeouts. On rare occasions, a `terminal_reader_timeout` error code is a false negative. In this scenario, you receive a `terminal_reader_timeout` error from the API as described above, but the reader has actually received the command successfully. False negatives happen when Stripe sends a message to the reader, but doesn’t receive an acknowledgement back from the reader due to temporary networking failures. ### Reader offline A location losing its internet connection might result in interrupted communication between the reader and Stripe. In this case, a reader is unresponsive to events initiated from your point-of-sale application and backend infrastructure. A reader that consistently fails to respond to API requests is most likely powered off (for example, the power cord is disconnected or it’s out of battery) or not correctly connected to the internet. A reader is considered offline if Stripe hasn’t received any signal from that reader in the past 2 minutes. Attempting to call API methods on a reader that’s offline results in a `terminal_reader_offline` error code: ```json { "error": { "code": "terminal_reader_offline", "doc_url": "https://docs.stripe.com/error-codes#terminal-reader-offline", "message": "Reader is currently offline, please ensure the reader is powered on and connected to the internet before retrying your request. Reference the integration guide at https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#reader-offline for details on how to handle this error.", "type": "invalid_request_error" } } ``` Refer to our [network requirements](https://docs.stripe.com/terminal/network-requirements.md) to make sure a reader is correctly connected to the internet. ### Missing webhooks When a reader disconnects in the middle of a payment, it can’t update its action status in the API. In this scenario, the reader shows an error screen after a card is presented. However, the Reader object in the API doesn’t update to reflect the failure on the device, and you also don’t get reader action webhooks. A reader might be left with an action status of `in_progress` when this happens, and a cashier has to intervene by calling the [cancel_action](https://docs.stripe.com/api/terminal/readers/object.md#terminal_reader_object-action-cancel_action) endpoint to reset the reader state. ### Delayed webhooks On rare occasions, if Stripe is having an outage, reader action webhooks might be late. You can query the status of the Reader or the PaymentIntent objects to know what their latest state is. ## Webhook events | Webhook | Description | | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `terminal.reader.action_succeeded` | Sent when an asynchronous action succeeds. Sent for actions that need card presentment, such as `process_payment_intent`, `confirm_payment_intent`, `process_setup_intent`, and `refund_payment`. | | `terminal.reader.action_failed` | Sent when an asynchronous action fails. Sent for actions that need card presentment such as `process_payment_intent`, `process_setup_intent`, `refund_payment`. No webhook is sent for the `set_reader_display` and `cancel_action` actions. Your integration must [handle these errors](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=server-driven#handle-errors). | | `terminal.reader.action_updated` | Sent when an asynchronous action is updated. Sent for actions such as `collect_payment_method`. |