API Reference

➡️ Turn your order into a recurrent order to allow your customer to pick up articles multiple times in regular intervals.

What happened before

✅ The customer was consulted and is happy
✅ The customer either has repeated prescription or wants to pickup articles in regular intervals over the course of time.


Create a recurrent order

The recurrent orders borrows most parameters from its sibling, the (one-time) order.

Let's see a simple comparison of the body parameters.

one-time orderrecurrent order
orderNumber (string)orderNumber (string)
relatedNotes (string)relatedNotes (string)
dosageInformation (string)dosageInformation (string)
sendCustomerPickupMail (boolean)sendCustomerPickupMail (boolean)
customerSelfRegistration (boolean)customerSelfRegistration (boolean)
customerDetails (object)customerDetails (object)
articles (array of objects)
- scanCode (string)
- name (string)
- quantityOrdered (int32)
articles (array of objects)
- scanCode (string)
- name (string)
- quantityOrdered (int32)
- interval (int32) 👈
startDate (date-time) 👈
endDate(date-time) 👈

👉 The recurrent order body extends the one-time order with 3 new parameters.

Body Parameter highlights

ObjectTypeExplanation / Comment
intervalint32The interval in which the customer will be able to pick up the article.

value: between 1 and 99 (days!)
startDatestring, format: date-timeThe startDate of the recurrent order and therefore the start date of the first interval.

ℹ️ The start date must be at least the current day.
endDatestring, format: date-timeThe endDate of the recurrent order and therefore the end of the last interval. After this day, the customer will still be able to pickup the articles of the last iteration.

ℹ️ The end date must be at least one day after the current day.


Example requests

Request URL

https://api.pickup.bd.com/api/v2/recurrentorders


Request

curl --request POST \
     --url https://api.pickup.bd.com/api/v2/recurrentorders \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/*+json' \
     --header 'x-api-key: dev' \
     --data '
{
     "orderNumber": "8e7c4ac1-91e5-4882-a914-05f7fc50e124",
     "relatedNotes": "string",
     "dosageInformation": "string",
     "sendCustomerPickupMail": true,
     "customerSelfRegistration": false,
     "customerDetails": {
          "fullName": "Max Mustermann",
          "address": "Ansbacher Strasse 75",
          "postalCode": "55608",
          "city": "Schneppenbach",
          "country": "Deutschland",
          "phoneNumber": "+49 06544 97 08 25",
          "email": "[email protected]"
     },
     "articles": [
          {
               "scanCode": "5948912001188",
               "name": "Bayer Aspirin 500mg x 8",
               "quantityOrdered": 10,
               "interval": 10
          }
     ],
     "startDate": "2022-01-23T00:00:00",
     "endDate": "2022-03-25T00:00:00"
}
'
POST /api/v2/recurrentorders HTTP/1.1
Accept: application/json
Content-Type: application/*+json
X-Api-Key: dev
Host: api.pickup.bd.com
Content-Length: 579

{"orderNumber":"8e7c4ac1-91e5-4882-a914-05f7fc50e124","relatedNotes":"string","dosageInformation":"string","sendCustomerPickupMail":true,"customerSelfRegistration":false,"customerDetails":{"fullName":"Max Mustermann","address":"Ansbacher Strasse 75","postalCode":"55608","city":"Schneppenbach","country":"Deutschland","phoneNumber":"+49 06544 97 08 25","email":"[email protected]"},"articles":[{"scanCode":"5948912001188","name":"Bayer Aspirin 500mg x 8","quantityOrdered":10,"interval":10}],"startDate":"2022-05-23T00:00:00","endDate":"2022-05-25T00:00:00"}
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/*+json',
    'x-api-key': 'dev'
  },
  body: '{"orderNumber":"8e7c4ac1-91e5-4882-a914-05f7fc50e124","relatedNotes":"string","dosageInformation":"string","sendCustomerPickupMail":true,"customerSelfRegistration":false,"customerDetails":{"fullName":"Max Mustermann","address":"Ansbacher Strasse 75","postalCode":"55608","city":"Schneppenbach","country":"Deutschland","phoneNumber":"+49 06544 97 08 25","email":"[email protected]"},"articles":[{"scanCode":"5948912001188","name":"Bayer Aspirin 500mg x 8","quantityOrdered":10,"interval":10}],"startDate":"2022-05-23T00:00:00","endDate":"2022-05-25T00:00:00"}'
};

fetch('https://api.pickup.bd.com/api/v2/recurrentorders', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

ℹ️

For more example requests jump directly to the endpoint ↗️


Example success response

{
  "articles": [],
  "orderNumber": "34682734827",
  "requestCustomerToFillData": false,
  "relatedNotes": "string",
  "dosageInformation": "string",
  "state": "SCHEDULED",
  "creationDate": "2022-07-10T08:16:42.9293887+00:00",
  "lastUpdateDate": null,
  "pickedUpDate": null,
  "canceledDate": null,
  "firstInputDate": null,
  "isOverdue": false,
  "pickupCode": "customer_F49F00733BE344C993ADBB2A1D48C766",
  "storageCode": "pickup_A5E0EA30B0FB4501816A76DDB2B233D4",
  "cancellationReason": ""
}

📘

We do not send back the articles object.

At the moment, we do not sent back the articles object in the response of a recurrent order. This is planned for a future update to the API though.

The response of the recurrent order matches the response of the one-time order. The only difference is the introduction of a new state which is called scheduled. A recurrent order is scheduled before its preparation date is reached. For more info on this take a look at the recurrent order introduction.

What happens after

❓You chose that we should handle the pickup code handover to the patient?
➡️ You can relax – we do the rest.


❓Don't want to use the order number for getting the pickup order status later on?
➡️ Save the pickup code to retrieve the order status at a later point.

❓Do you want to send the pickup code (e.g. via email) to your patient?
➡️ Convert the pickup code into a scannable QR code.

❓You want to give out the pickup code immediately to the customer?
➡️ Convert the pickup code into a scannable QR code and print it out for your patient.

❓You want to print out a storage label to store the articles in the storage robot?
➡️ Convert the storage code into scannable DataMatrix code and print it on a label which a pharmacist can stick onto the articles to input into the storage robot.
🤓 If the pharmacists needs to check these articles (by hand) before releasing to the patient this has to be mandatory done by the BD Rowa pickup cloud web interface or implemented by you.


Next Step

➡️ Get Pickup Status