App

User

Get profile

Retrieve user profile

Example request
GET /app/profile HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOiJUZXN0IiwibGFzdE5hbWUiOiJUZXN0Iiwic3ViIjoiMSIsInBob25lIjoiKzcoMDAwKTEyMy00Ni02NyIsImRpc2NvbnRvVG9rZW4iOm51bGwsImlkIjoxLCJleHAiOjE2NDA1MjE2MjYsImVtYWlsIjoiZW1haWwxQGdtYWlsLmNvbSJ9.N15yfPj5lKAMihitBaPfUqk29SHJySvXIWlNO8JlTC-z4BsnlLdtSoC9M-5pOnTB328GmM8hVmJuycCHqtxxtw
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 464

{
  "id" : 1,
  "phone" : "+7(000)123-46-67",
  "email" : "email1@gmail.com",
  "email_verified" : "1",
  "first_name" : "Test",
  "last_name" : "Test",
  "city_id" : "9",
  "points" : "220",
  "banned" : "0",
  "banned_verified" : "0",
  "last_visit" : "2016-08-12 10:01:25",
  "city" : {
    "id" : 9,
    "title" : "Москва"
  },
  "social_accounts" : [ ],
  "verifications" : [ ],
  "city_name" : "Москва",
  "balance" : 220,
  "UID" : "QWEqwe123"
}

Sign in

You can pass either 'email' or 'phone', or sign in with social account

Request fields
Path Type Description

email

String

Email

phone

String

Phone number

password

String

Password

soc_id

String

Social ID of User.

soc_type

String

Social type of User.

Allowed values: "vk", "ok", "fb"

soc_meta

String

Information about User from social network.

token

String

Token from user’s device.

soc_id

String

Social ID of User.

Example request
POST /app/login HTTP/1.1
Content-Type: application/json
Host: localhost:8080
Content-Length: 57

{
  "email" : "email1@gmail.com",
  "password" : "1234"
}
Response fields
Path Type Description

token

String

JWT

data

Object

Disconto profile info

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 841

{
  "data" : {
    "id" : 1,
    "phone" : "+7(000)123-46-67",
    "email" : "email1@gmail.com",
    "email_verified" : "1",
    "first_name" : "Test",
    "last_name" : "Test",
    "city_id" : "9",
    "points" : "220",
    "banned" : "0",
    "banned_verified" : "0",
    "last_visit" : "2016-08-12 10:01:25",
    "city" : {
      "id" : 9,
      "title" : "Москва"
    },
    "social_accounts" : [ ],
    "verifications" : [ ],
    "city_name" : "Москва",
    "balance" : 220,
    "UID" : "QWEqwe123"
  },
  "token" : "eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOiJUZXN0IiwibGFzdE5hbWUiOiJUZXN0Iiwic3ViIjoiMSIsInBob25lIjoiKzcoMDAwKTEyMy00Ni02NyIsImRpc2NvbnRvVG9rZW4iOm51bGwsImlkIjoxLCJleHAiOjE2NDA1MjE2MjYsImVtYWlsIjoiZW1haWwxQGdtYWlsLmNvbSJ9.N15yfPj5lKAMihitBaPfUqk29SHJySvXIWlNO8JlTC-z4BsnlLdtSoC9M-5pOnTB328GmM8hVmJuycCHqtxxtw"
}

Counters

Retrieve count of receipts available for processing

Example request
GET /app/receipts/count HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Response fields
Path Type Description

count

Number

Count of available for processing receipts

Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 17

{
  "count" : 0
}

Processed by user count

Example request
GET /app/history/count HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Response fields
Path Type Description

count

Number

Number of receipts, processed by current user

Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNiwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.3WhhNo6hXxlWUbUA0g1xuBm04S2lAVQ9_mbvpQmTJp1q36Fh4EqCA65N-DYZp_GKbz3xcR2wf9PqXXj0wwoAIA
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 17

{
  "count" : 2
}

History

Retrieve single history item by id

Path parameters
Table 1. /app/history/{historyId}
Parameter Description

historyId

Id of the history

Example request
GET /app/history/1 HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Response fields
Path Type Description

checkedStatus

Number

Status of review(1-accepted, 2-rejected, 3-filled)

rejectStatus

Null

If file was rejected, rejectStatus contains title - reason of rejection

rejectStatusId

Null

Id of reject-status

createdAt

Number

Date of history-creation

forced

Null

True if it was forced review

updatedAt

Number

Date of history-update

points

Number

Points, that user received for receipt-review

id

Number

Id of the history

receiptId

Number

Id of reviewed receipt

reviewResults

String

Review-results

userId

Number

Id of the reviewer

photos

Array

Photos(links)

Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNiwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.3WhhNo6hXxlWUbUA0g1xuBm04S2lAVQ9_mbvpQmTJp1q36Fh4EqCA65N-DYZp_GKbz3xcR2wf9PqXXj0wwoAIA
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 2428

{
  "id" : 1,
  "userId" : 10,
  "receiptId" : 3,
  "checkedStatus" : 1,
  "reviewResults" : "{\"id\":3,\"rejected\":false,\"rejectedQuestionKey\":null,\"questionAnswers\":[{\"key\":\"receipt\",\"body\":\"Это чек?\",\"batch\":1,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"readable\",\"body\":\"Информация на чеке читаема?\",\"batch\":2,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"modification\",\"body\":\"В чеке подрисованы/перерисованы цифры или названия товаров?\",\"batch\":3,\"booleanAnswer\":false,\"filledInfo\":null},{\"key\":\"one_photo\",\"body\":\"На фото один чек?\",\"batch\":4,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"photo\",\"body\":\"Чек сфотографирован полностью?\",\"batch\":5,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"brands\",\"body\":\"В чеке есть продукция Dior/Pepsi?\",\"batch\":6,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"productCount\",\"body\":\"Количество товара не меньше указанного?\",\"batch\":8,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"cities\",\"body\":\"Чек из города Moscow/Saint Petersburg?\",\"batch\":9,\"booleanAnswer\":true,\"filledInfo\":null},{\"key\":\"receipt-type\",\"body\":\"Укажите тип чека\",\"batch\":10,\"booleanAnswer\":null,\"filledInfo\":{\"answer\":\"qr\"}},{\"key\":\"products\",\"body\":\"Укажите количество товаров\",\"batch\":11,\"booleanAnswer\":null,\"filledInfo\":{\"counts\":[{\"name\":\"product1\",\"count\":1,\"id\":8}]}},{\"key\":\"products_with_count_and_subtotals\",\"body\":\"Укажите количество и суммарную цену товаров\",\"batch\":12,\"booleanAnswer\":null,\"filledInfo\":{\"counts_and_subtotals\":[{\"name\":\"Ketchup Torchyn Lahidnyi\",\"count\":3,\"id\":4,\"subtotal\":39.71}]}}],\"receiptDate\":\"22.11.2016\",\"receiptTime\":\"09:00\",\"receiptNumber\":null,\"sum\":30,\"coins\":35,\"eklz\":null,\"kpkCode\":null,\"kpkValue\":null,\"inn\":null,\"fn\":\"8712000101133561\",\"fd\":\"175152\",\"fpd\":\"738084474\"}",
  "rejectStatusId" : null,
  "forced" : null,
  "points" : 1.2,
  "createdAt" : 1.640348826015E9,
  "updatedAt" : 1.640348826015E9,
  "rejectStatus" : null,
  "photos" : [ "https://cdn.apmcheck.ru/" ]
}

