Skip to main content
PATCH
/
simulations
/
{simulation_id}
Update a simulation
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: 'Refund approved',
    type: 'adjustment.updated',
    payload: {
      id: 'adj_01hvgf2s84dr6reszzg29zbvcm',
      action: 'refund',
      transaction_id: 'txn_01hvcc93znj3mpqt1tenkjb04y',
      subscription_id: 'sub_01hvccbx32q2gb40sqx7n42430',
      customer_id: 'ctm_01hrffh7gvp29kc7xahm8wddwa',
      reason: 'error',
      credit_applied_to_balance: null,
      currency_code: 'USD',
      status: 'approved',
      items: [
        {
          id: 'adjitm_01hvgf2s84dr6reszzg2gx70gj',
          item_id: 'txnitm_01hvcc94b7qgz60qmrqmbm19zw',
          type: 'partial',
          amount: '100',
          proration: null,
          totals: {subtotal: '92', tax: '8', total: '100'}
        }
      ],
      totals: {
        subtotal: '92',
        tax: '8',
        total: '100',
        fee: '5',
        earnings: '87',
        currency_code: 'USD'
      },
      payout_totals: {
        subtotal: '92',
        tax: '8',
        total: '100',
        fee: '5',
        earnings: '87',
        currency_code: 'USD'
      },
      created_at: '2024-04-15T08:48:20.239695Z',
      updated_at: '2024-04-15T08:48:20.239695Z'
    }
  })
};

fetch('https://api.paddle.com/simulations/{simulation_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "data": {
    "id": "ntfsim_01j82fs5pvrdse93e1kawqy2fr",
    "notification_setting_id": "ntfset_01j8259dtga48jwekrv2pmk0kp",
    "name": "Refund approved",
    "type": "adjustment.updated",
    "status": "active",
    "payload": {
      "id": "adj_01hvgf2s84dr6reszzg29zbvcm",
      "action": "refund",
      "transaction_id": "txn_01hvcc93znj3mpqt1tenkjb04y",
      "subscription_id": "sub_01hvccbx32q2gb40sqx7n42430",
      "customer_id": "ctm_01hrffh7gvp29kc7xahm8wddwa",
      "reason": "error",
      "credit_applied_to_balance": null,
      "currency_code": "USD",
      "status": "approved",
      "items": [
        {
          "id": "adjitm_01hvgf2s84dr6reszzg2gx70gj",
          "item_id": "txnitm_01hvcc94b7qgz60qmrqmbm19zw",
          "type": "partial",
          "amount": "100",
          "proration": null,
          "totals": {
            "subtotal": "92",
            "tax": "8",
            "total": "100"
          }
        }
      ],
      "totals": {
        "subtotal": "92",
        "tax": "8",
        "total": "100",
        "fee": "5",
        "earnings": "87",
        "currency_code": "USD"
      },
      "payout_totals": {
        "subtotal": "92",
        "tax": "8",
        "total": "100",
        "fee": "5",
        "earnings": "87",
        "currency_code": "USD"
      },
      "created_at": "2024-04-15T08:48:20.239695Z",
      "updated_at": "2024-04-15T08:48:20.239695Z"
    },
    "last_run_at": "2024-09-18T11:55:18.261049Z",
    "created_at": "2024-09-18T11:55:15.547675Z",
    "updated_at": "2024-09-18T12:07:08.475015Z"
  },
  "meta": {
    "request_id": "ab96e6ec-6a2b-4f3a-9e65-3cf7ac29ea99"
  }
}

Authorizations

Authorization
string
header
required

Requests are authenticated with API keys. Provide your API key as a Bearer token in the Authorization header.

API keys are assigned permissions, granting them access to entities and operations. Each endpoint may require one or more permissions, defined with the x-permissions extension. Values for include parameters may require specific permissions as defined in the x-enum-permissions extension. See all available permissions in the permission schema or documentation.

Get an API key and select the permissions you need from the Paddle dashboard under Paddle > Developer Tools > Authentication.

Path Parameters

simulation_id
string
required

Paddle ID of the simulation entity to work with.

Example:

"ntfsim_01gt261ms8ew72a0vnm5p5ne2q"

Body

application/json

Single event simulations play a single event.

notification_setting_id
string

Paddle ID of the notification setting where this simulation is sent, prefixed with ntfset_.

Example:

"ntfset_01gt21c5pdx9q1e4mh1xrsjjn6"

name
string

Name of this simulation.

status
enum<string>

Whether this entity can be used in Paddle.

Available options:
active,
archived
type
enum<string>

Single event sent for this simulation, in the format entity.event_type.

Available options:
address.created,
address.imported,
address.updated,
adjustment.created,
adjustment.updated,
api_key.created,
api_key.expired,
api_key.expiring,
api_key.revoked,
api_key.updated,
business.created,
business.imported,
business.updated,
customer.created,
customer.imported,
customer.updated,
discount.created,
discount.imported,
discount.updated,
payment_method.saved,
payment_method.deleted,
payout.created,
payout.paid,
price.created,
price.imported,
price.updated,
product.created,
product.imported,
product.updated,
report.created,
report.updated,
subscription.activated,
subscription.canceled,
subscription.created,
subscription.imported,
subscription.past_due,
subscription.paused,
subscription.resumed,
subscription.trialing,
subscription.updated,
transaction.billed,
transaction.canceled,
transaction.completed,
transaction.created,
transaction.paid,
transaction.past_due,
transaction.payment_failed,
transaction.ready,
transaction.revised,
transaction.updated
payload
object

Simulation payload. Pass a JSON object that matches the schema for an event type to simulate a custom payload. Set to null to clear and populate with a demo example.

Response

OK

data
Single event · object
required

Single event simulations play a single event.

meta
Meta · object
required

Information about this response.