Skip to content

Market routes: update, delete

The Market Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for Market, one group of Market routes.

Market.update

Changes the given properties of a Market. Verb page.

Text
PATCH /{namespace}/markets/{id}

Path: id. Body, as JSON: the other inputs. Emits Market.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Market.
countriesstring[]ISO 3166-1 alpha-2 country codes.
currencystringThe ISO 4217 currency Prices show in.
localesstring[]BCP 47 locale tags, the default first.

Returns

OutputTypeRequiredDescription
marketMarketrequiredThe Market.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X PATCH https://api.sb/leaseline.app/markets/market_4uFEzN14G4 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"currency":"USD"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "market": {
    "$id": "https://api.sb/leaseline.app/markets/market_4uFEzN14G4",
    "$type": "Market",
    "countries": [
      "Example countries"
    ],
    "currency": "USD",
    "locales": [
      "Example locales"
    ]
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Market.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Market.delete

Deletes a Market: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/markets/{id}

Path: id. Emits Market.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Market.

Returns

OutputTypeRequiredDescription
marketMarketrequiredThe Market.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X DELETE https://api.sb/leaseline.app/markets/market_4uFEzN14G4 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "market": {
    "$id": "https://api.sb/leaseline.app/markets/market_4uFEzN14G4",
    "$type": "Market",
    "countries": [
      "Example countries"
    ],
    "currency": "USD",
    "locales": [
      "Example locales"
    ]
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Market.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}