Retrieve history

Request parameters
Parameter Description

page

Number of page. Optional. Default is 0;

size

Size of page. Optional. Default is 10.

sort

Field of receipt, by which you want to sort elements and direction, separated by coma (Example: sort='createdAt,desc'). Optional. Default is: by field 'createdAt', direction - desc.

Example request
GET /app/history?page=0&size=10&sort=createdAt%2Cdesc HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Response fields
Path Type Description

content

Array

Array of elements

totalPages

Number

Number of total pages

totalElements

Number

Number of total existing elements

last

Boolean

True if this is last page, otherwise - false

size

Number

Size of one page

number

Number

Number of returned page

sort

Varies

Sorting characteristics, null if no sorting

first

Boolean

True if this is first page, otherwise - false

numberOfElements

Number

Number of elements in 'content'

content[].checkedStatus

Number

Status of review(1-accepted, 2-rejected, 3-filled)

content[].rejectStatusId

Null

If file was rejected, rejectStatus contains title – reason of rejection

Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNiwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.3WhhNo6hXxlWUbUA0g1xuBm04S2lAVQ9_mbvpQmTJp1q36Fh4EqCA65N-DYZp_GKbz3xcR2wf9PqXXj0wwoAIA
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 896

{
  "content" : [ {
    "id" : 2,
    "userId" : 10,
    "receiptId" : 4,
    "checkedStatus" : 2,
    "reviewResults" : null,
    "rejectStatusId" : null,
    "forced" : null,
    "points" : 1.2,
    "createdAt" : 1.640348826043E9,
    "updatedAt" : 1.640348826043E9,
    "rejectStatus" : null
  }, {
    "id" : 1,
    "userId" : 10,
    "receiptId" : 3,
    "checkedStatus" : 1,
    "reviewResults" : null,
    "rejectStatusId" : null,
    "forced" : null,
    "points" : 1.2,
    "createdAt" : 1.640348826015E9,
    "updatedAt" : 1.640348826015E9,
    "rejectStatus" : null
  } ],
  "totalPages" : 1,
  "totalElements" : 2,
  "last" : true,
  "first" : true,
  "numberOfElements" : 2,
  "sort" : [ {
    "direction" : "DESC",
    "property" : "id",
    "ignoreCase" : false,
    "nullHandling" : "NATIVE",
    "ascending" : false,
    "descending" : true
  } ],
  "size" : 10,
  "number" : 0
}

Receipts

Retrieve next receipt for check

Example request
GET /app/receipts/next HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Response fields
Path Type Description

empty

Boolean

If true, than there is no receipt in response, for different reasons

questions

Array

Questions

questions[].rejectAnswer

Varies

If this question is reject-type, then if user’s answer is same as question’s 'rejectAnswer', than you make reject

receiptId

Number

Id of the receipt

photos

Array

Photos of the receipt

qrParseSuccess

Varies

Whether server could successfully parse QR from receipt, if true, there is no need for user to fill in QR-fields(fn, fd, fpd)

fiscal-receipt

Varies

JSON format of the receipt, received from Fiscal Service, this is not always present in response, null if couldn’t get it from the service

promoInfo

String

Basic info about promo, should be shown to user.

millisLeft

Number

Milliseconds, left for review

Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 2822

{
  "qrParseSuccess" : null,
  "millisLeft" : 12000000,
  "promoInfo" : "This is cool promo! Please check our receipts very carefully.",
  "questions" : [ {
    "body" : "Это чек?",
    "key" : "receipt",
    "batch" : 1,
    "type" : 0,
    "rejectAnswer" : false,
    "info" : [ ]
  }, {
    "body" : "Информация на чеке читаема?",
    "key" : "readable",
    "batch" : 2,
    "type" : 0,
    "rejectAnswer" : false,
    "info" : [ ]
  }, {
    "body" : "В чеке подрисованы/перерисованы цифры или названия товаров?",
    "key" : "modification",
    "batch" : 3,
    "type" : 0,
    "rejectAnswer" : true,
    "info" : [ ]
  }, {
    "body" : "На фото один чек?",
    "key" : "one_photo",
    "batch" : 4,
    "type" : 0,
    "rejectAnswer" : false,
    "info" : [ ]
  }, {
    "body" : "Чек сфотографирован полностью?",
    "key" : "photo",
    "batch" : 5,
    "type" : 0,
    "rejectAnswer" : false,
    "info" : [ ]
  }, {
    "body" : "В чеке есть продукция Dior/Pepsi?",
    "key" : "brands",
    "batch" : 6,
    "type" : 1,
    "rejectAnswer" : false,
    "info" : [ ]
  }, {
    "body" : "Количество товара не меньше указанного?",
    "key" : "productCount",
    "batch" : 8,
    "type" : 1,
    "rejectAnswer" : false,
    "info" : [ {
      "id" : 7,
      "name" : "Ice-cream Lasunka",
      "count" : 2
    }, {
      "id" : 8,
      "name" : "Dark Chocolate Roshen",
      "count" : 3
    } ]
  }, {
    "body" : "Чек из города Moscow/Saint Petersburg?",
    "key" : "cities",
    "batch" : 9,
    "type" : 1,
    "rejectAnswer" : false,
    "info" : [ ]
  }, {
    "body" : "Укажите тип чека",
    "key" : "receipt-type",
    "batch" : 10,
    "type" : 0,
    "rejectAnswer" : null,
    "info" : [ {
      "type" : "kpk"
    }, {
      "type" : "product-receipt"
    }, {
      "type" : "qr"
    } ]
  }, {
    "body" : "Укажите количество товаров",
    "key" : "products",
    "batch" : 11,
    "type" : 1,
    "rejectAnswer" : null,
    "info" : [ {
      "id" : 7,
      "name" : "Ice-cream Lasunka"
    }, {
      "id" : 8,
      "name" : "Chocolate Roshen Dark"
    } ]
  }, {
    "body" : "Укажите количество и суммарную цену товаров",
    "key" : "products_with_count_and_subtotals",
    "batch" : 12,
    "type" : 1,
    "rejectAnswer" : null,
    "info" : [ {
      "id" : 6,
      "name" : "Ketchup Torchyn Lahidnyi",
      "multiplier" : null
    }, {
      "id" : 5,
      "name" : "Ketchup Torchyn Shashlyck",
      "multiplier" : null
    } ]
  } ],
  "receiptId" : 3,
  "photos" : [ "https://cdn.apmcheck.ru/" ],
  "empty" : false
}

