### GET /terminals/{serialNumber} Source: https://cps-test.mypayter.com/v3/api-docs Get info for terminal ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number ### Responses #### 200 - Successful operation **Terminal_UserView** - **serialNumber** (string) (required): Unique id of this terminal (example: "P6X20200100000") - **terminalName** (string) (required): Name of the terminal (example: "My terminal 1") - **terminalIds** (array (string)) (required): List of terminal id's (TIDs) for this terminal (example: 12345678) - **apiUsers** (array (ApiUser_UserView)) Array items: - **terminals** (array (Terminal_UserView)) Array items: - **terminalStateWebHookUrl** (string) - **terminalStateWebHookStates** (array (string (IDLE|READING|CARD|STOPPING|AUTHORIZING))) - **error** (string) - **online** (boolean) - **state** (string (IDLE|READING|CARD|STOPPING|AUTHORIZING)) ("IDLE"|"READING"|"CARD"|"STOPPING"|"AUTHORIZING") #### 404 - No such terminal or user does not have access **GlobalExceptionResult_UserView** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult_UserView** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//terminals/{serialNumber}" ``` ``` -------------------------------- ### GET /terminals Source: https://cps-test.mypayter.com/v3/api-docs List all terminals ```markdown ### Responses #### 200 - Successful operation - Array of Terminal_UserView #### 500 - General error **GlobalExceptionResult_UserView** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//terminals" ``` ``` -------------------------------- ### GET /webhook Source: https://cps-test.mypayter.com/v3/api-docs Get webhook for online state changes ```markdown ### Responses #### 200 - successful operation **WebHookCallback** - **callbackUrl** (string) - **states** (array (string (IDLE|READING|CARD|STOPPING|AUTHORIZING))) #### 404 - No such terminal or user does not have accesss **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//webhook" ``` ``` -------------------------------- ### POST /apikey/{token} Source: https://cps-test.mypayter.com/v3/api-docs Get an apikey with a token ```markdown ### Parameters - **token** (string, path, required) ### Responses #### 200 - successful operation #### 404 - No user found with this token or token is already used **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X POST "https://cps.mypayter.com//apikey/{token}" ``` ``` -------------------------------- ### POST /terminals/{serialNumber}/start Source: https://cps-test.mypayter.com/v3/api-docs Start reading cards, the optional webhook will be notified when card read completes ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **authorizedAmount** (integer (int64), query, required): Amount to authorize, this is only used if authorize is called after card read - **callbackUrl** (string, query, optional): Callback URL - **uiMessage** (string, query, optional): Message to show when requesting card - **qr** (string, query, optional): String to display as QR code when requesting card [Apollo only] - **language** (string, query, optional): String to select terminal language e.g. en, de, nl... [Apollo only] - **hideAmount** (boolean, query, optional): Hide amount on screen during reading [Apollo only] - **authType** (string (PAYMENT|DEFERRED_PAYMENT|PRE_AUTH), query, optional): Auth type PRE_AUTH, PAYMENT [Apollo only] - **customIdleScreen** (boolean, query, optional): Resets to a custom idle screen [Apollo only] - **uiMessageTitle** (string, query, optional): Message title to show when requesting card [Apollo only] - **supportedPaymentMethods** (array (string (PROPRIETARY|EMV|QR_CODE)), query, optional): Payment methods supported [Apollo only] ### Responses #### 200 - Successful operation Empty response body #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X POST "https://cps.mypayter.com//terminals/{serialNumber}/start?authorizedAmount=0&callbackUrl=string&uiMessage=string&qr=string&language=string&hideAmount=true&authType=PAYMENT&customIdleScreen=false&uiMessageTitle=string&supportedPaymentMethods=item1,item2" ``` ``` -------------------------------- ### GET /user/details Source: https://cps-test.mypayter.com/v3/api-docs Get authenticated user's username ```markdown ### Responses #### 200 - returns authenticated user's username #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//user/details" ``` ``` -------------------------------- ### GET /terminals/{serialNumber}/sessions Source: https://cps-test.mypayter.com/v3/api-docs Return all sessions for a terminal ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **start** (string (string), query, optional): Start datetime filter (dd-MM-yyyy) - **end** (string (string), query, optional): End datetime filter (dd-MM-yyyy) - **states** (array (string (AUTHORIZED|COMMITED|CANCELLED|FAILED)), query, optional): Session states filter ### Responses #### 200 - Successful operation - Array of Session #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//terminals/{serialNumber}/sessions?start=string&end=string&states=item1,item2" ``` ``` -------------------------------- ### GET /terminals/{serialNumber}/sessions/{sessionId} Source: https://cps-test.mypayter.com/v3/api-docs Get a specific session ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **sessionId** (string, path, required): Session ID ### Responses #### 200 - Successful operation **Session** - **serialNumber** (string) (required): Serialnumber of the terminal (example: "P6X20162500176") - **sessionId** (string) (required): Unique id of this session (example: "123e4567-e89b-12d3-a456-426655440000") - **cardId** (string) (required): 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** (string (date-time)): Time of transaction - **commitTime** (string (date-time)): Time of commit/cancel (example: "2020-02-10T23:15:35Z") - **tid** (string): Terminal ID (TID) for the transaction, as used by transaction acquirer (example: "12345678") - **brand** (string) (required): Brand of the card (example: "A0000000043060") - **emvDate** (string): EMV Date, as reported in EMV transaction. This should match date on card holders bank statement (example: "200211") - **emvTime** (string): EMV Time, as reported in EMV transaction. This should match time on card holders bank statement (example: "001521") - **authorizedAmount** (integer (int64)) (required): Amount requested during authorization, in minor units (e.g. cents) (example: 100) - **result** (string (APPROVED|INVALID_CARD|CARD_READ|CANCELLED|TIMEOUT|DECLINED|FAILED)) (required): The emv payment result returned by terminal (example: "APPROVED") ("APPROVED"|"INVALID_CARD"|"CARD_READ"|"CANCELLED"|"TIMEOUT"|"DECLINED"|"FAILED") - **authorizationResponseCode** (string): Authorization response code (example: "3030") - **authorizationCode** (string): Authorization code (as appears on card holder bank statement) (example: "B31812") - **authorizationHostResult** (string): Result code returned by processor (example: "0") - **authorizationHostReference** (string): Reference number returned by processor (example: "4dc01d39-5b4c-ea11-80bb-0050569277e2") - **finalAmount** (integer (int64)): Amount requested during commit, in minor units (e.g. cents) (example: 100) - **terminalTxnId** (integer (int64)) (required): Terminal transaction ID, this matches transaction ID reported by terminal to MyPayter (example: 100) - **merchantReference** (string): Optional merchant reference included in transaction (example: "My Reference String") - **receiptInfo** (array (string)): Array of receipt lines to be stored for receipt generation (example: "Receipt Line 1") - **state** (string (AUTHORIZED|COMMITED|CANCELLED|FAILED)): The state of the transaction (example: "AUTHORIZED") ("AUTHORIZED"|"COMMITED"|"CANCELLED"|"FAILED") #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//terminals/{serialNumber}/sessions/{sessionId}" ``` ``` -------------------------------- ### PUT /webhook Source: https://cps-test.mypayter.com/v3/api-docs Set webhook for state changes, this web hook will get called with the terminal object ```markdown ### Request Body **Content-Type:** application/json - **callbackUrl** (string) - **states** (array (string (IDLE|READING|CARD|STOPPING|AUTHORIZING))) ### Responses #### 200 - successful operation **WebHookCallback** - **callbackUrl** (string) - **states** (array (string (IDLE|READING|CARD|STOPPING|AUTHORIZING))) #### 404 - No such terminal or user does not have accesss **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X PUT "https://cps.mypayter.com//webhook" \ -H "Content-Type: application/json" \ -d '{ "callbackUrl": "string", "states": [ "IDLE" ] }' ``` ``` -------------------------------- ### GET /terminals/{serialNumber}/card Source: https://cps-test.mypayter.com/v3/api-docs Get currently active card ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **waitTime** (integer (int32), query, optional): Time to wait for card to be read (seconds) ### Responses #### 200 - Successful operation **Card** - **serialNumber** (string) (required): Serial number of the terminal (example: "P6X20141000001") - **ifd** (string) (required): Interface used to read the card (example: "CONTACTLESS") - **aid** (string) (required): Application ID of the card, determines type of card (example: "A0000000043060") - **cardId** (string) (required): 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** (string): Masked PAN of the card, only present for EMV cards (example: "123456*******9876") - **sessions** (array (Session)) Array items: - **serialNumber** (string) (required): Serialnumber of the terminal (example: "P6X20162500176") - **sessionId** (string) (required): Unique id of this session (example: "123e4567-e89b-12d3-a456-426655440000") - **cardId** (string) (required): 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** (string (date-time)): Time of transaction - **commitTime** (string (date-time)): Time of commit/cancel (example: "2020-02-10T23:15:35Z") - **tid** (string): Terminal ID (TID) for the transaction, as used by transaction acquirer (example: "12345678") - **brand** (string) (required): Brand of the card (example: "A0000000043060") - **emvDate** (string): EMV Date, as reported in EMV transaction. This should match date on card holders bank statement (example: "200211") - **emvTime** (string): EMV Time, as reported in EMV transaction. This should match time on card holders bank statement (example: "001521") - **authorizedAmount** (integer (int64)) (required): Amount requested during authorization, in minor units (e.g. cents) (example: 100) - **result** (string (APPROVED|INVALID_CARD|CARD_READ|CANCELLED|TIMEOUT|DECLINED|FAILED)) (required): The emv payment result returned by terminal (example: "APPROVED") ("APPROVED"|"INVALID_CARD"|"CARD_READ"|"CANCELLED"|"TIMEOUT"|"DECLINED"|"FAILED") - **authorizationResponseCode** (string): Authorization response code (example: "3030") - **authorizationCode** (string): Authorization code (as appears on card holder bank statement) (example: "B31812") - **authorizationHostResult** (string): Result code returned by processor (example: "0") - **authorizationHostReference** (string): Reference number returned by processor (example: "4dc01d39-5b4c-ea11-80bb-0050569277e2") - **finalAmount** (integer (int64)): Amount requested during commit, in minor units (e.g. cents) (example: 100) - **terminalTxnId** (integer (int64)) (required): Terminal transaction ID, this matches transaction ID reported by terminal to MyPayter (example: 100) - **merchantReference** (string): Optional merchant reference included in transaction (example: "My Reference String") - **receiptInfo** (array (string)): Array of receipt lines to be stored for receipt generation (example: "Receipt Line 1") - **state** (string (AUTHORIZED|COMMITED|CANCELLED|FAILED)): The state of the transaction (example: "AUTHORIZED") ("AUTHORIZED"|"COMMITED"|"CANCELLED"|"FAILED") #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X GET "https://cps.mypayter.com//terminals/{serialNumber}/card?waitTime=0" ``` ``` -------------------------------- ### API Overview: Payter Cloud Payments Service Source: https://cps-test.mypayter.com/v3/api-docs 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. * 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 * Commit/Cancel : Existing sessions can be committed for a final amount or cancelled. (The final amount may be lower than the authorized amount) * Ignore : A card that has been read can be ignored by calling the stop end point. ![Image](/read-auth-commit.png) The API follows a state machine during card reading and authorization the following diagram details these states ![Image](/cps-states.png) ```yaml # Payter Cloud Payments Service # Version: 1.0 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. * 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 * Commit/Cancel : Existing sessions can be committed for a final amount or cancelled. (The final amount may be lower than the authorized amount) * Ignore : A card that has been read can be ignored by calling the stop end point. ![Image](/read-auth-commit.png) The API follows a state machine during card reading and authorization the following diagram details these states ![Image](/cps-states.png) # Base URL: https://cps.mypayter.com/ ``` -------------------------------- ### POST /terminals/{serialNumber}/sessions/{sessionId}/commit Source: https://cps-test.mypayter.com/v3/api-docs Commit a session with a final amount, after this the session is complete an the same card can start a new session ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **sessionId** (string, path, required): Session ID - **commitAmount** (integer (int64), query, required): Final amount to commit the transaction - **uiMessage** (string, query, optional): Message to show while completing - **uiMessageTimeout** (integer (int64), query, optional): Time to display ui message (seconds) - **receiptLine** (array (string), query, optional): Extra line on receipt ### Responses #### 200 - successful operation **Session** - **serialNumber** (string) (required): Serialnumber of the terminal (example: "P6X20162500176") - **sessionId** (string) (required): Unique id of this session (example: "123e4567-e89b-12d3-a456-426655440000") - **cardId** (string) (required): 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** (string (date-time)): Time of transaction - **commitTime** (string (date-time)): Time of commit/cancel (example: "2020-02-10T23:15:35Z") - **tid** (string): Terminal ID (TID) for the transaction, as used by transaction acquirer (example: "12345678") - **brand** (string) (required): Brand of the card (example: "A0000000043060") - **emvDate** (string): EMV Date, as reported in EMV transaction. This should match date on card holders bank statement (example: "200211") - **emvTime** (string): EMV Time, as reported in EMV transaction. This should match time on card holders bank statement (example: "001521") - **authorizedAmount** (integer (int64)) (required): Amount requested during authorization, in minor units (e.g. cents) (example: 100) - **result** (string (APPROVED|INVALID_CARD|CARD_READ|CANCELLED|TIMEOUT|DECLINED|FAILED)) (required): The emv payment result returned by terminal (example: "APPROVED") ("APPROVED"|"INVALID_CARD"|"CARD_READ"|"CANCELLED"|"TIMEOUT"|"DECLINED"|"FAILED") - **authorizationResponseCode** (string): Authorization response code (example: "3030") - **authorizationCode** (string): Authorization code (as appears on card holder bank statement) (example: "B31812") - **authorizationHostResult** (string): Result code returned by processor (example: "0") - **authorizationHostReference** (string): Reference number returned by processor (example: "4dc01d39-5b4c-ea11-80bb-0050569277e2") - **finalAmount** (integer (int64)): Amount requested during commit, in minor units (e.g. cents) (example: 100) - **terminalTxnId** (integer (int64)) (required): Terminal transaction ID, this matches transaction ID reported by terminal to MyPayter (example: 100) - **merchantReference** (string): Optional merchant reference included in transaction (example: "My Reference String") - **receiptInfo** (array (string)): Array of receipt lines to be stored for receipt generation (example: "Receipt Line 1") - **state** (string (AUTHORIZED|COMMITED|CANCELLED|FAILED)): The state of the transaction (example: "AUTHORIZED") ("AUTHORIZED"|"COMMITED"|"CANCELLED"|"FAILED") #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 409 - Session already committed or cancelled **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X POST "https://cps.mypayter.com//terminals/{serialNumber}/sessions/{sessionId}/commit?commitAmount=0&uiMessage=string&uiMessageTimeout=0&receiptLine=item1,item2" ``` ``` -------------------------------- ### POST /terminals/{serialNumber}/sessions/{sessionId}/cancel Source: https://cps-test.mypayter.com/v3/api-docs Cancel a session, after this the session is complete an the same card can start a new session ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **sessionId** (string, path, required): Session ID - **uiMessage** (string, query, optional): Message to show while completing - **uiMessageTimeout** (integer (int64), query, optional): Time to display ui message (seconds) - **receiptLine** (array (string), query, optional): Extra line on receipt ### Responses #### 200 - Successful operation **Session** - **serialNumber** (string) (required): Serialnumber of the terminal (example: "P6X20162500176") - **sessionId** (string) (required): Unique id of this session (example: "123e4567-e89b-12d3-a456-426655440000") - **cardId** (string) (required): 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** (string (date-time)): Time of transaction - **commitTime** (string (date-time)): Time of commit/cancel (example: "2020-02-10T23:15:35Z") - **tid** (string): Terminal ID (TID) for the transaction, as used by transaction acquirer (example: "12345678") - **brand** (string) (required): Brand of the card (example: "A0000000043060") - **emvDate** (string): EMV Date, as reported in EMV transaction. This should match date on card holders bank statement (example: "200211") - **emvTime** (string): EMV Time, as reported in EMV transaction. This should match time on card holders bank statement (example: "001521") - **authorizedAmount** (integer (int64)) (required): Amount requested during authorization, in minor units (e.g. cents) (example: 100) - **result** (string (APPROVED|INVALID_CARD|CARD_READ|CANCELLED|TIMEOUT|DECLINED|FAILED)) (required): The emv payment result returned by terminal (example: "APPROVED") ("APPROVED"|"INVALID_CARD"|"CARD_READ"|"CANCELLED"|"TIMEOUT"|"DECLINED"|"FAILED") - **authorizationResponseCode** (string): Authorization response code (example: "3030") - **authorizationCode** (string): Authorization code (as appears on card holder bank statement) (example: "B31812") - **authorizationHostResult** (string): Result code returned by processor (example: "0") - **authorizationHostReference** (string): Reference number returned by processor (example: "4dc01d39-5b4c-ea11-80bb-0050569277e2") - **finalAmount** (integer (int64)): Amount requested during commit, in minor units (e.g. cents) (example: 100) - **terminalTxnId** (integer (int64)) (required): Terminal transaction ID, this matches transaction ID reported by terminal to MyPayter (example: 100) - **merchantReference** (string): Optional merchant reference included in transaction (example: "My Reference String") - **receiptInfo** (array (string)): Array of receipt lines to be stored for receipt generation (example: "Receipt Line 1") - **state** (string (AUTHORIZED|COMMITED|CANCELLED|FAILED)): The state of the transaction (example: "AUTHORIZED") ("AUTHORIZED"|"COMMITED"|"CANCELLED"|"FAILED") #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 409 - Session already committed or cancelled **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X POST "https://cps.mypayter.com//terminals/{serialNumber}/sessions/{sessionId}/cancel?uiMessage=string&uiMessageTimeout=0&receiptLine=item1,item2" ``` ``` -------------------------------- ### POST /terminals/{serialNumber}/ui Source: https://cps-test.mypayter.com/v3/api-docs Display a ui screen on the terminal. After this operation, the terminal will display the defined screen There are different screen types possible: e.g. | __Type__ | message | selection | dispense | | -------------- | ------- | --------- | -------- | | __Screen__ | ![Message](/screen-message.png) | ![Selection](/screen-selection.png) | ![Dispense](/screen-dispense.png) | | __Properties__ | | | | The callbackUrl is called if a button is pressed, or an item is selected. ```markdown ### Parameters - **serialNumber** (string, path, required): Serial Number - **callbackUrl** (string, query, optional): Callback URL ### Request Body **Content-Type:** application/json - **id** (string) (required): Screen id (example: "Screen-1") - **type** (string) (required): Screen type (example: "message") - **properties** (object) (required): 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"}) ### Responses #### 200 - Successful operation Empty response body #### 400 - Malformed screen request **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 404 - No such terminal or user does not have access **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") #### 500 - General error **GlobalExceptionResult** - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ### Example Usage ```bash curl -X POST "https://cps.mypayter.com//terminals/{serialNumber}/ui?callbackUrl=string" \ -H "Content-Type: application/json" \ -d '{ "id": "Screen-1", "type": "message", "properties": { "title": "Continue", "message": "Are you sure you wish to continue?", "icon": "approved", "buttons.ok": "", "buttons.ok.label": "Ok", "buttons.cancel": "", "buttons.cancel.label": "Cancel" } }' ``` ``` -------------------------------- ### Schema: UIRequest Source: https://cps-test.mypayter.com/v3/api-docs Screen request ```markdown ## Schema: UIRequest Screen request **Type:** object - **id** (string) (required): Screen id (example: "Screen-1") - **type** (string) (required): Screen type (example: "message") - **properties** (object) (required): 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"}) ``` -------------------------------- ### Schema: GlobalExceptionResult Source: https://cps-test.mypayter.com/v3/api-docs Schema definition for GlobalExceptionResult ```markdown ## Schema: GlobalExceptionResult Schema definition for GlobalExceptionResult **Type:** object - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ``` -------------------------------- ### Schema: GlobalExceptionResult_UserView Source: https://cps-test.mypayter.com/v3/api-docs Schema definition for GlobalExceptionResult_UserView ```markdown ## Schema: GlobalExceptionResult_UserView Schema definition for GlobalExceptionResult_UserView **Type:** object - **timestamp** (string (date-time)) (required): Time of the error - **status** (integer (int32)) (required): HTTP status code of the error (example: 404) - **error** (string) (required): HTTP status message of the error (example: "Not Found") - **message** (string): Detail message of the error (example: "Terminal not found") ``` -------------------------------- ### Schema: WebHookCallback Source: https://cps-test.mypayter.com/v3/api-docs Schema definition for WebHookCallback ```markdown ## Schema: WebHookCallback Schema definition for WebHookCallback **Type:** object - **callbackUrl** (string) - **states** (array (string (IDLE|READING|CARD|STOPPING|AUTHORIZING))) ``` -------------------------------- ### Schema: Terminal_UserView Source: https://cps-test.mypayter.com/v3/api-docs Schema definition for Terminal_UserView ```markdown ## Schema: Terminal_UserView Schema definition for Terminal_UserView **Type:** object - **serialNumber** (string) (required): Unique id of this terminal (example: "P6X20200100000") - **terminalName** (string) (required): Name of the terminal (example: "My terminal 1") - **terminalIds** (array (string)) (required): List of terminal id's (TIDs) for this terminal (example: 12345678) - **apiUsers** (array (ApiUser_UserView)) Array items: - **terminals** (array (Terminal_UserView)) Array items: - **terminalStateWebHookUrl** (string) - **terminalStateWebHookStates** (array (string (IDLE|READING|CARD|STOPPING|AUTHORIZING))) - **error** (string) - **online** (boolean) - **state** (string (IDLE|READING|CARD|STOPPING|AUTHORIZING)) ("IDLE"|"READING"|"CARD"|"STOPPING"|"AUTHORIZING") ```