> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetOrderPaymentRequestURL

# Package: orders

# Namespace: OrderPaymentRequestsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-payment-requests/get-order-payment-request-url.md

## Permission Scopes:
Manage eCommerce - all permissions: SCOPE.DC-ECOM-MEGA.MANAGE-ECOM

## Introduction

Retrieves the payment page URL for an order payment request.

---

## REST API

### Schema

```
 Method: getOrderPaymentRequestUrl
 Description: Retrieves the payment page URL for an order payment request.
 URL: https://www.wixapis.com/ecom/v1/order-payment-requests/url
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  orderPaymentRequestId
 Method parameters: 
   param name: orderPaymentRequestId | type: orderPaymentRequestId | description: GUID of the order payment request. | required: true | validation: format GUID
 Return type: GetOrderPaymentRequestURLResponse
  - name: orderPaymentRequestUrl | type: string | description: Payment page URL for the order payment request.  | validation: minLength 1, maxLength 100

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ORDER_PAYMENT_REQUEST_NOT_FOUND | Description: Couldn't find the order payment request.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND | Description: The Payment Request Page isn't published on the site. Add and publish a Payment Request Page in the Wix Editor.


```

### Examples

### Get Order Payment Request URL
Retrieves the payment page URL for an order payment request to share with the customer.

```curl
curl -X POST \
  'https://www.wixapis.com/ecom/v1/order-payment-requests/url' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "orderPaymentRequestId": "3c8f1a2e-7b4d-4f9e-8c61-5d2e9a0b1c3f"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.orderPaymentRequests.getOrderPaymentRequestUrl(orderPaymentRequestId)
 Description: Retrieves the payment page URL for an order payment request.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  orderPaymentRequestId
 Method parameters: 
   param name: orderPaymentRequestId | type: string | description: GUID of the order payment request. | required: true | validation: format GUID
 Return type: PROMISE<GetOrderPaymentRequestURLResponse>
  - name: orderPaymentRequestUrl | type: string | description: Payment page URL for the order payment request.  | validation: minLength 1, maxLength 100

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ORDER_PAYMENT_REQUEST_NOT_FOUND | Description: Couldn't find the order payment request.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND | Description: The Payment Request Page isn't published on the site. Add and publish a Payment Request Page in the Wix Editor.


```

### Examples

### Get order payment request URL
Retrieves the payment page URL for an order payment request to share with the customer.

```javascript

import { orderPaymentRequests } from '@wix/ecom';

const orderPaymentRequestId = '3c8f1a2e-7b4d-4f9e-8c61-5d2e9a0b1c3f';

export async function myGetOrderPaymentRequestURLFunction() {
  try {
    const response = await orderPaymentRequests.getOrderPaymentRequestURL(orderPaymentRequestId);
    console.log('Success! Payment URL:', response.orderPaymentRequestUrl);
    return response;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "orderPaymentRequestUrl": "https://www.examplestore.com/payment-request-page/3c8f1a2e-7b4d-4f9e-8c61-5d2e9a0b1c3f"
 * }
 */

```

### getOrderPaymentRequestUrl (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { orderPaymentRequests } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { orderPaymentRequests },
  // Include the auth strategy and host as relevant
});


async function getOrderPaymentRequestUrl(orderPaymentRequestId) {
  const response = await myWixClient.orderPaymentRequests.getOrderPaymentRequestUrl(orderPaymentRequestId);
};
```

---