--- title: paymentSessionModal - Payments Apps API description: |- Raises a modal that will be displayed to the buyer after a checkout is completed. Included data will be used to populate the UI extension in the modal. api_version: unstable api_name: payments-apps source_url: html: https://shopify.dev/docs/api/payments-apps/unstable/mutations/paymentSessionModal md: https://shopify.dev/docs/api/payments-apps/unstable/mutations/paymentSessionModal.md --- # payment​Session​Modal mutation Requires `write_payment_sessions` access scope. Raises a modal that will be displayed to the buyer after a checkout is completed. Included data will be used to populate the UI extension in the modal. ## Arguments * action [Modal​Action!](https://shopify.dev/docs/api/payments-apps/unstable/input-objects/ModalAction) required The buyer action and corresponding data that will be made available in the modal at runtime. * expires​At [Date​Time](https://shopify.dev/docs/api/payments-apps/unstable/scalars/DateTime) The date and time the modal will expire, in UTC * id [ID!](https://shopify.dev/docs/api/payments-apps/unstable/scalars/ID) required The payment session ID. *** ## Payment​Session​Modal​Payload returns * payment​Session [Payment​Session](https://shopify.dev/docs/api/payments-apps/unstable/objects/PaymentSession) The updated payment session. * user​Errors [\[Payment​Session​Modal​User​Error!\]!](https://shopify.dev/docs/api/payments-apps/unstable/objects/PaymentSessionModalUserError) non-null The list of errors that occurred from executing the mutation. *** ## Examples * ### paymentSessionModal reference ## Mutation Reference ```graphql mutation paymentSessionModal($id: ID!, $expiresAt: DateTime, $action: ModalAction!) { paymentSessionModal(id: $id, expiresAt: $expiresAt, action: $action) { paymentSession { # PaymentSession fields } userErrors { field message } } } ``` ## Input ```json { "id": "gid://shopify//10079785100", "expiresAt": "2019-09-07T15:50:00Z", "action": { "qrCode": { "code": "", "data": "{ \"name\": \"Size\", \"values\": [\"M\", \"L\"] }" }, "external": { "data": "{ \"name\": \"Size\", \"values\": [\"M\", \"L\"] }" } } } ``` ##### Variables ``` { "id": "gid://shopify//10079785100", "expiresAt": "2019-09-07T15:50:00Z", "action": { "qrCode": { "code": "", "data": "{ \"name\": \"Size\", \"values\": [\"M\", \"L\"] }" }, "external": { "data": "{ \"name\": \"Size\", \"values\": [\"M\", \"L\"] }" } } } ``` ##### Schema ``` input ModalAction { qrCode: QrCode external: External } input QrCode { code: String! data: JSON } input External { data: JSON } ```