---
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`

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/post_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, required — 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.
    - `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, required — 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.
    - `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, required — 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.
    - `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, required — 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.
    - `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

- EmbeddedJsUrls — The Embedded JS URLs object displays the regenerated embedded_js_url used to invoke the [Embedded Form](https://apidocs.paynearme.com/devdocs/docs/embedded-form-for-agents).
  - `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).

---

[API](https://skmtc.net/paynearme/apis/paynearme-api-v3-0.md) · [All operations](https://skmtc.net/paynearme/apis/paynearme-api-v3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/paynearme/paynearme-api-v3-0/revisions/44cba4f8b80f/schema)
