Receipts

A service which allows to manage user receipts. All Receipts endpoints have path prefix /receipts-service.

Get receipt

Get user receipt list.

GET /receipts-service/user/receipt
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
chunk_id string Chunk Id
Example Response
{
    "receipts": [
        {
            "accuracy": "14,4549999237061",
            "client_ip": "127.0.0.1",
            "latitude": "-37838100",
            "location_name": "Super store location",
            "longitude": "144974760",
            "receipt": [
                "https://dev-cdn.shping.com/2019/1/28/5efe62a4-db8c-47ab-94ea-3f43e8cd62e7.jpg"
            ],
            "receipt_id": "90c30fd6-0fd4-4161-aec4-6b8370525472",
            "store_id": "Super store id",
            "ts": "2019-06-11T20:25:14.703Z"
        }
    ],
    "next": "urn:authenticateit:receipts_chunk:7501d972-fe16-42ea-974b-a9d484fa3dae"
}

Add new receipt

Add new user receipt information.

POST /receipts-service/user/receipt
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
accuracy string Required: Accuracy
longitude string Required: Longitude
latitude string Required: Latitude
receipt array Required: Array of images links
store_id string Required: Store ID
location_name string Required: Store name
country_iso string Country ISO code
Example body
{
    "accuracy": "14,4549999237061",
    "longitude": "144974757",
    "latitude": "-37838094",
    "receipt": [
        "https://dev-cdn.shping.com/2019/1/28/5efe62a4-db8c-47ab-94ea-3f43e8cd62e7.jpg"
    ],
    "store_id": "53ehdb5e67e67",
    "location_name": "Store name",
    "country_iso": "036"
}
Example Response
{
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}

Delete receipt

Delete user receipt.

DELETE /receipts-service/user/receipt/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string user receipt id (guid)
Example Response
{
    "result": "ok"
}

List receipt groups

Get user receipt groups.

GET /receipts-service/user/groups
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "result": [
    {
      "name": "!Need attention",
      "type": "need_attention",
      "image": null,
      "count": 1
    },
    {
      "retailer_id": "coles",
      "name": "coles",
      "type": "retailer",
      "image": "https://dev-cdn.shping.com/2022/1/25/0fedebb2-6542-450d-ab40-dba37f6a59fd.png",
      "count": 1
    },
    {
      "name": "Other",
      "type": "other",
      "image": null,
      "count": 113
    }
  ],
  "total": 115
}

List actions

Get user actions

GET /receipts-service/user/actions
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
action query Optional: (String) Actions type

Action types = ['need_attention']

Example request

```http request GET 'receipts-service/user/actions?action=need_attention'


##### Example Response
```json
{
  "set_retailers": 0,
  "set_products": 1,
  "total": 1
}

Search receipts

POST /receipts-service/user/search
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
search_query body Optional: (String)
status body Optional: (List) Enum
retailer body Optional: (String) * is for all even not supported retailers
page body Optional: (Int) default 0
page_size body Optional: (Int) default 10

Statuses:

  • INITIAL,
  • SET_RETAILERS,
  • SET_RETAILERS_PENDING,
  • SET_PRODUCTS,
  • SET_PRODUCTS_PENDING, COMPLETED,
  • FAILED,
  • UNRECOGNIZED