Refuse receipt checking

Sometimes user don’t want to continue with receipts review, for various reasons (photo is blurry etc)

Path parameters
Table 2. /app/receipts/refuse/{receiptId}
Parameter Description

receiptId

Id of the receipt

Example request
PUT /app/receipts/refuse/2 HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Send result

'receipt-type' should be: 'qr', 'kpk', 'product-receipt'

Request fields
Path Type Description

id

Number

Id of the receipt

questionAnswers

Array

Answers on questions

rejected

Boolean

Should be true if answer on some question was the same as 'rejectAnswer'

receiptDate

String

Date on receipt

receiptTime

String

Time on receipt

receiptNumber

Null

Number of receipt

sum

Number

Total sum on receipt(integer)

coins

Number

Coins of total sum

eklz

Null

EKLZ of the receipt

kpkCode

Null

KpkCode of the receipt

kpkValue

Null

KpkValue

inn

Null

INN

fn

String

FN

fd

String

FD

fpd

String

FPD

rejectedQuestionKey

Null

Key of question, that is the reason of rejection (approve=false in this case)

Example request
POST /app/receipts/review HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
Host: localhost:8080
Content-Length: 2555

{
  "id" : 3,
  "rejected" : false,
  "rejectedQuestionKey" : null,
  "questionAnswers" : [ {
    "key" : "receipt",
    "body" : "Это чек?",
    "batch" : 1,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "readable",
    "body" : "Информация на чеке читаема?",
    "batch" : 2,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "modification",
    "body" : "В чеке подрисованы/перерисованы цифры или названия товаров?",
    "batch" : 3,
    "booleanAnswer" : false,
    "filledInfo" : null
  }, {
    "key" : "one_photo",
    "body" : "На фото один чек?",
    "batch" : 4,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "photo",
    "body" : "Чек сфотографирован полностью?",
    "batch" : 5,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "brands",
    "body" : "В чеке есть продукция Dior/Pepsi?",
    "batch" : 6,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "productCount",
    "body" : "Количество товара не меньше указанного?",
    "batch" : 8,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "cities",
    "body" : "Чек из города Moscow/Saint Petersburg?",
    "batch" : 9,
    "booleanAnswer" : true,
    "filledInfo" : null
  }, {
    "key" : "receipt-type",
    "body" : "Укажите тип чека",
    "batch" : 10,
    "booleanAnswer" : null,
    "filledInfo" : {
      "answer" : "qr"
    }
  }, {
    "key" : "products",
    "body" : "Укажите количество товаров",
    "batch" : 11,
    "booleanAnswer" : null,
    "filledInfo" : {
      "counts" : [ {
        "name" : "product1",
        "count" : 1,
        "id" : 8
      } ]
    }
  }, {
    "key" : "products_with_count_and_subtotals",
    "body" : "Укажите количество и суммарную цену товаров",
    "batch" : 12,
    "booleanAnswer" : null,
    "filledInfo" : {
      "counts_and_subtotals" : [ {
        "name" : "Ketchup Torchyn Lahidnyi",
        "count" : 3,
        "id" : 4,
        "subtotal" : 39.71
      } ]
    }
  } ],
  "receiptDate" : "22.11.2016",
  "receiptTime" : "09:00",
  "receiptNumber" : null,
  "sum" : 30,
  "coins" : 35,
  "eklz" : null,
  "kpkCode" : null,
  "kpkValue" : null,
  "inn" : null,
  "fn" : "8712000101133561",
  "fd" : "175152",
  "fpd" : "738084474"
}
Example response
HTTP/1.1 200 OK
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJzdWIiOiIxMCIsInBob25lIjpudWxsLCJkaXNjb250b1Rva2VuIjoidG9rZW4iLCJpZCI6MTAsImV4cCI6MTY0MDUyMTYyNSwiZW1haWwiOiJ1c2VyMUB1c2Vycy5jb20ifQ.MGiHSdihmETwYhn5xtwAaGspwteb8wRCu4X-z2-932j5uE7C2IsopBWGxtjGm5htAYwyYWIwPm4MeEvDb5-65g
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Disputes API

Dispute

Create

Request fields
Path Type Description

receiptUuid

String

Receipt UUID

title

String

Dispute title

question

String

Dispute details

Example request
POST /api/disputes HTTP/1.1
Content-Type: application/json
api-key: 42a19283-31ef-41de-9dc1-3a1903e9fec1
Host: localhost:8080
Content-Length: 146

{
  "receiptUuid" : "ba77bb1a-f9c3-4855-acad-69f5f990cfc2",
  "question" : "Review results was incorrect",
  "title" : "Please re-check receipt"
}
Response fields
Path Type Description

receiptUuid

String

Receipt UUID

disputeId

Number

Dispute ID

disputeStatus

String

Dispute status

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 107

{
  "receiptUuid" : "ba77bb1a-f9c3-4855-acad-69f5f990cfc2",
  "disputeId" : 1,
  "disputeStatus" : "TODO"
}

Errors

Standard error-response properties

Property-name Description

code

Standard error code

description

Generic description

localizedDescription

More specific description, context-dependent

requestId

Unique request identification, by which specific request can be identified and tracked on server

uri

Method and url of your request

Standard error-codes and descriptions

Code Standard description HTTP status

0001

Entity not found

400

0018

Daily limit of the rejected receipts exceeded

400

0010

Your time on review of this receipt has run out

400

0006

Permission to this resource is requiered

403

0013

Invalid format of files

400

0011

You have already submitted your decision on this receipt

400

0020

Message not readable.

500

0007

Access denied, token is either absent, invalid, or expired

401

0012

Invalid login-password combination

401

0002

Invalid parameter value

400

0015

File too large

400

0008

Api-key invalid or absent

401

0017

Too many requests.

400

0003

Couldn’t parse request

400

0005

Sorry, we have some problems with our data

500

0014

Daily limit of the submitted receipts exceeded

400

0019

These aren’t the Droids you’re looking for

500

0009

Some required answers are absent

400

0004

Oops, something went wrong

500

0016

Promo was already ended or not started yet

401

0021

Receipt not found.

500

Services API

Processing receipt

Push arrival and reprocess receipt

Request fields
Path Type Description

ids

Array

Ids of receipts

Example request
PUT /api/receipts/reprocessing/withArrival HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 25

{
  "ids" : [ 1, 2, 3 ]
}
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Trigger receipt reprocessing

Path parameters
Table 3. /api/receipts/processing/trigger/{receiptId}
Parameter Description

receiptId

Receipt id

Request parameters
Parameter Description

adminId

Admin’s id

Example request
GET /api/receipts/processing/trigger/3?adminId=3234 HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Promo

Create

Request fields
Path Type Description

name

String

Name, required

description

String

Description

starts_at

String

Start date, required, example "1986-04-08T12:30"

expires_at

String

End date, required, example "1986-04-08T12:30"

checkers_information

String

Moderators info

promo_owner_id

Number

Id of the promo owner(should exist), required

