--- title: Adding order management to your hosted payment gateway description: Allow merchants who use your gateway integration to capture, refund, and void payments from the Shopify admin. source_url: html: https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/order-management md: https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/order-management.md --- # Adding order management to your hosted payment gateway **Deprecated:** Starting April 30, 2022, new users can no longer install your legacy Hosted Payment SDK (HPSDK) integrations. Your new payments app should be launched by this time to ensure that there's no disruption with new user onboarding. Existing users will have until July 31, 2022 to switch to your payments app. In early May 2022, Shopify will contact impacted users who haven't migrated to the new platform to help them adopt an alternative payments app and avoid payment processing disruptions. After July 31, 2022, all HPSDK integrations will be deprecated. **Note:** To learn more about the HPSDK deprecation, and how to migrate to Payments Platform, refer to [Hosted Payment SDK overview](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk). **Note:** Learn more about the new [payments platform](https://shopify.dev/docs/apps/build/payments). The Hosted Payment SDK has order management features that allow merchants who use your gateway to capture, refund, and void payments for orders in the Shopify admin. To add order management features to your gateway integration, you should already have created a gateway integration with the [Hosted Payments SDK](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk). *** ## Capture payments When a merchant decides to capture a transaction in the Shopify admin, Shopify sends the [Request Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/request-values) to your app, with the `x_transaction_type` set to `capture`: | Key | Type | Example | | - | - | - | | `x_transaction_type` | fixed choice | `capture` | Your app needs to send back the [Response Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/response-values) with the `x_transaction_type` set to `capture`: | Key | Type | Example | | - | - | - | | `x_transaction_type` | fixed choice | `capture` | ### How a manual capture works 1. The merchant clicks the capture button on an order page in the Shopify admin. 2. Shopify sends a POST JSON request to your capture URL with the [Request Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/request-values). **Note:** Your server must reply with a 200 HTTP OK or the order will be canceled. 3. Your server posts a callback to `x_url_callback` with the [Response Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/response-values). ### Set up manual capture for your merchants To set your capture URL: 1. Log in to the [Partner Dashboard](https://app.shopify.com/services/partners/auth/login). 2. Click **Payment gateways**. 3. Click the name of your payment gateway. 4. On your payment gateway's page, click **Edit gateway settings**. 5. In the **Payment URLs** section, enter the url of your gateway's capture endpoint in the **Capture URL** field. When a merchant makes a capture in the Shopify admin, Shopify will send the Request Values to your **Capture URL**. *** ## Refund payments When a merchant decides to refund a transaction in the Shopify admin, Shopify sends the [Request Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/request-values) to your app, with the `x_transaction_type` set to `refund`: | Key | Type | Example | | - | - | - | | `x_transaction_type` | fixed choice | `refund` | Your app needs to send the [Response Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/response-values) to Shopify with the `x_transaction_type` set to `refund`: | Key | Type | Example | | - | - | - | | `x_transaction_type` | fixed choice | `refund` | ### How a refund works 1. The merchant clicks the refund button on an order page in the Shopify admin. 2. Shopify sends a POST JSON request to your refund url with the [Request Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/request-values). **Note:** Your server must reply with a 200 HTTP OK or the order will be canceled. 3. Your server posts a callback to `x_url_callback` with the [Response Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/response-values). ### Set up refunds for your merchants To set your refund URL: 1. Log in to the [Partner Dashboard](https://app.shopify.com/services/partners/auth/login). 2. Click **Payment gateways**. 3. Click the name of your payment gateway. 4. On your payment gateway's page, click **Edit gateway settings**. 5. In the **Payment URLs** section, enter the url of your gateway's capture endpoint in the **Refund URL** field. When a merchant gives a refund from the Shopify admin, the Request Values will be sent to your **Refund URL**. *** ## Void payments When a merchant decides to capture a transaction in the Shopify admin, Shopify sends the [Request Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/request-values) to your app, with the `x_transaction_type` set to `void`: | Key | Type | Example | | - | - | - | | `x_transaction_type` | fixed choice | `void` | Then, your app needs to send the [Response Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/response-values) to Shopify, with the `x_transaction_type` set to `refund`: | Key | Type | Example | | - | - | - | | `x_transaction_type` | fixed choice | `refund` | ### How a void works 1. The merchant clicks the cancel button on an order page in the Shopify admin. 2. Shopify sends a POST JSON request to your void url with the [Request Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/request-values). **Note:** Your server must reply with a 200 HTTP OK or the order will be canceled. 3. Your server posts a callback to `x_url_callback` with the [Response Values](https://shopify.dev/docs/apps/build/payments/hosted-payment-sdk/reference/response-values). ### Set up voids for your merchants To set up your void URL: 1. Log in to the [Partner Dashboard](https://app.shopify.com/services/partners/auth/login). 2. Click **Payment gateways**. 3. Click the name of your payment gateway. 4. On your payment gateway's page, click **Edit gateway settings**. 5. In the **Payment URLs** section, enter the url of your gateway's capture endpoint in the **Void URL** field. When a merchant gives a refund from the Shopify admin, the Request Values will be sent to your **Void URL**. ***