Example request body
{
    "search_query": "Health &",
    "retailer": "coles"
}
Example Response
{
  "receipts": [
    {
      "id": "14a0131d-3375-428e-b46a-db702ce3d953",
      "images": [
        "https://dev-cdn.shping.com/2022/3/11/c0695af7-0b15-4108-a880-7d317a8ee54b.jpg"
      ],
      "ts": "2022-03-11T04:27:57.003Z",
      "updated_at": "2022-03-11T04:29:40.000Z",
      "status": "FAILED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 410000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 41220000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 410000000000000000
    },
    {
      "id": "95bd278a-b4b6-4659-9885-dcbd5b16105d",
      "images": [
        "https://dev-cdn.shping.com/2022/3/11/aa821a2f-04da-4095-9ffc-a66a2b76c1fa.jpg"
      ],
      "ts": "2022-03-11T03:44:56.399Z",
      "updated_at": "2022-03-11T04:25:00.000Z",
      "status": "FAILED",
      "retailer_id": "coles",
      "retailer_name": "Import participant Coles",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 410000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 41270000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 410000000000000000
    },
    {
      "id": "2abb7c58-f780-431a-81d6-84b4de97c74d",
      "images": [
        "https://dev-cdn.shping.com/2022/3/10/2ba96e24-4409-4144-95fd-e4e9c40e4a23.jpg"
      ],
      "ts": "2022-03-10T22:26:13.279Z",
      "updated_at": "2022-03-11T03:35:11.000Z",
      "status": "UNRECOGNIZED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 400000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 40220000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 400000000000000000
    },
    {
      "id": "fc636193-6a57-4ac9-85b6-df2caf0e76b1",
      "images": [
        "https://dev-cdn.shping.com/2022/3/9/42204e0d-f645-42f5-a94f-f0623f86bedf.jpg"
      ],
      "ts": "2022-03-09T00:03:01.158Z",
      "updated_at": "2022-03-11T03:43:31.000Z",
      "status": "UNRECOGNIZED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 420000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 42760000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 420000000000000000
    },
    {
      "id": "93b31056-e520-4186-8d2c-aebd28ef9dc0",
      "images": [
        "https://dev-cdn.shping.com/2022/2/4/22aa2cb5-e611-40b8-9d5b-ca79f6a932f4.jpg",
        "https://dev-cdn.shping.com/2022/2/4/78bf3ad2-ebf1-45f1-b385-52f0d5f179be.jpg",
        "https://dev-cdn.shping.com/2022/2/4/2e250222-39c3-4c08-9277-efd56bd31949.jpg"
      ],
      "ts": "2022-02-04T09:09:54.994Z",
      "updated_at": "2022-02-28T23:07:40.000Z",
      "status": "FAILED",
      "country": "051",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 350000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 35720000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 350000000000000000
    },
    {
      "id": "fc118357-2d89-4b6a-aed7-e3d454aa8d51",
      "images": [
        "https://dev-cdn.shping.com/2022/2/4/f37c2d81-ddf3-4f0e-87a4-7caf527bc77d.jpg"
      ],
      "ts": "2022-02-04T08:05:38.431Z",
      "updated_at": "2022-02-04T08:07:40.000Z",
      "status": "FAILED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 360000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 36090000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 360000000000000000
    },
    {
      "id": "955b3ea4-720b-43fb-955c-408880534e93",
      "images": [
        "https://dev-cdn.shping.com/2022/2/4/18e6a29d-31e4-4345-af45-e4407368a266.jpg"
      ],
      "ts": "2022-02-04T07:59:21.815Z",
      "updated_at": "2022-02-04T08:01:10.000Z",
      "status": "FAILED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 360000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 36180000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 360000000000000000
    },
    {
      "id": "9777b490-b6c4-401a-ba20-7139d7627517",
      "images": [
        "https://dev-cdn.shping.com/2022/2/4/e2e73786-3726-4529-b864-319d9a023825.jpg"
      ],
      "ts": "2022-02-04T07:49:43.049Z",
      "updated_at": "2022-02-04T07:51:30.000Z",
      "status": "FAILED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 360000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 36180000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 360000000000000000
    },
    {
      "id": "316196a8-9f77-43d9-9645-4ac68dedabef",
      "images": [
        "https://dev-cdn.shping.com/2022/2/4/43a12015-2feb-4c79-8ce3-dcafe52350ec.jpg"
      ],
      "ts": "2022-02-04T07:30:06.469Z",
      "updated_at": "2022-02-04T07:32:10.000Z",
      "status": "FAILED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 360000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 36360000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 360000000000000000
    },
    {
      "id": "58809364-8fea-49f1-b2c5-1cb518f7f3cc",
      "images": [
        "https://dev-cdn.shping.com/2022/2/4/3134111a-0e16-48ab-8be7-ea8a7cff1725.jpg"
      ],
      "ts": "2022-02-04T07:19:30.892Z",
      "updated_at": "2022-02-04T07:21:10.000Z",
      "status": "FAILED",
      "country": "036",
      "ocr_done": 1,
      "recognized_items": 0,
      "unrecognized_items": 0,
      "non_partner_brand_product_coins": 360000000000000000,
      "non_partner_brand_product_coins_earned": 0,
      "partner_brand_product_coins": 36360000000000000000,
      "partner_brand_product_coins_earned": 0,
      "pending_coins": 360000000000000000
    }
  ],
  "total": 132
}

List retailer receipts

POST /receipts-service/retailer/:retailer_id/list
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
retailer_id params Required: Retailer id
user_id body Optional: User id filter
receipt_code body Optional: Receipt unique number (field printed on receipt)
receipt_uploaded_ts_from body Optional: upload date
receipt_uploaded_ts_from body Optional:
receipt_ts_from body Optional: timestamp printed on receipt
receipt_ts_to body Optional:
status body Optional: Array of statuses
gtin body Optional: Gtin of recognised products on receipt
total_from body Optional:
total_to body Optional:
page body Optional: default 0
page_size body Optional: default 10
sort_by body Optional: Object field, order

User have to be system Statuses:

  • INITIAL,
  • SET_RETAILERS,
  • SET_RETAILERS_PENDING,
  • SET_PRODUCTS,
  • SET_PRODUCTS_PENDING,
  • COMPLETED,
  • FAILED,
  • UNRECOGNIZED,
  • HIDDEN Sort by fields
  • issued_at (date on receipt)
  • ts (upload date)
  • receipt_code
  • status
  • total
  • user_id Order
  • ASC
  • DESC
