Browse the API docs

Application charges

What an installed app charges the store each month. The app creates a charge, the merchant approves it in the admin, and it's billed on the store's Weftstore invoice until it's cancelled or the app is uninstalled.

Endpoints#

Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.

The recurring application charge object#

What the endpoints below return for one recurring application charge.

recurring_application_charge
{
  "id": "cm2chrg0001",
  "name": "Standard plan",
  "api_client_id": "slc_6f1d0c4b2a9e8d7c6b5a4f3e2d1c0b9a",
  "price": "1499.00",
  "currency": "PKR",
  "status": "pending",
  "test": false,
  "trial_days": 7,
  "trial_ends_on": null,
  "activated_on": null,
  "cancelled_on": null,
  "billed_through": null,
  "return_url": "https://orderprinter.example/billing/return",
  "confirmation_url": "https://storeloom.example/admin/apps/charges/cm2chrg0001",
  "created_at": "2026-10-25T09:12:00.000Z",
  "updated_at": "2026-10-25T09:12:00.000Z"
}

List the app's charges#

GET/recurring_application_charges.jsonAny token

The charges this app has asked this store for, oldest first, whatever their status. Other apps' charges never show up.

Query parameters
ParameterDescription
statusOnly charges with this status: pending, active, declined, cancelled or expired.
since_idOnly charges after this id.
limitUp to 250 (default 50).
Request
curl "https://store.weftgrid.com/api/admin/2026-10/recurring_application_charges.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "recurring_application_charges": [
    {
      "id": "cm2chrg0001",
      "name": "Standard plan",
      "api_client_id": "slc_6f1d0c4b2a9e8d7c6b5a4f3e2d1c0b9a",
      "price": "1499.00",
      "currency": "PKR",
      "status": "pending",
      "test": false,
      "trial_days": 7,
      "trial_ends_on": null,
      "activated_on": null,
      "cancelled_on": null,
      "billed_through": null,
      "return_url": "https://orderprinter.example/billing/return",
      "confirmation_url": "https://storeloom.example/admin/apps/charges/cm2chrg0001",
      "created_at": "2026-10-25T09:12:00.000Z",
      "updated_at": "2026-10-25T09:12:00.000Z"
    }
  ]
}

Get a charge#

GET/recurring_application_charges/{id}.jsonAny token

One of this app's charges. Check its status when the merchant comes back to return_url with charge_id.

Request
curl "https://store.weftgrid.com/api/admin/2026-10/recurring_application_charges/$RECURRING_APPLICATION_CHARGE_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "recurring_application_charge": {
    "id": "cm2chrg0001",
    "name": "Standard plan",
    "api_client_id": "slc_6f1d0c4b2a9e8d7c6b5a4f3e2d1c0b9a",
    "price": "1499.00",
    "currency": "PKR",
    "status": "pending",
    "test": false,
    "trial_days": 7,
    "trial_ends_on": null,
    "activated_on": null,
    "cancelled_on": null,
    "billed_through": null,
    "return_url": "https://orderprinter.example/billing/return",
    "confirmation_url": "https://storeloom.example/admin/apps/charges/cm2chrg0001",
    "created_at": "2026-10-25T09:12:00.000Z",
    "updated_at": "2026-10-25T09:12:00.000Z"
  }
}

Create a charge#

POST/recurring_application_charges.jsonAny token

Asks the merchant to approve a monthly charge. price is a decimal string in the platform's billing currency (Pakistani rupees unless the platform says otherwise). Send the merchant to confirmation_url: they approve or decline it there and come back to return_url with charge_id added (https, or http://localhost while you develop the app). Approving makes it active (with a free trial first when trial_days is set) and cancels the app's other active charge. It's billed on the store's Weftstore invoice from the end of the trial until it's cancelled or the app is uninstalled. test charges are approved the same way but never billed. A charge nobody answers expires after 48 hours. Every change sends app_subscriptions/update to the app. Only apps installed from the App Store can charge: custom apps get 403.

Request body
{"recurring_application_charge":{"name":"Standard plan","price":"1499.00","return_url":"https://orderprinter.example/billing/return","trial_days":7,"test":false}}
Request with curl
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/recurring_application_charges.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recurring_application_charge":{"name":"Standard plan","price":"1499.00","return_url":"https://orderprinter.example/billing/return","trial_days":7,"test":false}}'
Example responseShow
{
  "recurring_application_charge": {
    "id": "cm2chrg0001",
    "name": "Standard plan",
    "api_client_id": "slc_6f1d0c4b2a9e8d7c6b5a4f3e2d1c0b9a",
    "price": "1499.00",
    "currency": "PKR",
    "status": "pending",
    "test": false,
    "trial_days": 7,
    "trial_ends_on": null,
    "activated_on": null,
    "cancelled_on": null,
    "billed_through": null,
    "return_url": "https://orderprinter.example/billing/return",
    "confirmation_url": "https://storeloom.example/admin/apps/charges/cm2chrg0001",
    "created_at": "2026-10-25T09:12:00.000Z",
    "updated_at": "2026-10-25T09:12:00.000Z"
  }
}

Cancel a charge#

DELETE/recurring_application_charges/{id}.jsonAny token

Cancels one of this app's pending or active charges: it isn't billed after today. Sends app_subscriptions/update.

Request
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/recurring_application_charges/$RECURRING_APPLICATION_CHARGE_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{}