promo_url

String

promo url

config

Object

config, required

priority

Number

priority, required

Example request
POST /api/promos HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 261

{
  "promo_owner_id" : 1,
  "starts_at" : "1986-04-08T12:30",
  "expires_at" : "1986-04-08T12:30",
  "name" : "Test Promo",
  "description" : "description",
  "priority" : 0,
  "checkers_information" : "some text",
  "promo_url" : "some url",
  "config" : { }
}
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 329

{
  "id" : 3,
  "name" : "Test Promo",
  "startsAt" : 5.13333E8,
  "expiresAt" : 5.13333E8,
  "description" : "description",
  "promoOwnerId" : 1,
  "checkersInformation" : "some text",
  "promoUrl" : "some url",
  "config" : "{ }",
  "priority" : 0,
  "createdAt" : 1.640348828856E9,
  "updatedAt" : null,
  "deletedAt" : null
}

Update

Path parameters
Table 4. /api/promos/{promoId}
Parameter Description

promoId

Id of the promo(should exist)

Request fields
Path Type Description

name

String

Name, required

description

String

Description

starts_at

String

Start date, required, example "1986-04-08T12:30"

expires_at

String

End date, required, example "1986-04-08T12:30"

checkers_information

String

Moderators info

promo_owner_id

Number

Id of the promo owner(should exist), required

promo_url

String

promo url

config

Object

config, required

priority

Number

priority, required

Example request
PUT /api/promos/1 HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 261

{
  "promo_owner_id" : 2,
  "starts_at" : "1986-04-08T12:30",
  "expires_at" : "1986-04-08T12:30",
  "name" : "Test Promo",
  "description" : "description",
  "priority" : 0,
  "checkers_information" : "some text",
  "promo_url" : "some url",
  "config" : { }
}
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 329

{
  "id" : 1,
  "name" : "Test Promo",
  "startsAt" : 5.13333E8,
  "expiresAt" : 5.13333E8,
  "description" : "description",
  "promoOwnerId" : 2,
  "checkersInformation" : "some text",
  "promoUrl" : "some url",
  "config" : "{ }",
  "priority" : 0,
  "createdAt" : 1.640348825188E9,
  "updatedAt" : null,
  "deletedAt" : null
}

Reviews

Assign receipt to moderator

Request parameters
Parameter Description

receiptId

ID of the receipt

userId

ID of the user

Example request
PUT /api/reviews/start HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

receiptId=9&userId=45
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Health check

Perform a service health-check

Retrieve service health-check

Example request
GET /api/health HTTP/1.1
Host: localhost:8080
Response fields
Path Type Description

status

String

Service status. Should be "ok"

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 21

{
  "status" : "ok"
}

Images

Upload images

Upload any image

Request parts
Part Description

images

Any images

Example request
POST /api/images HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
api-key: 8b917c90-5d8f-4008-bbf7-01df92b3bd73
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=images
Content-Type: multipart/form-data

����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90
��C




��C		

