> 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

# UpdateExtendedFields

# Package: orders

# Namespace: OrderPaymentRequestsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-payment-requests/update-extended-fields.md

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

## Introduction

Updates the extended fields of an order payment request.

---

## REST API

### Schema

```
 Method: updateExtendedFields
 Description: Updates the extended fields of an order payment request.
 URL: https://www.wixapis.com/ecom/v1/order-payment-requests/{id}/update-extended-fields
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  namespace, namespaceData
 Method parameters: 
   param name: namespace | type: namespace | description: Identifier for the app whose extended fields are being updated. | required: true 
   param name: namespaceData | type: namespaceData | description: Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md#json-schema-for-extended-fields) defined when the extended fields were configured. | required: true 
 Return type: UpdateExtendedFieldsResponse
  - name: orderPaymentRequest | type: OrderPaymentRequest | description: Updated order payment request.  
     - name: id | type: string | description: Order payment request GUID.  | validation: format GUID
     - name: source | type: Source | description: Details about the source that created the order payment request.  | validation: immutable
        - name: appId | type: string | description: GUID of the app that created the order payment request.  | validation: minLength 1, maxLength 100, format GUID, immutable
        - name: externalId | type: string | description: Reference to a record in the source system. For example, if the payment request was created from a paylink or invoice, use this field to store the paylink GUID or invoice GUID.  | validation: minLength 1, maxLength 100, immutable
     - name: status | type: Status | description: Payment request status. Set by the system. A new order payment request starts as `UNPAID`, unless `expirationDate` is already in the past at creation time, in which case it is created as `EXPIRED`. The system sets the status to `PAID` once payment is collected, `EXPIRED` when the expiration date passes, or `VOIDED` when the request is voided.  
         - enum:
         -     UNPAID: Payment is owed but hasn't been collected yet.
         -     PAID: Payment has been collected.
         -     EXPIRED: The order payment request has passed its `expirationDate` without being paid.
     - name: orderId | type: string | description: Order GUID.  | validation: format GUID, immutable
     - name: orderNumber | type: string | description: Order number.  | validation: maxLength 100
     - name: amount | type: Price | description: Amount to collect. Set when the order payment request is created and can't be changed afterward.  | validation: immutable
        - name: amount | type: string | description: Amount.  | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
        - name: formattedAmount | type: string | description: Amount formatted with currency symbol.  
     - name: currency | type: string | description: Three-letter currency code in [ISO-4217 alphabetic format](http://en.wikipedia.org/wiki/ISO_4217). Always matches the order's currency.  | validation: format CURRENCY
     - name: paymentGatewayOrderId | type: string | description: Payment gateway order GUID associated with this payment request.  | validation: minLength 1, maxLength 100
     - name: title | type: string | description: Title displayed to the customer on the payment page.  | validation: minLength 1, maxLength 200
     - name: description | type: string | description: Description displayed to the customer on the payment page.  | validation: maxLength 300
     - name: expirationDate | type: string | description: Date and time the order payment request expires. If not provided, the order payment request doesn't expire.  | validation: format date-time, immutable
     - name: extendedFields | type: ExtendedFields | description: Custom field data for this order payment request.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: createdDate | type: string | description: Date and time the order payment request was created.  | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the order payment request was last updated.  | validation: format date-time
     - name: image | type: Image | description: Image to display to the customer on the payment page.  
        - name: id | type: string | description: WixMedia image GUID.  | validation: maxLength 200
        - name: height | type: integer | description: Original image height.  
        - name: width | type: integer | description: Original image width.  
        - name: altText | type: string | description: Image alt text.  | validation: maxLength 200
        - name: filename | type: string | description: Image filename.  | validation: maxLength 200
     - name: blockedPaymentMethods | type: array<PaymentMethod> | description: List of payment methods that can't be used for this order payment request.  | validation: maxItems 1
         - enum:
         -     MANUAL: Manual payment.


```

### Examples

### Update extended fields
Updates the extended fields of an order payment request with app-specific data.

