{"openapi":"3.0.1","info":{"title":"Payter Cloud Payments Service","description":"This API provides methods to manage payment sessions on Payter terminals, in this mode of operation the terminal is slaved to the Payter Cloud API.The terminal will start reading cards once a start command has been given. A web hook can be given in the start, this will be called once a card has been read. The card method can also polled to check for a card read, with an optional timeout to wait before returning allowing a long poll instead of a web hook style of interaction. Once a card has been read any business logic can be used to determine what action needs to be taken for the read card.\n* Authorize : An authorization is performed and the result is returned as a session object. The amount authorized is guaranteed to be available on the card holders account\n* Commit/Cancel : Existing sessions can be committed for a final amount or cancelled. (The final amount may be lower than the authorized amount)\n* Ignore : A card that has been read can be ignored by calling the stop end point.\n\n![Image](/read-auth-commit.png)\n\nThe API follows a state machine during card reading and authorization the following diagram details these states\n\n![Image](/cps-states.png)","version":"1.0"},"servers":[{"url":"https://cps.mypayter.com/","description":"CPS Production End Point"},{"url":"https://cps-test.mypayter.com/","description":"CPS Test End Point"},{"url":"https://cps.dev.mypayter.com/","description":"CPS Dev End Point"}],"tags":[{"name":"Terminal","description":"Get terminal info"},{"name":"Card","description":"Get card info and control card reading"},{"name":"UI","description":"Set terminal display screens"},{"name":"Session","description":"Create and complete sessions"},{"name":"Web Hook","description":"State web hook for all terminals"},{"name":"ApiKey","description":"Get an apikey with a token"}],"paths":{"/webhook":{"get":{"tags":["Web Hook"],"description":"Get webhook for online state changes","operationId":"getTerminalWebhook","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebHookCallback"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"404":{"description":"No such terminal or user does not have accesss","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]},"put":{"tags":["Web Hook"],"description":"Set webhook for state changes, this web hook will get called with the terminal object","operationId":"putTerminalWebhook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebHookCallback"}}},"required":true},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebHookCallback"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"404":{"description":"No such terminal or user does not have accesss","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"callbacks":{"Terminal state":{"{$request.body#/callbackUrl}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Terminal"}}},"required":true},"responses":{"200":{"description":"OK"}}}}}},"security":[{"Authorization":[]}]},"delete":{"tags":["Web Hook"],"description":"Delete webhook for state changes","operationId":"deleteTerminalWebhook","responses":{"200":{"description":"successful operation"},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"404":{"description":"No such terminal or user does not have accesss","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/ui":{"post":{"tags":["UI"],"description":" Display a ui screen on the terminal. After this operation, the terminal will display the defined screen\n\n There are different screen types possible: e.g.\n\n | __Type__       | message | selection | dispense |\n | -------------- | ------- | --------- | -------- |\n | __Screen__     | ![Message](/screen-message.png) | ![Selection](/screen-selection.png) | ![Dispense](/screen-dispense.png) |\n | __Properties__ | <ul><li>title</li><li>message</li><li>icon _(optional)_</li><li>buttons.\\<name>.label _(optional)_</li></ul> | <ul><li>title</li><li>split _(optional)_</li><li>items.\\<name>.label _(optional)_</li><li>items.\\<name>.value _(optional)_</li><li>items.\\<name>.currency _(optional)_</li></ul> | <ul><li>title</li><li>subtitle</li><li>background _(optional)_</li></ul> |\n\n The callbackUrl is called if a button is pressed, or an item is selected.","operationId":"postUI","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"callbackUrl","in":"query","description":"Callback URL","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UIRequest"}}},"required":true},"responses":{"400":{"description":"Malformed screen request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation"},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"callbacks":{"UI Notification":{"{$request.path.callbackUrl}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UINotification"}}},"required":true},"responses":{"200":{"description":"OK"}}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/stop":{"post":{"tags":["Card"],"description":"Stop reading cards, this can be used while waiting for a card or once a card has been read to return to idle","operationId":"postStop","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"uiMessage","in":"query","description":"Message to show when stopping card read","required":false,"schema":{"type":"string"}},{"name":"uiMessageTimeout","in":"query","description":"Time to display ui message (seconds)","required":false,"schema":{"type":"integer","format":"int64","default":0}}],"responses":{"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation"},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/start":{"post":{"tags":["Card"],"description":"Start reading cards, the optional webhook will be notified when card read completes","operationId":"postStart","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"authorizedAmount","in":"query","description":"Amount to authorize, this is only used if authorize is called after card read","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"callbackUrl","in":"query","description":"Callback URL","required":false,"schema":{"type":"string"}},{"name":"uiMessage","in":"query","description":"Message to show when requesting card","required":false,"schema":{"type":"string"}},{"name":"qr","in":"query","description":"String to display as QR code when requesting card [Apollo only]","required":false,"schema":{"type":"string"}},{"name":"language","in":"query","description":"String to select terminal language e.g. en, de, nl... [Apollo only]","required":false,"schema":{"type":"string"}},{"name":"hideAmount","in":"query","description":"Hide amount on screen during reading [Apollo only]","required":false,"schema":{"type":"boolean"}},{"name":"authType","in":"query","description":"Auth type PRE_AUTH, PAYMENT [Apollo only]","required":false,"schema":{"type":"string","enum":["PAYMENT","DEFERRED_PAYMENT","PRE_AUTH"]}},{"name":"customIdleScreen","in":"query","description":"Resets to a custom idle screen [Apollo only]","required":false,"schema":{"type":"boolean","default":false}},{"name":"uiMessageTitle","in":"query","description":"Message title to show when requesting card [Apollo only]","required":false,"schema":{"type":"string"}},{"name":"supportedPaymentMethods","in":"query","description":"Payment methods supported [Apollo only]","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["PROPRIETARY","EMV","QR_CODE"]}}},{"name":"extendedCard","in":"query","description":"Adds extended data in card details in card callback [Apollo only]","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation"},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"callbacks":{"Card Read":{"{$request.path.callbackUrl}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}},"required":true},"responses":{"200":{"description":"OK"}}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/sessions/{sessionId}/update":{"post":{"tags":["Session"],"description":"Increment the authorized amount on the session. Either incrementAmount or authorizedAmount has to be supplied","operationId":"postUpdatePreAuth","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","description":"Session Id","required":true,"schema":{"type":"string"}},{"name":"incrementAmount","in":"query","description":"Increment the authorized amount with the given value (can be minus or 0 to extend the session)","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"authorizedAmount","in":"query","description":"Set the new authorized amount to this amount","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"No such terminal, session or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionUpdate"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/sessions/{sessionId}/context":{"post":{"tags":["Session"],"description":"Add additional context data to the transaction post commit","operationId":"postTxnContextData","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","description":"Session Id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostTxnContextBody"}}},"required":true},"responses":{"200":{"description":"Successful operation"},"404":{"description":"No such terminal, session or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/sessions/{sessionId}/commit":{"post":{"tags":["Session"],"description":"Commit a session with a final amount, after this the session is complete an the same card can start a new session","operationId":"postCommitSession","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}},{"name":"commitAmount","in":"query","description":"Final amount to commit the transaction","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"uiMessage","in":"query","description":"Message to show while completing","required":false,"schema":{"type":"string"}},{"name":"uiMessageTimeout","in":"query","description":"Time to display ui message (seconds)","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"receiptLine","in":"query","description":"Extra line on receipt","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"409":{"description":"Session already committed or cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/sessions/{sessionId}/cancel":{"post":{"tags":["Session"],"description":"Cancel a session, after this the session is complete an the same card can start a new session","operationId":"postCancelSession","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}},{"name":"uiMessage","in":"query","description":"Message to show while completing","required":false,"schema":{"type":"string"}},{"name":"uiMessageTimeout","in":"query","description":"Time to display ui message (seconds)","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"receiptLine","in":"query","description":"Extra line on receipt","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"409":{"description":"Session already committed or cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/authorize":{"post":{"tags":["Session"],"description":"Authorize a transaction on the currently active card, the returned session can later be committed or cancelled","operationId":"postAuthorize","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"uiMessage","in":"query","description":"Message to show once authorize complete","required":false,"schema":{"type":"string"}},{"name":"uiMessageTimeout","in":"query","description":"Time to display ui message  (seconds)","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"receiptLine","in":"query","description":"Extra line on receipt","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"callbackUrl","in":"query","description":"Receive the response in callbackUrl [Apollo only]","required":false,"schema":{"type":"string"}},{"name":"merchantReference","in":"query","description":"An optional merchant reference to be included in transaction","required":false,"schema":{"type":"string"}},{"name":"hideAmount","in":"query","description":"Hide amount on screen during authorization [Apollo only]","required":false,"schema":{"type":"boolean"}},{"name":"sessionActionDate","in":"query","description":"Date on which the session automatically runs the session action (yyyy-MM-dd HH:mm:ss) [Apollo only]","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sessionAction","in":"query","description":"Action to take when the sessionActionDate occurs [Apollo only]","required":false,"schema":{"type":"string","enum":["COMMIT","CANCEL"]}}],"responses":{"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"callbacks":{"Session Notification":{"{$request.path.callbackUrl}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionNotification"}}},"required":true},"responses":{"200":{"description":"OK"}}}}}},"security":[{"Authorization":[]}]}},"/apikey/{token}":{"post":{"tags":["ApiKey"],"description":"Get an apikey with a token","operationId":"generateAPIKey","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"text/plain":{}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"404":{"description":"No user found with this token or token is already used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}}}},"/user/details":{"get":{"tags":["User"],"description":"Get authenticated user's username","operationId":"authDetails","responses":{"200":{"description":"returns authenticated user's username","content":{"application/json":{}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/sessions/{sessionId}":{"get":{"tags":["Session"],"description":"Get a specific session","operationId":"getSession","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/sessions":{"get":{"tags":["Session"],"description":"Return all sessions for a terminal","operationId":"getSessions","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"start","in":"query","description":"Start datetime filter (dd-MM-yyyy)","required":false,"schema":{"pattern":"^(?:0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[012])-[0-9]{4}$","type":"string","description":"Filter for end transaction time date, defaults to current time if not set","format":"string"}},{"name":"end","in":"query","description":"End datetime filter (dd-MM-yyyy)","required":false,"schema":{"pattern":"^(?:0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[012])-[0-9]{4}$","type":"string","description":"Filter for end transaction time date, defaults to current time if not set","format":"string"}},{"name":"states","in":"query","description":"Session states filter","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["AUTHORIZED","COMMITED","CANCELLED","FAILED"]}}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}},"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}/card":{"get":{"tags":["Card"],"description":"Get currently active card","operationId":"getCard","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}},{"name":"waitTime","in":"query","description":"Time to wait for card to be read (seconds)","required":false,"schema":{"type":"integer","format":"int32","default":0}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult"}}}}},"security":[{"Authorization":[]}]}},"/terminals/{serialNumber}":{"get":{"tags":["Terminal"],"description":"Get info for terminal","operationId":"getTerminal","parameters":[{"name":"serialNumber","in":"path","description":"Serial Number","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"No such terminal or user does not have access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult_UserView"}}}},"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Terminal_UserView"}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult_UserView"}}}}},"security":[{"Authorization":[]}]}},"/terminals":{"get":{"tags":["Terminal"],"description":"List all terminals","operationId":"getTerminals","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Terminal_UserView"}}}}},"500":{"description":"General error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalExceptionResult_UserView"}}}}},"security":[{"Authorization":[]}]}}},"components":{"schemas":{"WebHookCallback":{"type":"object","properties":{"callbackUrl":{"type":"string"},"states":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["IDLE","READING","CARD","STOPPING","AUTHORIZING"]}}}},"GlobalExceptionResult":{"required":["error","status","timestamp"],"type":"object","properties":{"timestamp":{"type":"string","description":"Time of the error","format":"date-time"},"status":{"type":"integer","description":"HTTP status code of the error","format":"int32","example":404},"error":{"type":"string","description":"HTTP status message of the error","example":"Not Found"},"message":{"type":"string","description":"Detail message of the error","example":"Terminal not found"}}},"UIRequest":{"required":["id","properties","type"],"type":"object","properties":{"id":{"type":"string","description":"Screen id","example":"Screen-1"},"type":{"type":"string","description":"Screen type","example":"message"},"properties":{"type":"object","additionalProperties":{"type":"string","description":"Screen properties","example":"{\"title\":\"Continue\",\"message\":\"Are you sure you wish to continue?\",\"icon\":\"approved\",\"buttons.ok\":\"\",\"buttons.ok.label\":\"Ok\",\"buttons.cancel\":\"\",\"buttons.cancel.label\":\"Cancel\"}"},"description":"Screen properties","example":{"title":"Continue","message":"Are you sure you wish to continue?","icon":"approved","buttons.ok":"","buttons.ok.label":"Ok","buttons.cancel":"","buttons.cancel.label":"Cancel"}}},"description":"Screen request"},"UINotification":{"required":["response","screenId","serialNumber"],"type":"object","properties":{"serialNumber":{"type":"string","description":"Serial number of the terminal that triggered the UI notification.","example":"P6X20141000001"},"screenId":{"type":"string","description":"Screen id that triggered the UI notification.","example":"Screen-1"},"response":{"type":"string","description":"Response returned from the screen, usually the name of the button/item pressed.","example":"ok"}}},"Session":{"required":["authorizedAmount","brand","cardId","result","serialNumber","sessionId","terminalTxnId"],"type":"object","properties":{"serialNumber":{"type":"string","description":"Serialnumber of the terminal","example":"P6X20162500176"},"sessionId":{"type":"string","description":"Unique id of this session","example":"123e4567-e89b-12d3-a456-426655440000"},"cardId":{"type":"string","description":"ID of the card, is unique for a given card, as sessions can only exist for EMV cards this is a secure hash of card data","example":"FB778973B7370B4C575DFC2A538147199B42073CBEFA7793FFE4D0B7CBB45A42"},"transactionTime":{"type":"string","description":"Time of transaction","format":"date-time"},"commitTime":{"type":"string","description":"Time of commit/cancel","format":"date-time","example":"2020-02-10T23:15:35Z"},"tid":{"type":"string","description":"Terminal ID (TID) for the transaction, as used by transaction acquirer","example":"12345678"},"brand":{"type":"string","description":"Brand of the card","example":"A0000000043060"},"emvDate":{"type":"string","description":"EMV Date, as reported in EMV transaction. This should match date on card holders bank statement","example":"200211"},"emvTime":{"type":"string","description":"EMV Time, as reported in EMV transaction. This should match time on card holders bank statement","example":"001521"},"authorizedAmount":{"type":"integer","description":"Amount requested during authorization, in minor units (e.g. cents)","format":"int64","example":100},"result":{"type":"string","description":"The emv payment result returned by terminal","example":"APPROVED","enum":["APPROVED","INVALID_CARD","CARD_READ","CANCELLED","TIMEOUT","DECLINED","FAILED"]},"authorizationResponseCode":{"type":"string","description":"Authorization response code","example":"3030"},"authorizationCode":{"type":"string","description":"Authorization code (as appears on card holder bank statement)","example":"B31812"},"authorizationHostResult":{"type":"string","description":"Result code returned by processor","example":"0"},"authorizationHostReference":{"type":"string","description":"Reference number returned by processor","example":"4dc01d39-5b4c-ea11-80bb-0050569277e2"},"finalAmount":{"type":"integer","description":"Amount requested during commit, in minor units (e.g. cents)","format":"int64","example":100},"terminalTxnId":{"type":"integer","description":"Terminal transaction ID, this matches transaction ID reported by terminal to MyPayter","format":"int64","example":100},"merchantReference":{"type":"string","description":"Optional merchant reference included in transaction","example":"My Reference String"},"receiptInfo":{"uniqueItems":true,"type":"array","description":"Array of receipt lines to be stored for receipt generation","example":"Receipt Line 1","items":{"type":"string","description":"Array of receipt lines to be stored for receipt generation","example":"Receipt Line 1"}},"state":{"type":"string","description":"The state of the transaction","example":"AUTHORIZED","enum":["AUTHORIZED","COMMITED","CANCELLED","FAILED"]}},"description":"Currently active sessions on card, only present when there is are authorizations for this card."},"SessionUpdate":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"response":{"type":"object","additionalProperties":{"type":"object","description":"List of response messages","example":{"result":"APPROVED","authorizationResponseCode":"00","approvedUpdateAmount":-3250,"authorizationCode":"B31812","updateAmount":-3250,"authorizationHostReference":"4dc01d39-5b4c-ea11-80bb-0050569277e2"}},"description":"List of response messages","example":{"result":"APPROVED","authorizationResponseCode":"00","approvedUpdateAmount":-3250,"authorizationCode":"B31812","updateAmount":-3250,"authorizationHostReference":"4dc01d39-5b4c-ea11-80bb-0050569277e2"}}}},"PostTxnContextBody":{"type":"object","properties":{"txnContextData":{"type":"string"}}},"SessionNotification":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"error":{"type":"string","description":"Error message, in case the request was completed exceptionally. empty when successful","example":"Something went wrong and session could not be created"}}},"Card":{"required":["aid","cardId","ifd","serialNumber"],"type":"object","properties":{"serialNumber":{"type":"string","description":"Serial number of the terminal","example":"P6X20141000001"},"ifd":{"type":"string","description":"Interface used to read the card","example":"CONTACTLESS"},"aid":{"type":"string","description":"Application ID of the card, determines type of card","example":"A0000000043060"},"cardId":{"type":"string","description":"ID of the card, is unique for a given card. For EMV cards it is a secure hash of card data, for other cards it is ID configured in terminal","example":"FB778973B7370B4C575DFC2A538147199B42073CBEFA7793FFE4D0B7CBB45A42"},"maskedPan":{"type":"string","description":"Masked PAN of the card, only present for EMV cards","example":"123456*******9876"},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}},"GlobalExceptionResult_UserView":{"required":["error","status","timestamp"],"type":"object","properties":{"timestamp":{"type":"string","description":"Time of the error","format":"date-time"},"status":{"type":"integer","description":"HTTP status code of the error","format":"int32","example":404},"error":{"type":"string","description":"HTTP status message of the error","example":"Not Found"},"message":{"type":"string","description":"Detail message of the error","example":"Terminal not found"}}},"ApiUser_UserView":{"type":"object","properties":{"terminals":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Terminal_UserView"}},"terminalStateWebHookUrl":{"type":"string"},"terminalStateWebHookStates":{"uniqueItems":true,"type":"array","items":{"type":"string","enum":["IDLE","READING","CARD","STOPPING","AUTHORIZING"]}}}},"Terminal_UserView":{"required":["serialNumber","terminalIds","terminalName"],"type":"object","properties":{"serialNumber":{"type":"string","description":"Unique id of this terminal","example":"P6X20200100000"},"terminalName":{"type":"string","description":"Name of the terminal","example":"My terminal 1"},"terminalIds":{"type":"array","description":"List of terminal id's (TIDs) for this terminal","example":12345678,"items":{"type":"string","description":"List of terminal id's (TIDs) for this terminal","example":"12345678"}},"apiUsers":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ApiUser_UserView"}},"error":{"type":"string"},"online":{"type":"boolean"},"state":{"type":"string","enum":["IDLE","READING","CARD","STOPPING","AUTHORIZING"]}}}},"securitySchemes":{"Authorization":{"type":"apiKey","description":"Include 'CPS apikey=\"APIKEY\"' in Authorization header","name":"Authorization","in":"header"}}}}