Skip to main content
POST
/
inventory
/
members
/
update-discount
Update Discount
curl --request POST \
  --url https://api.decodahealth.com/inventory/members/update-discount \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "issuedDiscountId": "<string>",
  "quantity": 123,
  "expiryDate": "2023-11-07T05:31:56Z",
  "comment": "<string>"
}
'
{
  "id": "<string>",
  "memberId": "<string>",
  "membershipDiscountId": "<string>",
  "quantityRemaining": 123,
  "membershipDiscount": {
    "membershipId": "<string>",
    "id": "<string>",
    "itemId": "<string>",
    "itemCategory": "<string>",
    "isPhysical": true,
    "discountPercentage": 123,
    "discountAmount": 123,
    "creditAmount": 123,
    "quantity": 123,
    "rollover": false,
    "rolloverExpiryDays": 123,
    "neverExpire": false,
    "group": "<string>",
    "isArchived": false,
    "item": {
      "name": "<string>",
      "price": 123,
      "id": "<string>",
      "brandName": "<string>",
      "description": "<string>",
      "category": "<string>",
      "unit": "AMPOULES",
      "isPhysical": true,
      "isArchived": false,
      "internalNotes": "<string>",
      "taxable": false,
      "sortOrder": 123,
      "allowCustomPricing": false,
      "type": "PRODUCT"
    }
  },
  "expiryDate": "2023-11-07T05:31:56Z",
  "usageCount": 0,
  "createdDate": "2023-11-07T05:31:56Z",
  "updatedDate": "2023-11-07T05:31:56Z",
  "items": [
    {
      "chargeId": "<string>",
      "quantity": 123,
      "price": 123,
      "id": "<string>",
      "itemId": "<string>",
      "name": "<string>",
      "description": "<string>",
      "discountAmount": 123,
      "discountPercentage": 123,
      "discountReason": "<string>",
      "soldPackageId": "<string>",
      "bankedQuantity": 123,
      "bankedItemId": "<string>",
      "issuedDiscountId": "<string>",
      "soldByProviderId": "<string>",
      "taxAmount": 123,
      "pricingId": "<string>",
      "shipmentIds": [
        "<string>"
      ]
    }
  ],
  "packages": [
    {
      "packageId": "<string>",
      "patientId": "<string>",
      "chargeItemId": "<string>",
      "status": "USED",
      "createdDate": "2023-11-07T05:31:56Z",
      "id": "<string>",
      "package": {
        "name": "<string>",
        "price": 123,
        "id": "<string>",
        "description": "<string>",
        "isArchived": false,
        "internalNotes": "<string>",
        "items": [
          {
            "packageId": "<string>",
            "itemId": "<string>",
            "price": 123,
            "id": "<string>",
            "quantity": 123,
            "item": {
              "name": "<string>",
              "price": 123,
              "id": "<string>",
              "brandName": "<string>",
              "description": "<string>",
              "category": "<string>",
              "unit": "AMPOULES",
              "isPhysical": true,
              "isArchived": false,
              "internalNotes": "<string>",
              "taxable": false,
              "sortOrder": 123,
              "allowCustomPricing": false,
              "type": "PRODUCT"
            }
          }
        ],
        "category": "<string>"
      },
      "updatedDate": "2023-11-07T05:31:56Z"
    }
  ]
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json
issuedDiscountId
string
required

ID of the membership discount bank to update

quantity
integer | null

New quantity for the discount

expiryDate
string<date-time> | null

New expiry date for the discount

comment
string | null

Comment explaining the discount update

Response

Successful Response

id
string
required

Unique identifier for the discount bank entry

memberId
string
required

ID of the member

membershipDiscountId
string
required

ID of the membership discount

quantityRemaining
integer
required

Quantity remaining in the bank

membershipDiscount
MembershipDiscountDetail · object
required

Details of the membership discount

expiryDate
string<date-time> | null

When this bank entry expires

usageCount
integer
default:0

Number of times this discount has been used

createdDate
string<date-time> | null

When the bank entry was created

updatedDate
string<date-time> | null

When the bank entry was last updated

items
ChargeItem · object[] | null

Items that have been used from this bank entry

packages
SoldPackage · object[] | null

Packages that have been used from this bank entry