Skip to main content

What is RSD?

Overview​

RSD (Drug Track and Trace System) is a national program run by the Saudi Food & Drug Authority (SFDA) that tracks pharmaceutical products across the entire supply chain — from the moment they're manufactured or imported into Saudi Arabia, through every stockholder (manufacturer, importer, distributor, warehouse, pharmacy, hospital), until they reach the patient. Every physical unit of a tracked drug carries a unique combination of GTIN (product code), batch, and serial number, and every stockholder reports their stock movements (receiving, transferring, selling, etc.) to the central RSD system.

The program supports Saudi Vision 2030 by:

  • Monitoring the full supply chain so counterfeit, expired, or recalled medication can be identified and stopped in real time.
  • Producing reliable statistics on which medications/sources are most targeted for counterfeiting.
  • Letting patients check a medication's authenticity and safety via smartphone.
  • Reducing the time needed to get reliable supply-chain data and cutting waste.

(Source: rsd.sfda.gov.sa)

RSD Operations​

Every stock movement reported to RSD is classified as one of the following operations:

#OperationDescription
1AcceptWhen receiving items from another stockholder, you must perform an accept operation.
2TransferIf you are a pharmacy and want to transfer stock to other stockholders.
3DispatchIf you are a warehouse/manufacturer and want to transfer stock to other stockholders.
4Transfer CancelTo cancel an already-done transfer operation, under the condition that the other stockholder did not accept the stock.
5Dispatch CancelTo cancel an already-done dispatch operation, under the condition that the other stockholder did not accept the stock, or if they performed a return operation.
6ReturnTo return an already-accepted operation to the stockholder.
7ImportFor warehouses that register items received from external suppliers and want to add the serials to RSD.
8ExportTo export items outside the country.
9ConsumeFor hospitals, when they dispense medicine to patients.
10SupplyFor manufacturers to add serials to the RSD system.
11DeactivateTo deactivate expired and scrapped products.
12Pharmacy SaleFor a pharmacy selling to a patient/customer.
13Pharmacy Sale CancelIf the customer cancelled the order, a pharmacy sale cancel is performed.

Required Information​

Every operation reported to RSD carries some combination of the following identifiers:

FieldDescription
GTINA unique number identifying a product.
BatchA unique number identifying a manufactured set (lot) of products.
SerialA unique number identifying a specific item. The combination of GTIN + serial must be unique for an item.
ExpiryThe expiration date for the item.
ProductionThe production date for the item. Only required for the Import and Supply operations.
GLNThe Global Location Number of the other stockholder. Required when sending items to, or returning items from, another stockholder.

RSD Response​

Every operation submitted to RSD returns a response describing the result, including:

  • notificationId — a unique number identifying the operation that was performed.
  • response code — a code describing the result of the operation on the item(s). A code of 00000 means the operation was successful; any other code indicates an error or warning.
  • Other information, including the products sent, the operation name, and so on.

The full response schema (including a real example) is documented in the API reference — see RSD Notifications.

Deserialization​

At the end of June 2024, RSD introduced deserialization: the ability to report an operation by batch and quantity instead of by individual serial numbers. Deserialization only applies to operations in the middle of the supply chain — the following operations support it:

  1. Accept
  2. Transfer
  3. Dispatch
  4. Transfer Cancel
  5. Dispatch Cancel
  6. Return

For these operations, instead of listing every individual serial, you can simply report the batch and the quantity moved.

Request Limits​

RSD enforces limits on how much a single request can contain:

  • A maximum of 20 batches and 100,000 units of quantity per request.
  • For the Import and Supply operations, only one batch per request is allowed.

In the Juleb API, these limits are handled automatically in the background — large operations are split into multiple RSD requests behind the scenes, so you don't need to worry about chunking your data to stay within these limits.

How RSD Works in Juleb​

In Juleb, every RSD-reportable operation is triggered by one of two kinds of records: Inventory Pickings or POS Orders.

  • POS Orders handle the Pharmacy Sale, Pharmacy Sale Cancel, and Consume operations.
  • Inventory Pickings handle the rest — each picking type maps to a specific RSD operation, as described below.
  • Operations that require serial-level reporting (i.e. not using deserialization) are scanned using the Juleb Connect app when the stock is sent.
  • Each company has an RSD classification — pharmacy or warehouse/manufacturer — configured when the company is created (stored separately from the company's general settings). This classification decides how Juleb reports a company's outgoing stock movements to RSD: as a transfer (pharmacy) or a dispatch (warehouse/manufacturer).

Operation ↔ Juleb mapping​

RSD OperationWho performs itJuleb trigger
AcceptReceiving stockholderPicking: Receipt
TransferPharmacy-configured company moving stockPicking: Internal Transfer
DispatchWarehouse/manufacturer-configured company moving stockPicking: Internal Transfer or Delivery — warehouses can report a dispatch from either picking type; the company's RSD classification decides the label reported to RSD
Dispatch CancelCancel an unaccepted dispatchPicking: Return Delivery
ReturnReturn an already-accepted operationPicking: Return to Vendor or Return Delivery
ImportWarehouse registers items from an external supplierPicking: Receipt with global_import
ExportSending items outside the countryPicking: Delivery with international_export: true
ConsumeHospital dispensing to a patientPOS Order — same mechanism as Pharmacy Sale
SupplyManufacturer adds brand-new serials to RSDPicking: Receipt with global_import — same mechanism as Import
DeactivateDeactivate expired/scrap stockPicking: Scrap
Pharmacy SalePharmacy sells to a customerPOS Order
Pharmacy Sale CancelCustomer cancels/returns the saleA new POS Order with a negative price (a refund/return order)
Transfer Cancel

Transfer Cancel is not currently triggered through a dedicated Juleb flow.

Creating & Monitoring RSD Operations via the API​

You can create the pickings and POS orders described above — and retrieve their RSD response — entirely through the Juleb API:

On top of the raw RSD integration, Juleb provides several automations so you don't have to manage the RSD protocol's quirks yourself:

  1. RSD limit handling — requests are automatically split to respect RSD's 20-batch / 100,000-quantity limits (and the single-batch limit for Import/Supply), entirely in the background.

  2. Expiry auto-correction — suppliers sometimes register a batch with a different expiry date than what's on the physical product. Juleb detects this and uses the correct expiry date when reporting the operation to RSD.

  3. Automated resend — if RSD times out or is temporarily unavailable, Juleb automatically retries the submission.

  4. Operations dashboard — a dashboard showing all RSD operations and their success percentage, so you can monitor and take action on failures.

    RSD Dashboard

  5. Reporting page — a dedicated page for quickly identifying and fixing failed operations.

    RSD Reporting Page