---
title: "POST /refresh_embedded_js_urls"
method: POST
path: "/refresh_embedded_js_urls"
tags: ["Orders"]
---

# POST /refresh_embedded_js_urls

`POST /refresh_embedded_js_urls`

## Request

- Base URL: `https://api.paynearme-sandbox.com/json-api`
- URL: `https://api.paynearme-sandbox.com/json-api/refresh_embedded_js_urls`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://login.paynearme.com/oauth/token`
  - API key in query parameter `signature`

Retrieves or regenerates the <code>embedded_js_url</code> for one or more orders. The endpoint supports requests for a specific order (using <code>pnm_order_identifier</code> or <code>site_order_identifier</code>) or for multiple orders associated with a consumer (using <code>pnm_customer_identifier</code> or <code>site_customer_identifier</code>).</br></br> The <code>embedded_js_url</code> is required to invoke the [Embedded Form](https://apidocs.paynearme.com/devdocs/docs/embedded-form-for-agents). This URL expires 30 minutes after order creation, whether the order is created via bulk file upload or through the [/create_order](https://apidocs.paynearme.com/devdocs/reference/create_order) endpoint. Before an agent can invoke the Embedded Form, the <code>embedded_js_url</code> must be regenerated if it has expired.</br></br>When regenerating the <code>embedded_js_url</code> for all orders associated with a customer, pagination parameters can be used to control the response size. The <code>limit</code> parameter specifies the maximum number of orders (up to <code>5</code>) to return per request (default is <code>2</code>). Use the <code>offset</code> parameter to specify the number of orders to skip in the response (default is <code>0</code>). </br></br>To regenerate the <code>embedded_js_url</code> for all matching orders regardless of expiration status, set the <code>force</code> parameter to <code>true</code>. If <code>force</code> is set to <code>false</code> or is not provided, the <code>embedded_js_url</code> is regenerated only for orders where the existing URL has expired.

## Request body

- union: Retrieves or regenerates the <code>embedded_js_url</code> for one or more orders.
  - object
    - `site_identifier` string, required: Identifies your client site.
    - `timestamp` string, required: The Unix Epoch time of the call
    - `version` string, required: The version of the API. This version must match the version associated with your API key pair.
    - `signature` string: The HMAC signature that is calculated by running your API Secret Key and the alphabetized, concatenated parameters of the request payload through the SHA256 message digest algorithm. **NOTE:** This field is required when authenticating with the HMAC signature method; it is not required when authenticating with OAuth 2.0.
    - `force` boolean: Use <code>true</code> to regenerate all <code>embedded_js_url</code> for an order regardless of expiration status. If <code>force</code> is set to <code>false</code> or is not provided, the <code>embedded_js_url</code> is regenerated only for orders where the existing URL has expired.
    - `limit` integer: Used for pagination, this parameter specifies the maximum number of orders to return (maximum is <code>5</code>; default is <code>2</code>)
    - `offset` integer: Used for pagination, this parameter specifies the number of orders to skip within the response. Default value is <code>0</code>.
    - `pnm_order_identifier` string, required: The unique, PayNearMe-defined identifier for this order
  - object
    - `site_identifier` string, required: Identifies your client site.
    - `timestamp` string, required: The Unix Epoch time of the call
    - `version` string, required: The version of the API. This version must match the version associated with your API key pair.
    - `signature` string: The HMAC signature that is calculated by running your API Secret Key and the alphabetized, concatenated parameters of the request payload through the SHA256 message digest algorithm. **NOTE:** This field is required when authenticating with the HMAC signature method; it is not required when authenticating with OAuth 2.0.
    - `force` boolean: Use <code>true</code> to regenerate all <code>embedded_js_url</code> for an order regardless of expiration status. If <code>force</code> is set to <code>false</code> or is not provided, the <code>embedded_js_url</code> is regenerated only for orders where the existing URL has expired.
    - `limit` integer: Used for pagination, this parameter specifies the maximum number of orders to return (maximum is <code>5</code>; default is <code>2</code>)
    - `offset` integer: Used for pagination, this parameter specifies the number of orders to skip within the response. Default value is <code>0</code>.
    - `site_order_identifier` string, required: An arbitrary string that the client uses to refer to an order
  - object
    - `site_identifier` string, required: Identifies your client site.
    - `timestamp` string, required: The Unix Epoch time of the call
    - `version` string, required: The version of the API. This version must match the version associated with your API key pair.
    - `signature` string: The HMAC signature that is calculated by running your API Secret Key and the alphabetized, concatenated parameters of the request payload through the SHA256 message digest algorithm. **NOTE:** This field is required when authenticating with the HMAC signature method; it is not required when authenticating with OAuth 2.0.
    - `force` boolean: Use <code>true</code> to regenerate all <code>embedded_js_url</code> for an order regardless of expiration status. If <code>force</code> is set to <code>false</code> or is not provided, the <code>embedded_js_url</code> is regenerated only for orders where the existing URL has expired.
    - `limit` integer: Used for pagination, this parameter specifies the maximum number of orders to return (maximum is <code>5</code>; default is <code>2</code>)
    - `offset` integer: Used for pagination, this parameter specifies the number of orders to skip within the response. Default value is <code>0</code>.
    - `pnm_customer_identifier` string, required: The unique, PayNearMe-defined identifier for this consumer
  - object
    - `site_identifier` string, required: Identifies your client site.
    - `timestamp` string, required: The Unix Epoch time of the call
    - `version` string, required: The version of the API. This version must match the version associated with your API key pair.
    - `signature` string: The HMAC signature that is calculated by running your API Secret Key and the alphabetized, concatenated parameters of the request payload through the SHA256 message digest algorithm. **NOTE:** This field is required when authenticating with the HMAC signature method; it is not required when authenticating with OAuth 2.0.
    - `force` boolean: Use <code>true</code> to regenerate all <code>embedded_js_url</code> for an order regardless of expiration status. If <code>force</code> is set to <code>false</code> or is not provided, the <code>embedded_js_url</code> is regenerated only for orders where the existing URL has expired.
    - `limit` integer: Used for pagination, this parameter specifies the maximum number of orders to return (maximum is <code>5</code>; default is <code>2</code>)
    - `offset` integer: Used for pagination, this parameter specifies the number of orders to skip within the response. Default value is <code>0</code>.
    - `site_customer_identifier` string, required: An arbitrary string that the client uses to refer to an specific consumer

## Response `200`

Successful Operation

- union
  - object
    - `status` 'ok', required
    - `embedded_js_urls` EmbeddedJsUrls[]
      - `pnm_order_identifier` string: The PayNearMe-created ID for the order.
      - `site_order_identifier` string: An arbitrary string that the client uses to refer to an order.
      - `pnm_customer_identifier` string: A PayNearMe-assigned ID for the customer.
      - `site_customer_identifier` string: A client-assigned ID for the customer.
      - `url` string: A dynamic JavaScript URL that is used to invoke the PayNearMe [Embedded Form](https://apidocs.paynearme.com/devdocs/docs/embedded-form-for-agents).
  - ErrorEnvelope: Returned with HTTP 200 for every failure except a rejected OAuth 2.0 access token, which returns HTTP 401 with the same shape. Every response carries a status; on failure it is "error" and the errors array describes what went wrong.
    - `status` 'error', required
    - `errors` ErrorDetail[], required: One entry per failure.
      - `description` string, required: Human-readable description of the failure.
      - `message` string: Parameter-validation detail (APPS-17178).
      - `receipt` string: Receipt text, where the failure relates to a payment.
      - `format` string: Expected format, for parameter-validation failures.
      - `example` string: Example of a well-formed value.
      - `details` object: Processor response details (APPS-18223).

## Other responses

- `401`: OAuth 2.0 requests only. The `Authorization` header has no Bearer token, the access token is invalid, expired, or issued for a different site, or the `site_identifier` does not match any site. The response does not say which. If the request is rejected before it reaches PayNearMe, the body may not be JSON, so detect this error by the HTTP status. HMAC-signed requests never receive this status.

## Changes

- **2026-11-03** `907541f733a3`: 2 breaking, 5 warning, 5 info
  - added `#/components/schemas/ErrorEnvelope, subschema #1` to the response body `oneOf` list for the response status `200`
  - the response's body type changed from `object` to no type, and format from `array` to no format for status `200`
  - removed the optional property `pnm_customer_identifier` from the response with the `200` status
  - removed the optional property `pnm_order_identifier` from the response with the `200` status
  - …8 more

[Operation history](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0/changes/refresh_embedded_js_urls/post.md)

---

[API](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0.md) - [All operations](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0/llms.txt) - [OpenAPI document](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0/revisions/907541f733a3?raw)