Example request body
{
  "receipt_code": "n1",
  "page_size": 2,
  "sort_by": {
    "field": "status",
    "order": "DESC"
  }
}
Example Response
{
  "total": 203,
  "receipts": [
    {
      "id": "urn:authenticateit:user:email:email@mailinator.com@3a7a4c1b-0afe-40cd-b3aa-e0552bd7b9b2",
      "image": [
        "https://dev-cdn.shping.com/2022/1/15/86025595-5781-4994-91e1-f9eebcf31892"
      ],
      "issued_at": "2019-10-25T00:00:00Z",
      "uploaded_at": "2022-01-15T13:18:23.547Z",
      "products": 0,
      "recognised": 0,
      "receipt": "n1",
      "status": "HIDDEN",
      "retailer": "coles",
      "total": "999909",
      "user": "urn:authenticateit:user:email:mail@mail.com"
    },
    {
      "id": "urn:authenticateit:user:email:mail@mail.com@48c118ac-34bf-46a9-b380-ba2e9f7dbb3d",
      "image": [
        "https://dev-cdn.shping.com/2022/4/26/4f68ad24-2a56-497b-ae96-416ba71e9a7b.jpg"
      ],
      "issued_at": "2019-10-25T00:00:00Z",
      "uploaded_at": "2022-04-26T06:41:03.959Z",
      "products": 0,
      "recognised": 0,
      "receipt": "n1",
      "status": "HIDDEN",
      "retailer": "coles",
      "total": "9999.09",
      "user": "urn:authenticateit:user:email:mail@mail.com"
    }
  ]
}

Get retailer receipt

POST /receipts-service/retailer/:retailer_id/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
retailer_id params Required: Retailer id
id params Optional: receipt id

User have to be system

Example Response
{
  "analyzed": {
    "analyzed_receipt": {
      "accuracy_rate": 0.8093153238296509,
      "barcode": "5541017680441",
      "data": {
        "computed_total": "5.99",
        "links": [
          "https://i.imgur.com/c8O0Be6.jpg"
        ],
        "prices": [
          {
            "gtin": "9311995843710",
            "name": "A4 COPY PAPER 500 SHEETS",
            "price": 5.99,
            "quantity": 1,
            "unit": "each",
            "value": 5.99
          }
        ],
        "store": "rejectshop",
        "tax": "0.54",
        "total": "5.99",
        "ts": "2022-09-15T05:52:46.223Z"
      },
      "id": "urn:authenticateit:user:email:email@mail.com@analyzed_receipts@ae115e12-4033-463f-a180-3287c08781af",
      "merch_id": null,
      "ocr_hash": "2df10655f8b4941bd55a156881d19a09d75983bd",
      "parsed_receipt_id": "7250lane 131082022",
      "postcode": "7250",
      "receipt_barcode": "7713019112390",
      "receipt_code": "7250lane 131082022",
      "receipt_date": "31/08/2022",
      "receipt_id": "ae115e12-4033-463f-a180-3287c08781af",
      "receipt_number": "7250lane 131082022",
      "receipt_time": "10:55:08",
      "receipt_ts": "2022-08-31T10:55:08Z",
      "receipt_ts_utc": "2022-08-31T00:55:08Z",
      "retailer": "rejectshop",
      "retailer_store_id": "7250",
      "status": "completed",
      "term_id": "lane 1",
      "ts": "2022-09-15T05:52:46.223Z",
      "user_id": "urn:authenticateit:user:email:email@mail.com",
      "words_count": 149
    },
    "chunk_id": "urn:authenticateit:user:email:email@mail.com@receipts",
    "limits": {
      "from_ts": "2022-09-14T22:00:00Z",
      "limit_coins": "0",
      "sum_coins": "0",
      "to_ts": "2022-09-15T21:59:59Z"
    },
    "non_partner_brand_product_coins": 550000000000000000,
    "non_partner_brand_product_coins_earned": 0,
    "partner_brand_product_coins": 55040000000000000000,
    "partner_brand_product_coins_earned": 0,
    "pending_coins": "550000000000000000",
    "receipt": {
      "accuracy": "14,4549999237061",
      "client_ip": "10.0.0.5",
      "country_iso": "036",
      "hash": "2df10655f8b4941bd55a156881d19a09d75983bd",
      "issued_at": "2020-12-08T00:00:00Z",
      "latitude": "-37838094",
      "location_name": "Store name",
      "longitude": "144974757",
      "ocr_done": true,
      "ocr_status": "success",
      "postcode": null,
      "receipt": [
        "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/ReceiptSwiss.jpg/250px-ReceiptSwiss.jpg"
      ],
      "receipt_code": null,
      "receipt_id": "ae115e12-4033-463f-a180-3287c08781af",
      "retailer_id": "woolworths",
      "retailer_name": "Woolworths",
      "status": 7,
      "store_id": "2566",
      "tax": null,
      "total": 0,
      "ts": "2022-05-24T18:35:11.490Z",
      "updated_at": "2022-08-02T00:03:00Z"
    }
  },
  "ocr": {}
}

results matching ""

    No results matching ""