Configured system

stock-management

Stock Management mock. TMF687 v4 product stock check, reservation and adjustment.

stock-management.tmfmock.com

Aliases stock tmf687

Database-configured Runtime-routed Contract-shaped
5active endpoints
20bound paths
2configured aliases
DBlive configuration
Endpoint index

Endpoints on the wire

Loaded from the same database configuration used to dispatch mock requests.

MethodPrimary routeEndpointStatus
POST stock-management.tmfmock.com/checkProductStock check-product-stock 201
GET stock-management.tmfmock.com/checkProductStock/:checkProductStockId retrieve-product-stock-check 200
POST stock-management.tmfmock.com/reserveProductStock reserve-product-stock 201
GET stock-management.tmfmock.com/reserveProductStock/:reserveProductStockId retrieve-product-stock-reservation 200
POST stock-management.tmfmock.com/adjustProductStock adjust-product-stock 201
Live configuration

Endpoints and bound rules

Every active method, path, request condition, and response formula currently bound to this system.

Endpoint 01

check-product-stock

TMF687 v4 createCheckProductStock. Returns a completed, schema-valid stock-availability check with available quantity.

Status
201
Priority
0
Paths
4

Bound paths

  • POST stock-management.tmfmock.com/checkProductStock
  • POST stock-management.tmfmock.com/tmf687/createCheckProductStock
  • POST stock-management.tmfmock.com/tmf-api/stockManagement/v4/checkProductStock
  • POST stock-management.tmfmock.com/tmf-api/stock/v4/checkProductStock

Request conditions

Default

Every request matching a bound method and path uses this rule.

Bound response rule

JSON formula
{
  "body": {
    "id": {
      "$var": "checkId"
    },
    "href": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/checkProductStock/",
        {
          "$var": "checkId"
        }
      ]
    },
    "@type": "CheckProductStock",
    "state": "done",
    "description": "Mock stock availability check",
    "checkProductStockItem": [
      {
        "id": "1",
        "@type": "CheckProductStockItem",
        "product": {
          "id": {
            "$var": "sku"
          },
          "@type": "ProductRefOrValue"
        },
        "requestedQuantity": {
          "units": "ea",
          "amount": 1
        },
        "checkedProductStock": {
          "id": {
            "$var": "sku"
          },
          "@type": "ProductStock",
          "stockedProduct": {
            "id": {
              "$var": "sku"
            },
            "@type": "ProductRefOrValue"
          },
          "productStockLevel": {
            "@type": "ProductStockLevel",
            "stockLevel": "available",
            "availableQuantity": {
              "units": "ea",
              "amount": 25
            }
          }
        }
      }
    ]
  },
  "status": 201,
  "headers": {
    "Location": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/checkProductStock/",
        {
          "$var": "checkId"
        }
      ]
    },
    "Content-Type": "application/json; charset=utf-8"
  },
  "variables": {
    "sku": {
      "$request": {
        "path": "body.checkProductStockItem.0.product.id",
        "default": "MOCK-SKU"
      }
    },
    "checkId": {
      "$request": {
        "path": "headers.idempotency-key",
        "default": {
          "$random": "uuid"
        }
      }
    }
  }
}

Endpoint 02

retrieve-product-stock-check

TMF687 v4 retrieveCheckProductStock. Returns the asynchronous stock check identified by the path id.

Status
200
Priority
0
Paths
4

Bound paths

  • GET stock-management.tmfmock.com/checkProductStock/:checkProductStockId
  • GET stock-management.tmfmock.com/tmf687/retrieveCheckProductStock/:checkProductStockId
  • GET stock-management.tmfmock.com/tmf-api/stockManagement/v4/checkProductStock/:checkProductStockId
  • GET stock-management.tmfmock.com/tmf-api/stock/v4/checkProductStock/:checkProductStockId

Request conditions

Default

Every request matching a bound method and path uses this rule.

Bound response rule

JSON formula
{
  "body": {
    "id": {
      "$var": "checkId"
    },
    "href": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/checkProductStock/",
        {
          "$var": "checkId"
        }
      ]
    },
    "@type": "CheckProductStock",
    "state": "done",
    "description": "Mock stock availability check",
    "checkProductStockItem": [
      {
        "id": "1",
        "@type": "CheckProductStockItem",
        "product": {
          "id": "MOCK-SKU",
          "@type": "ProductRefOrValue"
        },
        "requestedQuantity": {
          "units": "ea",
          "amount": 1
        },
        "checkedProductStock": {
          "id": "MOCK-SKU",
          "@type": "ProductStock",
          "stockedProduct": {
            "id": "MOCK-SKU",
            "@type": "ProductRefOrValue"
          },
          "productStockLevel": {
            "@type": "ProductStockLevel",
            "stockLevel": "available",
            "availableQuantity": {
              "units": "ea",
              "amount": 25
            }
          }
        }
      }
    ]
  },
  "status": 200,
  "headers": {
    "Content-Type": "application/json; charset=utf-8"
  },
  "variables": {
    "checkId": {
      "$request": {
        "path": "params.checkProductStockId",
        "default": "mock-stock-check"
      }
    }
  }
}

Endpoint 03

reserve-product-stock

TMF687 v4 createReserveProductStock. Reserves SIM or device stock and returns a schema-valid reservation in state reserved.

Status
201
Priority
0
Paths
4

Bound paths

  • POST stock-management.tmfmock.com/reserveProductStock
  • POST stock-management.tmfmock.com/tmf687/createReserveProductStock
  • POST stock-management.tmfmock.com/tmf-api/stockManagement/v4/reserveProductStock
  • POST stock-management.tmfmock.com/tmf-api/stock/v4/reserveProductStock