```curl
curl -X POST \
  'https://www.wixapis.com/ecom/v1/order-payment-requests/3c8f1a2e-7b4d-4f9e-8c61-5d2e9a0b1c3f/update-extended-fields' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "namespace": "my-app-namespace",
    "namespaceData": {
      "invoiceId": "INV-2026-00123",
      "approvedBy": "manager@example.com"
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.orderPaymentRequests.updateExtendedFields(_id, namespace, options)
 Description: Updates the extended fields of 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:  _id, namespace, options.namespaceData, options
 Method parameters: 
   param name: _id | type: string | description: GUID of the entity to update. | required: true 
   param name: namespace | type: string | description: Identifier for the app whose extended fields are being updated. | required: true 
   param name: options | type: UpdateExtendedFieldsOptions  none | required: true 
        - name: namespaceData | type: object | description: Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md#json-schema-for-extended-fields) defined when the extended fields were configured. | required: true 
 Return type: PROMISE<UpdateExtendedFieldsResponse>
  - name: orderPaymentRequest | type: OrderPaymentRequest | description: Updated order payment request.  
     - name: _id | type: string | description: Order payment request GUID.  | validation: format GUID
     - name: source | type: Source | description: Details about the source that created the order payment request.  | validation: immutable
        - name: appId | type: string | description: GUID of the app that created the order payment request.  | validation: minLength 1, maxLength 100, format GUID, immutable
        - name: externalId | type: string | description: Reference to a record in the source system. For example, if the payment request was created from a paylink or invoice, use this field to store the paylink GUID or invoice GUID.  | validation: minLength 1, maxLength 100, immutable
     - name: status | type: Status | description: Payment request status. Set by the system. A new order payment request starts as `UNPAID`, unless `expirationDate` is already in the past at creation time, in which case it is created as `EXPIRED`. The system sets the status to `PAID` once payment is collected, `EXPIRED` when the expiration date passes, or `VOIDED` when the request is voided.  
         - enum:
         -     UNPAID: Payment is owed but hasn't been collected yet.
         -     PAID: Payment has been collected.
         -     EXPIRED: The order payment request has passed its `expirationDate` without being paid.
     - name: orderId | type: string | description: Order GUID.  | validation: format GUID, immutable
     - name: orderNumber | type: string | description: Order number.  | validation: maxLength 100
     - name: amount | type: Price | description: Amount to collect. Set when the order payment request is created and can't be changed afterward.  | validation: immutable
        - name: amount | type: string | description: Amount.  | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
        - name: formattedAmount | type: string | description: Amount formatted with currency symbol.  
     - name: currency | type: string | description: Three-letter currency code in [ISO-4217 alphabetic format](http://en.wikipedia.org/wiki/ISO_4217). Always matches the order's currency.  | validation: format CURRENCY
     - name: paymentGatewayOrderId | type: string | description: Payment gateway order GUID associated with this payment request.  | validation: minLength 1, maxLength 100
     - name: title | type: string | description: Title displayed to the customer on the payment page.  | validation: minLength 1, maxLength 200
     - name: description | type: string | description: Description displayed to the customer on the payment page.  | validation: maxLength 300
     - name: expirationDate | type: Date | description: Date and time the order payment request expires. If not provided, the order payment request doesn't expire.  | validation: immutable
     - name: extendedFields | type: ExtendedFields | description: Custom field data for this order payment request.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: _createdDate | type: Date | description: Date and time the order payment request was created.  
     - name: _updatedDate | type: Date | description: Date and time the order payment request was last updated.  
     - name: image | type: string | description: Image to display to the customer on the payment page.  
     - name: blockedPaymentMethods | type: array<PaymentMethod> | description: List of payment methods that can't be used for this order payment request.  | validation: maxItems 1
         - enum:
         -     MANUAL: Manual payment.


```

### Examples

### Update extended fields
Updates the extended fields of an order payment request with app-specific data.

```javascript

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

const orderPaymentRequestId = '3c8f1a2e-7b4d-4f9e-8c61-5d2e9a0b1c3f';
const namespace = 'my-app-namespace';
const namespaceData = {
  invoiceId: 'INV-2026-00123',
  approvedBy: 'manager@example.com',
};

export async function myUpdateExtendedFieldsFunction() {
  try {
    const response = await orderPaymentRequests.updateExtendedFields(
      orderPaymentRequestId,
      namespace,
      { namespaceData }
    );
    console.log('Success! Updated order payment request:', response.orderPaymentRequest);
    return response;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "orderPaymentRequest": {
 *     "_id": "3c8f1a2e-7b4d-4f9e-8c61-5d2e9a0b1c3f",
 *     "status": "UNPAID",
 *     "orderId": "a931e280-254a-49a7-9641-22ef64c444ae",
 *     "orderNumber": "10052",
 *     "amount": {
 *       "amount": "15.50",
 *       "formattedAmount": "$15.50"
 *     },
 *     "currency": "USD",
 *     "title": "Balance Due for Order #10052",
 *     "extendedFields": {
 *       "namespaces": {
 *         "my-app-namespace": {
 *           "invoiceId": "INV-2026-00123",
 *           "approvedBy": "manager@example.com"
 *         }
 *       }
 *     },
 *     "_createdDate": "2026-06-01T14:22:18.456Z",
 *     "_updatedDate": "2026-06-16T09:45:32.123Z"
 *   }
 * }
 */

```

### updateExtendedFields (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 updateExtendedFields(_id,namespace,options) {
  const response = await myWixClient.orderPaymentRequests.updateExtendedFields(_id,namespace,options);
};
```

---