��@@"��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�[�e�—x=7�)y�01��du�I�sVA�Akf,s\V���Zf��m߈,���X��QϧZ���������<��b�r���rWw*�z���c־X���S���hPC��9�5���N!Gq���jો�&�c��u�m��?���uk�km�:i�m;e�����נ��0_D���,.2�#�=A�Ϳ~�Z煡�V��o������O���p��S���|I����7�V�c��L��>DW0������Vp�BN��2��������i2���Gri$.(��x��Ś
���J&���:7�Ѓ��j���N+�N���ڳ�3���6kƾ#O
x_Tԧ�Ein�1�\)8��Ϸrq�^�\��-#�E���C|�6q������YV���)vF���&����׼m{��F�5���[�4��7�,~����K�Ң�׃4�`�#U�cb2Z����^HB���nAٛ}e��_Aj��uօim�h��V���	"��x3��3������	V�R�}np�	9iw�#�h/<��@���m�����[���N�	�i`����ц�T��Ia���
�g��;�5��v{�4V�ʳ�e\g�zW��k��mR�PѼ]����VŴ���0 0� ���FU>�:�*p^���{����&����̫;�1?.� 2/��17�_j��85�)�+x��W���M�5h��[�����E5��eA��j�G(�������IK���UF��w�|�zji��X&]�cl��F�}_����V�X���u��߮��(���2�	�d�9��
���7��g���/��9,�~��% ���3'��L������!����b�۰P9$�1_�0�a�����#m�Ft'�>P�k����Ե��4N���K[_)t�q�\��5���%�c��%����#�x�D���i�.J62J�j��ޣ�T����O~ ����E!�#�#��s_*��i�x�]SQ�4�����l���3��hN�rz6+����kz}���=�����7����q�GolQRr�t��%}X��X�F���i�l6��o������+�/O�k�'P1$j���~;�oE��gׯ��42˻�ye2r}p�ο[�-�ׁ4	��"�cc*�� �}E{l�RQ]��ٜ=�ϻe���Mц����k��R��K∅p�n���2�3��ް�$P��*>f*�qׁ�|��^7�R2�u6��UC���~�Y�^Jq]��a�Ú�~_�����f��ols�(v��%���E{'�ϊ���k����*c��y�,�R��<�6�������B����}*���5�^q�*q�c���R�Vk��F��Tx�15͔1�&W�V|�@5���W�ua�>�Ц�Dێז%��{.'ץii�
��).�AU��y�o@��|�1�ܤ<to,��Y�Z.3�u�l�ŹF1�ә��=���"�Œ@�N�{4�}Ԉ"/���/��ͨ�/�[�B�r?B+��U�K�ـ�N� z����򯺿g��<�c�!*�L`*2��Ũ�����o�O�?��
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response fields
Path Type Description

status

String

Status of the request

urls

Array

Images keys on cdn

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 86

{
  "urls" : [ "7dddeec8-1eb7-4a92-bf09-a094661ae532.jpeg" ],
  "status" : "success"
}

Force review

Force review

Request fields
Path Type Description

receiptId

Number

ID of the receipt

receiptType

String

Type of receipt(qr, kpk, product-receipt), optional

fd

String

fd, optional

fpd

String

fpd, optional

fn

String

fn, optional

inn

String

inn, optional

receiptNumber

Null

receipt number, optional

kpkCode

Null

kpk code, optional

retailerId

Number

Retailer id

kpkValue

Null

kpk value, optional

date

Array

date, optional

eklz

Null

eklz, optional

total

Number

Optional (required only if receipt’s previous sum is not null)

reviewerId

Number

ID of the reviewer

rejectStatusId

Varies

Reject-status id. If provided, receipt will be rejected by this status, optional

answers

Array

New answers, required if not a reject(rejectStatusId is not provided)

answers[].filledInfo.counts.countDifference

Number

difference count, should be present if in this promo send_result_as_difference is set to true, optional

answers[].filledInfo.counts_and_subtotals.countDifference

Number

difference count, should be present if in this promo send_result_as_difference is set to true, optional

answers[].filledInfo.counts_and_subtotals.subtotalDifference

Number

difference subtotal, should be present if in this promo send_result_as_difference is set to true, optional, type - float number

Example request
PUT /api/receipts/reviews/force HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 1051

{
  "receiptId" : 8,
  "reviewerId" : 435,
  "total" : 250.4,
  "inn" : "234235125124353415234",
  "fd" : "3423423",
  "fpd" : "342354235235",
  "fn" : "43252352352345342",
  "date" : [ 2021, 12, 24, 14, 27, 8, 715000000 ],
  "receiptType" : "qr",
  "eklz" : null,
  "kpkCode" : null,
  "kpkValue" : null,
  "receiptNumber" : null,
  "rejectStatusId" : null,
  "retailerId" : null,
  "answers" : [ {
    "key" : "products",
    "body" : "Укажите количество товаров",
    "batch" : 11,
    "booleanAnswer" : null,
    "filledInfo" : {
      "counts" : [ {
        "name" : "product1",
        "count" : 0,
        "id" : 8
      } ]
    }
  }, {
    "key" : "products_with_count_and_subtotals",
    "body" : "Укажите количество и суммарную цену товаров",
    "batch" : 12,
    "booleanAnswer" : null,
    "filledInfo" : {
      "counts_and_subtotals" : [ {
        "name" : "Ketchup Torchyn Lahidnyi",
        "count" : 8,
        "id" : 4,
        "subtotal" : 3.56
      } ]
    }
  } ]
}
Response fields
Path Type Description

response

Object

Standard response, updated

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1313

{
  "response" : {
    "uuid" : null,
    "userUuid" : null,
    "approved" : true,
    "receiptId" : 8,
    "receiptDate" : "2021-12-24T14:27:00",
    "createdAt" : "2021-12-24T12:27:08Z",
    "duplicate" : null,
    "promoId" : 2,
    "photos" : [ ],
    "reviewers" : [ 435 ],
    "rejectReason" : null,
    "retailer" : {
      "id" : null,
      "name" : "Unknown",
      "inn" : "234235125124353415234",
      "store" : "Unknown"
    },
    "rejectKey" : null,
    "answers" : {
      "products_with_count_and_subtotals" : [ {
        "name" : "Ketchup Torchyn Lahidnyi",
        "count" : 8,
        "id" : 4,
        "subtotal" : 3.56
      } ],
      "products" : [ {
        "name" : "product1",
        "count" : 0,
        "id" : 8
      } ]
    },
    "total" : {
      "sum" : 250.4,
      "count" : 8,
      "sum_subtotal" : 3.56
    },
    "rules" : null,
    "rulesCount" : null,
    "rulesPoints" : null,
    "city" : {
      "id" : -1,
      "city" : "Unknown",
      "region" : "Unknown",
      "address" : "Unknown"
    },
    "promoPoints" : {
      "earned" : 0,
      "totalEarned" : 0,
      "leftovers" : 3.56,
      "leftoversInt" : 356
    },
    "source" : null,
    "channel" : null,
    "fnsReceipt" : null,
    "qrString" : null,
    "meta" : null,
    "matchedPromos" : null
  }
}

Get questions and previous credentials

Path parameters
Table 5. /api/receipts/reviews/force/{receiptId}
Parameter Description

receiptId

ID of the receipt

Example request
GET /api/receipts/reviews/force/8 HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Response fields
Path Type Description

questions

Array

Questions to answer

previousCredentials

Object

Previous answers to those questions

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1022

{
  "questions" : [ {
    "body" : "Укажите количество товаров",
    "key" : "products",
    "batch" : 11,
    "type" : 1,
    "rejectAnswer" : null,
    "info" : [ {
      "id" : 7,
      "name" : "Ice-cream Lasunka"
    }, {
      "id" : 8,
      "name" : "Chocolate Roshen Dark"
    } ]
  }, {
    "body" : "Укажите количество и суммарную цену товаров",
    "key" : "products_with_count_and_subtotals",
    "batch" : 12,
    "type" : 1,
    "rejectAnswer" : null,
    "info" : [ {
      "id" : 6,
      "name" : "Ketchup Torchyn Lahidnyi",
      "multiplier" : null
    }, {
      "id" : 5,
      "name" : "Ketchup Torchyn Shashlyck",
      "multiplier" : null
    } ]
  } ],
  "previousCredentials" : {
    "products_with_count_and_subtotals" : [ {
      "name" : "Ketchup Torchyn Lahidnyi",
      "count" : 3,
      "id" : 4,
      "subtotal" : 26.51
    } ],
    "products" : [ {
      "name" : "product1",
      "count" : 7,
      "id" : 8
    } ]
  }
}

Auto-review

By IDs

Example request
PUT /api/receipts/review/auto HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 8

[ 1, 2 ]
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Regexp validation

Request parameters
Parameter Description

regexp

Regexp

Example request
GET /api/validations/regexp?regexp=.*Product1.* HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 15

{"status":"ok"}

Reports

Promo

Request parameters
Parameter Description

promoId

ID of the promo

from

Start date, optional, format - yyyy-MM-dd’T’HH:mm

to

End date, optional, format - yyyy-MM-dd’T’HH:mm

Example request
GET /api/reports/promo.xlsx?promoId=1&from=2017-08-16T18%3A00%3A00&to=2017-08-18T18%3A00%3A59 HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 18
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

.xlsx file content

Moderators report

Request parameters
Parameter Description

userId

ID of the user

Example request
POST /api/reports/moderators HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

userId=1
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 44

{
  "status" : "Report generation started"
}

Promo&Money report

Request parameters
Parameter Description

userId

ID of the user

promoId

ID of the promo

Example request
POST /api/reports/promoWithMoney HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

userId=1&promoId=1
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 44

{
  "status" : "Report generation started"
}

Push result only

By IDs

Example request
PUT /api/receipts/result/push/ids HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 8

[ 1, 2 ]
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Receipts

Retrieve result

Path parameters
Table 6. /api/receipts/{uuid}
Parameter Description

uuid

The receipt’s uuid

Example request
GET /api/receipts/ba77bb1a-f9c3-4855-acad-69f5f990cfc2 HTTP/1.1
api-key: 8b917c90-5d8f-4008-bbf7-01df92b3bd73
Host: localhost:8080
Response fields
Path Type Description

uuid

String

The receipt’s uuid

state

String

State of the receipt ('ARRIVED' or 'REVIEWED')

promoId

Number

Promo’s id

photos

Array

Photos(URLs)

receiptDate

String

Receipt date

retailer

Object

Retailer info

city

Object

City info

createdAt

String

Creation time

duplicate

Null

If the receipt is rejected, this object contains info about original receipt(which this is a duplicate of), else null

approved

Boolean

Shows whether the receipt is approved

receiptId

Number

The receipt’s id in the system

total

Varies

Totals (by question )products_with_count_and_subtotals

userUuid

Null

User’s UUID

source

Null

Receipt source

channel

Null

Receipt channel

meta

Null

Receipt metadata

reviewers

Array

Ids of users, that reviewed this receipt

rejectReason

Varies

Rejection reason (text), null if the receipt is approved

rejectKey

String

Rejection-reason key, null if the receipt is approved

rules

Null

List of rules triggered by this receipt

rulesCount

Null

Total count of rules applied to this receipt

rulesPoints

Null

Total points of applied rules

answers

Object

Question answers

promoPoints

Object

Promo Points object

fnsReceipt

Null

FNS receipt

qrString

Null

QR string parsed from receipt photo

matchedPromos

Null

Matched promos

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1271

{
  "state" : "REVIEWED",
  "uuid" : "ba77bb1a-f9c3-4855-acad-69f5f990cfc2",
  "userUuid" : null,
  "approved" : false,
  "receiptId" : 4,
  "receiptDate" : "",
  "createdAt" : "2021-12-24T12:27:06Z",
  "duplicate" : null,
  "promoId" : 2,
  "photos" : [ ],
  "reviewers" : [ 10, 11 ],
  "rejectReason" : "Несоответствие продуктов в чеке условиям Акции",
  "retailer" : {
    "id" : null,
    "name" : "Unknown",
    "inn" : null,
    "store" : "Unknown"
  },
  "rejectKey" : "NOT_QUANTITY_PRODUCT",
  "answers" : {
    "products_with_count_and_subtotals" : null,
    "products_with_count" : {
      "name" : "product1",
      "id" : 8
    },
    "products" : [ {
      "name" : "product1",
      "count" : 1,
      "id" : 8
    } ]
  },
  "total" : {
    "sum" : 30.35,
    "count" : 0,
    "sum_subtotal" : 0.0
  },
  "rules" : null,
  "rulesCount" : null,
  "rulesPoints" : null,
  "city" : {
    "id" : -1,
    "city" : "Unknown",
    "region" : "Unknown",
    "address" : "Unknown"
  },
  "promoPoints" : {
    "earned" : 0,
    "totalEarned" : 0,
    "leftovers" : 0.0,
    "leftoversInt" : 0
  },
  "source" : null,
  "channel" : null,
  "fnsReceipt" : null,
  "qrString" : null,
  "meta" : null,
  "matchedPromos" : null
}

Post QR receipt

Api-key is passed in header 'api-key', look into example request below

Request fields
Path Type Description

config

String

Stringified json, config of the receipt review

meta

String

Stringified json, receipt metadata (basically any data)

channel

String

Receipt channel (web, cbot, cbot_ok, cbot_vk, cbot_web, sms, telegram, wapp, etc), string

qrStr

String

Receipt QR code as string

userUuid

String

User’s UUID

externalId

Number

Receipt’s id in Promo’s system

Example request
POST /api/receipts/qr HTTP/1.1
Content-Type: application/json
api-key: 8b917c90-5d8f-4008-bbf7-01df92b3bd73
Host: localhost:8080
Content-Length: 1455

{
  "qrStr" : "t=20190113T154800&s=127.00&fn=8716000100025114&i=114318&fp=3578721879&n=1",
  "userUuid" : "e2a23a9e-6bb5-4ba8-bee4-f3a9cdeed534",
  "externalId" : 499,
  "config" : "{\n  \"products\" : [ {\n    \"name\" : \"Ice-cream Lasunka\",\n    \"id\" : 7\n  }, {\n    \"name\" : \"Chocolate Roshen Dark\",\n    \"id\" : 8\n  } ],\n  \"brands\" : [ {\n    \"name\" : \"Dior\",\n    \"id\" : \"1\"\n  }, {\n    \"name\" : \"Pepsi\",\n    \"id\" : \"2\"\n  } ],\n  \"cities\" : [ {\n    \"name\" : \"Moscow\",\n    \"id\" : \"1\"\n  }, {\n    \"name\" : \"Saint Petersburg\",\n    \"id\" : \"2\"\n  } ],\n  \"callback\" : {\n    \"url\" : \"http://some.promo.service/revizor/callback\",\n    \"headers\" : [ {\n      \"name\" : \"authorization\",\n      \"values\" : [ \"some-api-token\" ]\n    } ],\n    \"method\" : \"POST\"\n  },\n  \"products_with_count\" : [ {\n    \"name\" : \"Ice-cream Lasunka\",\n    \"count\" : 2,\n    \"id\" : 7\n  }, {\n    \"name\" : \"Dark Chocolate Roshen\",\n    \"count\" : 3,\n    \"id\" : 8\n  } ],\n  \"products_with_count_and_subtotals\" : [ {\n    \"name\" : \"Ketchup Torchyn Lahidnyi\",\n    \"id\" : 6,\n    \"min_product_price\" : 45.5,\n    \"max_product_price\" : 4500\n  }, {\n    \"name\" : \"Ketchup Torchyn Shashlyck\",\n    \"id\" : 5,\n    \"min_product_price\" : 50\n  } ],\n  \"products_with_count_subtotals_min_count\" : 1\n}",
  "meta" : "{\n  \"utm\" : \"api_docs\"\n}",
  "channel" : "apidoc"
}
Response fields
Path Type Description

uuid

String

UUID of the receipt

status

String

Status of the request

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 77

{
  "uuid" : "15dfb5bc-2754-4c00-a6bd-61e2a5963365",
  "status" : "success"
}

Update user uuids

Update user uuids for existing receipts. This method takes array of new-uuid—old-uuid objects and updates them.

Request fields
Path Type Description

[].oldUuid

String

Old user uuid

[].newUuid

String

New user uuid

Example request
POST /api/receipts/users HTTP/1.1
Content-Type: application/json
api-key: 83d4a4b8-cba5-4c5b-910a-903115a5ae66
Host: localhost:8080
Content-Length: 128

[ {
  "oldUuid" : "1",
  "newUuid" : "2"
}, {
  "oldUuid" : "3",
  "newUuid" : "4"
}, {
  "oldUuid" : "5",
  "newUuid" : "6"
} ]
Response fields
Path Type Description

status

String

Request status

transactionUuid

String

Transaction uuid

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 88

{
  "transactionUuid" : "1e035e9e-b030-4abe-b56d-dea0278f3614",
  "status" : "success"
}

Rollback user uuids update

Rollback performed update of user uuids in receipts

Path parameters
Table 7. /api/receipts/change_transactions/{oldTransactionUuid}/rollback
Parameter Description

oldTransactionUuid

UUID of transaction to rollback

Example request
POST /api/receipts/change_transactions/b7228dda-2266-4c75-95b3-d6908dd1a675/rollback HTTP/1.1
Content-Type: application/json
api-key: 99cd5241-5a95-4884-8ef5-0e7d50f3b1c1
Host: localhost:8080
Response fields
Path Type Description

status

String

Request status

transactionUuid

String

Transaction uuid

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 88

{
  "transactionUuid" : "21fdd79f-fc34-4a32-bd05-677cba3f441d",
  "status" : "success"
}

Post receipt

Api-key is passed in header 'api-key', look into example request below

Request parameters
Parameter Description

config

Json-string, config of the receipt review, optional

config.products_with_count

Config of the question 'products_with_count.Question sounds like 'Количество каждого продукта не меньше указанного?'. So you can pass products and counts. Look into example request for details.

config.brands

Config of the question 'brands'. Question sounds like 'На чеке пристутствует продукция брендов * ?'. So you can pass names of brands. Look into example request for details.

config.products

Config of the question 'products'. This is not question, actually, we just ask moderator to fill in counts of products, that you want to know about. So you give us products, and in final callback you will get counts of different products. Look into example request for details.

config.cities

Config of the question 'cities'. The question sounds like 'Этот чек из одного из городов: *?'. You give us cities and we can ask moderator about them. Look into example request for details.

config.callback

Callback config. Here you can configure url, method and headers, that we should use, when we want to give you some info. (Look into APM Callbacks Documentation).

source

Source of the receipt (web/chatbot/etc). Any string up to 255 symbols.

channel

Channel of the receipt (web, cbot, cbot_ok, cbot_vk, cbot_web, sms, telegram, wapp, etc). Any string up to 255 symbols.

userUuid

User’s UUID

externalId

Receipt’s id in Promo’s system

Request parts
Part Description

photos

Photos, min 1, max 5 files. Note that if you’re using plain cURL requests you should pass filename along with parameter name, like 'Content-Disposition: form-data; name=photos; filename=receipt.jpg'

Example request
POST /api/receipts HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
api-key: 8b917c90-5d8f-4008-bbf7-01df92b3bd73
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=config

{
  "products_with_count" : [ {
    "name" : "Ice-cream Lasunka",
    "count" : 2,
    "id" : 7
  }, {
    "name" : "Dark Chocolate Roshen",
    "count" : 3,
    "id" : 8
  } ],
  "brands" : [ {
    "name" : "Dior",
    "id" : "1"
  }, {
    "name" : "Pepsi",
    "id" : "2"
  } ],
  "products_with_count_subtotals_min_count" : 1,
  "products_with_count_and_subtotals" : [ {
    "name" : "Ketchup Torchyn Lahidnyi",
    "id" : 6,
    "min_product_price" : 45.5,
    "max_product_price" : 4500
  }, {
    "name" : "Ketchup Torchyn Shashlyck",
    "id" : 5,
    "min_product_price" : 50
  } ],
  "cities" : [ {
    "name" : "Moscow",
    "id" : "1"
  }, {
    "name" : "Saint Petersburg",
    "id" : "2"
  } ],
  "callback" : {
    "url" : "http://some.promo.service/revizor/callback",
    "headers" : [ {
      "name" : "authorization",
      "values" : [ "some-api-token" ]
    } ],
    "method" : "POST"
  },
  "source" : "web",
  "products" : [ {
    "name" : "Ice-cream Lasunka",
    "id" : 7
  }, {
    "name" : "Chocolate Roshen Dark",
    "id" : 8
  } ]
}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=userUuid

c09a2ebb-ad43-4dc5-b0d2-10e22d41f303
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=externalId

345
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=source

api
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=channel

telegram
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=photos
Content-Type: multipart/form-data

����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90
��C




��C		

��@@"��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�[�e�—x=7�)y�01��du�I�sVA�Akf,s\V���Zf��m߈,���X��QϧZ���������<��b�r���rWw*�z���c־X���S���hPC��9�5���N!Gq���jો�&�c��u�m��?���uk�km�:i�m;e�����נ��0_D���,.2�#�=A�Ϳ~�Z煡�V��o������O���p��S���|I����7�V�c��L��>DW0������Vp�BN��2��������i2���Gri$.(��x��Ś
���J&���:7�Ѓ��j���N+�N���ڳ�3���6kƾ#O
x_Tԧ�Ein�1�\)8��Ϸrq�^�\��-#�E���C|�6q������YV���)vF���&����׼m{��F�5���[�4��7�,~����K�Ң�׃4�`�#U�cb2Z����^HB���nAٛ}e��_Aj��uօim�h��V���	"��x3��3������	V�R�}np�	9iw�#�h/<��@���m�����[���N�	�i`����ц�T��Ia���
�g��;�5��v{�4V�ʳ�e\g�zW��k��mR�PѼ]����VŴ���0 0� ���FU>�:�*p^���{����&����̫;�1?.� 2/��17�_j��85�)�+x��W���M�5h��[�����E5��eA��j�G(�������IK���UF��w�|�zji��X&]�cl��F�}_����V�X���u��߮��(���2�	�d�9��
���7��g���/��9,�~��% ���3'��L������!����b�۰P9$�1_�0�a�����#m�Ft'�>P�k����Ե��4N���K[_)t�q�\��5���%�c��%����#�x�D���i�.J62J�j��ޣ�T����O~ ����E!�#�#��s_*��i�x�]SQ�4�����l���3��hN�rz6+����kz}���=�����7����q�GolQRr�t��%}X��X�F���i�l6��o������+�/O�k�'P1$j���~;�oE��gׯ��42˻�ye2r}p�ο[�-�ׁ4	��"�cc*�� �}E{l�RQ]��ٜ=�ϻe���Mц����k��R��K∅p�n���2�3��ް�$P��*>f*�qׁ�|��^7�R2�u6��UC���~�Y�^Jq]��a�Ú�~_�����f��ols�(v��%���E{'�ϊ���k����*c��y�,�R��<�6�������B����}*���5�^q�*q�c���R�Vk��F��Tx�15͔1�&W�V|�@5���W�ua�>�Ц�Dێז%��{.'ץii�
��).�AU��y�o@��|�1�ܤ<to,��Y�Z.3�u�l�ŹF1�ә��=���"�Œ@�N�{4�}Ԉ"/���/��ͨ�/�[�B�r?B+��U�K�ـ�N� z����򯺿g��<�c�!*�L`*2��Ũ�����o�O�?��
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response fields
Path Type Description

uuid

String

UUID of the receipt

status

String

Status of the request

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 77

{
  "uuid" : "989abe5f-7ae6-456f-9eb0-85a628ceb775",
  "status" : "success"
}

Add photos to receipt

Api-key is passed in header 'api-key', look into example request below

Path parameters
Table 8. /api/receipts/{receiptId}/photos
Parameter Description

receiptId

Receipt ID

Request parts
Part Description

photos

Photos, min 1, max 5 files

Example request
POST /api/receipts/1/photos HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: general_api_key
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=photos
Content-Type: multipart/form-data

����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90
��C




��C		

��@@"��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�[�e�—x=7�)y�01��du�I�sVA�Akf,s\V���Zf��m߈,���X��QϧZ���������<��b�r���rWw*�z���c־X���S���hPC��9�5���N!Gq���jો�&�c��u�m��?���uk�km�:i�m;e�����נ��0_D���,.2�#�=A�Ϳ~�Z煡�V��o������O���p��S���|I����7�V�c��L��>DW0������Vp�BN��2��������i2���Gri$.(��x��Ś
���J&���:7�Ѓ��j���N+�N���ڳ�3���6kƾ#O
x_Tԧ�Ein�1�\)8��Ϸrq�^�\��-#�E���C|�6q������YV���)vF���&����׼m{��F�5���[�4��7�,~����K�Ң�׃4�`�#U�cb2Z����^HB���nAٛ}e��_Aj��uօim�h��V���	"��x3��3������	V�R�}np�	9iw�#�h/<��@���m�����[���N�	�i`����ц�T��Ia���
�g��;�5��v{�4V�ʳ�e\g�zW��k��mR�PѼ]����VŴ���0 0� ���FU>�:�*p^���{����&����̫;�1?.� 2/��17�_j��85�)�+x��W���M�5h��[�����E5��eA��j�G(�������IK���UF��w�|�zji��X&]�cl��F�}_����V�X���u��߮��(���2�	�d�9��
���7��g���/��9,�~��% ���3'��L������!����b�۰P9$�1_�0�a�����#m�Ft'�>P�k����Ե��4N���K[_)t�q�\��5���%�c��%����#�x�D���i�.J62J�j��ޣ�T����O~ ����E!�#�#��s_*��i�x�]SQ�4�����l���3��hN�rz6+����kz}���=�����7����q�GolQRr�t��%}X��X�F���i�l6��o������+�/O�k�'P1$j���~;�oE��gׯ��42˻�ye2r}p�ο[�-�ׁ4	��"�cc*�� �}E{l�RQ]��ٜ=�ϻe���Mц����k��R��K∅p�n���2�3��ް�$P��*>f*�qׁ�|��^7�R2�u6��UC���~�Y�^Jq]��a�Ú�~_�����f��ols�(v��%���E{'�ϊ���k����*c��y�,�R��<�6�������B����}*���5�^q�*q�c���R�Vk��F��Tx�15͔1�&W�V|�@5���W�ua�>�Ц�Dێז%��{.'ץii�
��).�AU��y�o@��|�1�ܤ<to,��Y�Z.3�u�l�ŹF1�ә��=���"�Œ@�N�{4�}Ԉ"/���/��ͨ�/�[�B�r?B+��U�K�ـ�N� z����򯺿g��<�c�!*�L`*2��Ũ�����o�O�?��
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response fields
Path Type Description

status

String

Status of the request

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 26

{
  "status" : "success"
}

Push arrival and result

By IDs

Example request
PUT /api/receipts/result/pushWithArrival/ids HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 8

[ 1, 2 ]
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

By promo

repushing results if delivered = 2

Path parameters
Table 9. /api/receipts/result/push/{promoId}
Parameter Description

promoId

Promo’s ID

Example request
PUT /api/receipts/result/push/1 HTTP/1.1
Authorization: general_api_key
Host: localhost:8080
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

By UUIDs

Example request
PUT /api/receipts/result/push/UUIDs HTTP/1.1
Content-Type: application/json
Authorization: general_api_key
Host: localhost:8080
Content-Length: 20

[ "UUId1", "UUID2" ]
Example response
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Widget API

Receipts

Post receipt

Api-key is passed in header 'api-key', look into example request below

Request parameters
Parameter Description

userUuid

User’s UUID

qrAsString

QR code as string

source

Receipt source, e.g. qr scan, manual qr input or photos upload

channel

Receipt channel, e.g. web, cbot, cbot_ok, cbot_vk, cbot_web, sms, telegram, wapp, etc

Request parts
Part Description

photos

Photos, min 1, max 5 files

Example request
POST /api/widgets/receipts HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
api-key: 8b917c90-5d8f-4008-bbf7-01df92b3bd73
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=userUuid

257f42e1-4709-4c8c-8989-9f9d94d6fb4a
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=qrAsString

238275ff-f20e-4721-8a17-a792f4cf3697
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=source

widget-qr-scan
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=channel

promo-site
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=photos
Content-Type: multipart/form-data

����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90
��C




��C		

��@@"��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�[�e�—x=7�)y�01��du�I�sVA�Akf,s\V���Zf��m߈,���X��QϧZ���������<��b�r���rWw*�z���c־X���S���hPC��9�5���N!Gq���jો�&�c��u�m��?���uk�km�:i�m;e�����נ��0_D���,.2�#�=A�Ϳ~�Z煡�V��o������O���p��S���|I����7�V�c��L��>DW0������Vp�BN��2��������i2���Gri$.(��x��Ś
���J&���:7�Ѓ��j���N+�N���ڳ�3���6kƾ#O
x_Tԧ�Ein�1�\)8��Ϸrq�^�\��-#�E���C|�6q������YV���)vF���&����׼m{��F�5���[�4��7�,~����K�Ң�׃4�`�#U�cb2Z����^HB���nAٛ}e��_Aj��uօim�h��V���	"��x3��3������	V�R�}np�	9iw�#�h/<��@���m�����[���N�	�i`����ц�T��Ia���
�g��;�5��v{�4V�ʳ�e\g�zW��k��mR�PѼ]����VŴ���0 0� ���FU>�:�*p^���{����&����̫;�1?.� 2/��17�_j��85�)�+x��W���M�5h��[�����E5��eA��j�G(�������IK���UF��w�|�zji��X&]�cl��F�}_����V�X���u��߮��(���2�	�d�9��
���7��g���/��9,�~��% ���3'��L������!����b�۰P9$�1_�0�a�����#m�Ft'�>P�k����Ե��4N���K[_)t�q�\��5���%�c��%����#�x�D���i�.J62J�j��ޣ�T����O~ ����E!�#�#��s_*��i�x�]SQ�4�����l���3��hN�rz6+����kz}���=�����7����q�GolQRr�t��%}X��X�F���i�l6��o������+�/O�k�'P1$j���~;�oE��gׯ��42˻�ye2r}p�ο[�-�ׁ4	��"�cc*�� �}E{l�RQ]��ٜ=�ϻe���Mц����k��R��K∅p�n���2�3��ް�$P��*>f*�qׁ�|��^7�R2�u6��UC���~�Y�^Jq]��a�Ú�~_�����f��ols�(v��%���E{'�ϊ���k����*c��y�,�R��<�6�������B����}*���5�^q�*q�c���R�Vk��F��Tx�15͔1�&W�V|�@5���W�ua�>�Ц�Dێז%��{.'ץii�
��).�AU��y�o@��|�1�ܤ<to,��Y�Z.3�u�l�ŹF1�ә��=���"�Œ@�N�{4�}Ԉ"/���/��ͨ�/�[�B�r?B+��U�K�ـ�N� z����򯺿g��<�c�!*�L`*2��Ũ�����o�O�?��
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response fields
Path Type Description

uuid

String

UUID of the receipt

status

String

Status of the request

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 77

{
  "uuid" : "e9ec5656-f363-4fdc-83dd-e6ff1bb62246",
  "status" : "success"
}