Request conditions

Default

Every request matching a bound method and path uses this rule.

Bound response rule

JSON formula
{
  "body": {
    "id": {
      "$var": "reservationId"
    },
    "href": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/reserveProductStock/",
        {
          "$var": "reservationId"
        }
      ]
    },
    "@type": "ReserveProductStock",
    "state": "reserved",
    "description": "Mock stock reservation",
    "reserveProductStockItem": [
      {
        "id": "1",
        "@type": "ReserveProductStockItem",
        "quantityReserved": {
          "units": "ea",
          "amount": 1
        },
        "requestedProduct": {
          "id": {
            "$request": {
              "path": "body.reserveProductStockItem.0.requestedProduct.id",
              "default": "MOCK-SKU"
            }
          },
          "@type": "ProductRefOrValue"
        },
        "quantityRequested": {
          "units": "ea",
          "amount": 1
        }
      }
    ]
  },
  "status": 201,
  "headers": {
    "Location": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/reserveProductStock/",
        {
          "$var": "reservationId"
        }
      ]
    },
    "Content-Type": "application/json; charset=utf-8"
  },
  "variables": {
    "reservationId": {
      "$request": {
        "path": "headers.idempotency-key",
        "default": {
          "$random": "uuid"
        }
      }
    }
  }
}

Endpoint 04

retrieve-product-stock-reservation

TMF687 v4 retrieveReserveProductStock. Returns the stock reservation identified by the path id.

Status
200
Priority
0
Paths
4

Bound paths

  • GET stock-management.tmfmock.com/reserveProductStock/:reserveProductStockId
  • GET stock-management.tmfmock.com/tmf687/retrieveReserveProductStock/:reserveProductStockId
  • GET stock-management.tmfmock.com/tmf-api/stockManagement/v4/reserveProductStock/:reserveProductStockId
  • GET stock-management.tmfmock.com/tmf-api/stock/v4/reserveProductStock/:reserveProductStockId

Request conditions

Default

Every request matching a bound method and path uses this rule.

Bound response rule

JSON formula
{
  "body": {
    "id": {
      "$var": "reservationId"
    },
    "href": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/reserveProductStock/",
        {
          "$var": "reservationId"
        }
      ]
    },
    "@type": "ReserveProductStock",
    "state": "reserved",
    "description": "Mock stock reservation",
    "reserveProductStockItem": [
      {
        "id": "1",
        "@type": "ReserveProductStockItem",
        "quantityReserved": {
          "units": "ea",
          "amount": 1
        },
        "requestedProduct": {
          "id": "MOCK-SKU",
          "@type": "ProductRefOrValue"
        },
        "quantityRequested": {
          "units": "ea",
          "amount": 1
        }
      }
    ]
  },
  "status": 200,
  "headers": {
    "Content-Type": "application/json; charset=utf-8"
  },
  "variables": {
    "reservationId": {
      "$request": {
        "path": "params.reserveProductStockId",
        "default": "mock-stock-reservation"
      }
    }
  }
}

Endpoint 05

adjust-product-stock

TMF687 v4 createAdjustProductStock. Consumes or restores stock and returns a schema-valid completed adjustment.

Status
201
Priority
0
Paths
4

Bound paths

  • POST stock-management.tmfmock.com/adjustProductStock
  • POST stock-management.tmfmock.com/tmf687/createAdjustProductStock
  • POST stock-management.tmfmock.com/tmf-api/stockManagement/v4/adjustProductStock
  • POST stock-management.tmfmock.com/tmf-api/stock/v4/adjustProductStock

Request conditions

Default

Every request matching a bound method and path uses this rule.

Bound response rule

JSON formula
{
  "body": {
    "id": {
      "$var": "adjustmentId"
    },
    "href": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/adjustProductStock/",
        {
          "$var": "adjustmentId"
        }
      ]
    },
    "@type": "AdjustProductStock",
    "state": "done",
    "description": "Mock stock adjustment",
    "adjustProductStockItem": [
      {
        "id": "1",
        "@type": "AdjustProductStockItem",
        "productStockTarget": {
          "id": {
            "$var": "sku"
          },
          "@type": "ProductStock",
          "stockedProduct": {
            "id": {
              "$var": "sku"
            },
            "@type": "ProductRefOrValue"
          },
          "productStockLevel": {
            "@type": "ProductStockLevel",
            "stockLevel": "available",
            "availableQuantity": {
              "units": "ea",
              "amount": 24
            }
          }
        },
        "adjustProductStockQuantity": {
          "units": "ea",
          "amount": {
            "$var": "qty"
          }
        }
      }
    ]
  },
  "status": 201,
  "headers": {
    "Location": {
      "$concat": [
        {
          "$request": "origin"
        },
        "/adjustProductStock/",
        {
          "$var": "adjustmentId"
        }
      ]
    },
    "Content-Type": "application/json; charset=utf-8"
  },
  "variables": {
    "qty": {
      "$request": {
        "path": "body.adjustProductStockItem.0.adjustProductStockQuantity.amount",
        "type": "integer",
        "default": 1
      }
    },
    "sku": {
      "$request": {
        "path": "body.adjustProductStockItem.0.productStockTarget.stockedProduct.id",
        "default": "MOCK-SKU"
      }
    },
    "adjustmentId": {
      "$request": {
        "path": "headers.idempotency-key",
        "default": {
          "$random": "uuid"
        }
      }
    }
  }
}
Incoming traffic

Requests and responses

Waiting for traffic

No requests captured yet.