openapi: 3.2.0 info: title: DN Payment Initiation Payment Initiation API description: 'Public Payment Initiation API (PI-API) of Diebold Nixdorf to access the Transaction Middleware.' version: 1.9.11 contact: email: ronald.schmieder@dieboldnixdorf.com servers: - url: http://localhost:8080/pi-api/v1 - url: https://localhost:8080/pi-api/v1 security: - bearerAuth: [] - openId: [] tags: - name: Payment Initiation API description: 'Public Payment Initiation API (PI-API) of DieboldNixdorf to access the Transaction Middleware.' externalDocs: description: Find out more url: https://dieboldnixdorf.com paths: /pay/{merchantId}/initiateSession: post: summary: Initiate a payment session for token based payments like Google Pay or Apple Pay description: 'Retrive the payment session object. Please see https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/requesting_an_apple_pay_payment_session' operationId: initiateSession parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/PaymentProviderParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' tags: - Payment Initiation API requestBody: description: The request. It contains only the validation URL, if there is any required: true content: application/json: schema: $ref: '#/components/schemas/InitiateMerchantSessionRequest' responses: '200': description: 'Returns the opaque payment session object. ' content: application/json: schema: $ref: '#/components/schemas/InitiateMerchantSessionResponse' '500': $ref: '#/components/responses/InternalServerError500' /pay/{merchantId}/creditBalance: post: tags: - Payment Initiation API summary: The creditBalance API call returns the credit balance of a payer in case of… description: 'The creditBalanceRequest is used to return the payer''s credit balance. If the amount is insufficient, the call returns a 401 http status code.' operationId: creditBalance parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/PaymentProviderParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' responses: '200': description: 'In case of a successful call, a PI-API returns the credit a creditBalanceResponse. ' content: application/json: schema: $ref: '#/components/schemas/CreditBalanceResponse' '401': $ref: '#/components/responses/Unauthorized401' '404': $ref: '#/components/responses/NotFound404' '409': $ref: '#/components/responses/Conflict409' '500': $ref: '#/components/responses/InternalServerError500' requestBody: content: application/json: schema: $ref: '#/components/schemas/CreditBalanceRequest' description: The payment request required: true /pay/{merchantId}/authorize: post: tags: - Payment Initiation API summary: Authorizes a later cardless payment transaction description: 'Used to authorize a later payment transaction, using a credit or debit card, without transferingt any money.' operationId: authorizeCardlessPayment parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/PaymentProviderParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' responses: '200': description: 'In case of a successful call, a http response code 200 is returned. ' '401': $ref: '#/components/responses/Unauthorized401' '404': $ref: '#/components/responses/NotFound404' '409': $ref: '#/components/responses/Conflict409' '500': $ref: '#/components/responses/InternalServerError500' requestBody: content: application/json: schema: $ref: '#/components/schemas/AuthorizePaymentRequest' description: The payment request required: true /pay/{merchantId}/cardless: post: tags: - Payment Initiation API summary: Initiate a cardless payment transaction description: 'Used to initiate a payment transaction without using a credit or debit card.' operationId: cardlessPayment parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/PaymentProviderParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' responses: '201': description: 'In case of a successful call, a PI-API transactionId is returned. This transactionId can be used in further request. ' content: application/json: schema: $ref: '#/components/schemas/InitiatePaymentResponse' '401': $ref: '#/components/responses/Unauthorized401' '404': $ref: '#/components/responses/NotFound404' '500': $ref: '#/components/responses/InternalServerError500' requestBody: content: application/json: schema: $ref: '#/components/schemas/InitiateCardlessPaymentRequest' description: The payment request required: true /pay/{merchantId}/cardbased/{cardBasedTransactionType}: post: tags: - Payment Initiation API summary: Initiate a card based payment transaction description: Used to initiate a credit or debit card payment or money transfer transaction. operationId: cardbasedPayment parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/CardBasedTransactionType' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/PaymentProviderParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' responses: '200': description: 'In case of a successful call, a PI-API transactionId is returned. This transactionId can be used in further request. ' content: application/json: schema: $ref: '#/components/schemas/InitiateCardBasedPaymentResponse' '500': $ref: '#/components/responses/CardBasedInternalServerError500' '503': description: Service Unavailable requestBody: content: application/json: schema: $ref: '#/components/schemas/InitiateCardBasedPaymentRequest' description: The payment request required: true /pay/{merchantId}/confirm/{transactionId}: put: summary: Confirm a payment transaction description: Used to confirm a payment transaction approved by payment provider operationId: confirmPayment tags: - Payment Initiation API parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/PI-API-Transaction-ID' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/PaymentProviderParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' responses: '200': description: No further data are returned in case of a successful call. content: application/json: schema: $ref: '#/components/schemas/ConfirmResponse' '401': $ref: '#/components/responses/Unauthorized401' '404': $ref: '#/components/responses/NotFound404' '405': $ref: '#/components/responses/MethodNotAllowed405' '500': $ref: '#/components/responses/InternalServerError500' /{merchantId}/payments: get: summary: Retrive a set of payment transactions description: Used to retrive the state of a payment transaction. operationId: transactions tags: - Payment Initiation API parameters: - $ref: '#/components/parameters/PI-API-Merchant-ID' - $ref: '#/components/parameters/X-Request-ID-Param' - $ref: '#/components/parameters/TimestampParam' - $ref: '#/components/parameters/PSU-IP-AddressParam' - $ref: '#/components/parameters/PSU-User-AgentParam' - $ref: '#/components/parameters/PSU-GEO-LocationParam' - $ref: '#/components/parameters/SessionKeyParam' - $ref: '#/components/parameters/CredentialsTypeParam' - $ref: '#/components/parameters/CredentialsParam' - $ref: '#/components/parameters/StoreIdParam' - $ref: '#/components/parameters/CashierIdParam' - $ref: '#/components/parameters/TerminalIdParam' - $ref: '#/components/parameters/RetailUnitParam' - name: fromDateTime in: query required: false description: '
Start of the time interval for which the transactions are requested. Default value fromDateTime = (now - 1h)
A timestamp containing date and a time as defined by RFC3339
time.
Please see: Date and Time on the Internet: Timestamps
End of the time interval for which the transactions are requested. Default value toDateTime = (fromDateTime + 1h)
A timestamp containing date and a time as defined by RFC3339
time.
Please see: Date and Time on the Internet: Timestamps
Indicates if the payment provider should be called to refresh the transaction status in the TM database or not. If set to "true", the payment provider''s system is called; otherwise, the last known transaction status is loaded from the TM database.
Default value is "true".
' schema: type: boolean example: true responses: '200': description: 'Returns an array of transactions if there are some in the given time frame. ' content: application/json: schema: oneOf: - $ref: '#/components/schemas/TransactionDetailsResponse' - $ref: '#/components/schemas/CardbasedDetailsResponse' '401': $ref: '#/components/responses/Unauthorized401' '404': $ref: '#/components/responses/NotFound404' '500': $ref: '#/components/responses/InternalServerError500' components: schemas: ConfirmResponse: type: object description: 'The Confirm Response contains more or less only the link to the transaction ' properties: href: type: string description: 'The URI used e.g. to cancel this transaction. Please see also https://en.wikipedia.org/wiki/HATEOAS ' example: http://pisp-pi-api-webapp/pi-api/v1/payments/123123123 CardbasedDetailsResponse: allOf: - $ref: '#/components/schemas/CardbasedPaymentBaseResponse' - type: object properties: message: description: An optional, additional message which describes the error. type: string maxLength: 256 example: 'Internal server error. A database connection could not be established. ' paymentProviderErrorCode: description: An error code as outlined in the PI-API documentation. type: string example: SysErr#765 errorCode: description: An error code as outlined in the PI-API documentation. type: string example: HOST_CANCEL transactionType: $ref: '#/components/schemas/CardbasedTransactionTypes' storeId: type: string minLength: 4 maxLength: 256 description: 'The unique identifier to identify a store in the merchants domain. ' example: Zara#34 cashierId: type: string minLength: 4 maxLength: 256 description: 'The unique identifier to identify a certain cashier in the merchants domain. ' example: '00635' terminalId: type: string minLength: 1 maxLength: 64 description: 'The ID of the terminal, which has initiated/requested the payment. ' example: '1234567890' MerchantCategoryCode: type: string pattern: '[0-9]{4,4}' description: "Conditional.https://en.wikipedia.org/wiki/ISO_3166-1_numeric
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
' example: 276 Error: description: "The error property is optional. \nIt is set only if an error has been detected.\n" type: object properties: message: description: An optional, additional message which describes the error. type: string maxLength: 256 example: 'Internal server error. A database connection could not be established. ' paymentProviderErrorCode: description: An error code as outlined in the PI-API documentation. type: string example: SysErr#765 errorCode: description: An error code as outlined in the PI-API documentation. type: string example: HOST_CANCEL transactionId: $ref: '#/components/schemas/TransactionIdentifier' CardbasedTransactionTypes: type: string description: "The type of a card based transaction, which can be one of the following:| Code | \nDescription | \n
| 01 | \nVisa credit | \n
| 02 | \nVisa debit | \n
| 03 | \nVisa prepaid | \n
| 04 | \nCash | \n
| 05 | \nDebit/deposit access accounts other than those linked to a Visa card (includes checking/savings accounts and proprietary debit/ATM cards). | \n
| 06 | \nCredit accounts other than those linked to a Visa card (includes credit cards and proprietary credit lines). | \n
| Name | \nDescription | \n
| PAYMENT | \nA regular payment transaction | \n
| CANCEL | \nA cancel payment transaction | \n
| REFUND | \nA refund transaction | \n
| REFUNDCREDIT | \nA refund transaction without related payment | \n
| Name | \nDescription | \n
| NEW | \nThe transaction is initiated/in progress but the backend has not yet been called or the backend has not sent a status in the response. | \n
| PENDING | \nThe transaction is still in progress, the backend has been called and is waiting for the buyer's confirmation. | \n
| FINISHED | \nThe transaction has been finished. Means for initiatePayment: The goods were payed. Means for cancelPayment: The cancel took place. Means for refundPayment: The refund took place. | \n
| CANCELED | \nThe transaction is CANCELED, e.g. because of an unrecoverable error or a Cancel transaction. | \n
| TO_BE_CANCELLED | \nThe transaction has been marked for cancellation by the regular cancellation job. The job contacts the backend to complete the cancellation. | \n
The SessionKey parameter contains an base64 encoded AES-128bit\n(AES128) key, which is used to encrypt the AuthorizationType and\nAuthorizationToken.
\n\nMoreover, where appropriate, other parts of the request and/or response message are encrypted too, such as\n'buyerIdentityToken' in the 'UserAuthorizationData' of a\nInitiateCardlessPayment request.
\n\nIf the SessionKey is an empty string (with a zero length), it is assumed, that the\nAuthorizationType and AuthorizationToken are transmitted\nunencrypted, which is by no means recommended and -\nwhenever possible - should be avoided.
\n\nIf a part of a request or response message is or can be encrypted, this is explicitly\nindicated in the description.
\n\nThe key is separated from the InitializationVector using a '-' (Minus sign/Separator) like 'AESKey InitializationVector'.\n" schema: type: string example: QmFzZTY0IGVuY29kaW5nIHNjaGVtZXMgYXJlIGNvbW1vbmx5VGhlIHBhcnRpY3VsYXIgY2hvaWNlIA== CardBasedTransactionType: name: cardBasedTransactionType in: path required: true schema: $ref: '#/components/schemas/CardbasedTransactionTypes' example: moneyTransferCredit StoreIdParam: name: StoreId in: header required: true description: '
An unique identifier of store within the merchant''s eco-system.
' schema: type: string minLength: 4 maxLength: 256 example: '1234' CredentialsParam: name: AuthorizationToken in: header required: true description: "The contents and usage of the AuthorizationToken header field\ndepends on the authentication type as defined by the\nAuthorizationType header field.
\n\nWhen using the OAUTH approach, consequent API requests are being authorized using the\nrespective OAuth Access Token. The access token is sent to the API using the AuthorizationToken header\nfield and the BEARER authentication schema as defined in RFC 6750.\n
Example: 'Bearer SlAV32hkKG'
If USERNAME_PASSWORD is used as AuthorizationType a JSON object\nlike: { 'username': 'Tester', 'password': 'thePassword' } is expected.\nThe given user must have the an appropriate group to access the system\nusing the CHANNEL_REST. Please see the TM documentation how to create\nand assign right, roles and groups to user.
\n" schema: type: string minLength: 4 maxLength: 256 PaymentProviderParam: name: PaymentProvider in: header required: true schema: $ref: '#/components/schemas/PaymentProvider' example: HUMM RetailUnitParam: name: RetailUnit in: header required: false description: 'The ID of the retail unit. ISO-3166 2 letter country code as a possibility, e.g. "se" for Sweden, "de" for Germany and "us" for USA. ' schema: type: string minLength: 2 maxLength: 10 example: se TimestampParam: name: Timestamp in: header required: true description: 'The timestamp when the PI-API call was initiated by the PI-API client. The format is defined by RFC3339 date-time.An unique identifier of a cashier - a natural person - within the\nmerchant's eco-system.
\n" schema: type: string minLength: 4 maxLength: 256 example: cashier1 X-Request-ID-Param: name: X-Request-ID in: header required: true description: 'ID of the request, unique to the call, as determined by the initiating party.