VAS MTM API 2.0.2

WebSockets API to connect to MultiPay APM.

General information:

  • All WebSocket messages sent/received should be plain text (JSON) messages
  • Mandatory parameters for connection to API:
Parameter Type Description
Authorization Header Oauth2 bearer token obtained from authorization endpoint
X-Terminal-Id Header This is a unique terminal identifier

Production URL's will be provided after successful integration in test environment

Error handling

If an expected (or unexpected) error occurs, a problem will be sent to the client with a description and a "mappable" type.

Known problem-types:

Type Example description Example use case
apm.mtm.input-error PaymentReceiptId must be a numeric value Returned when a refund is initiated with a non-numeric receiptId
apm.mtm.merchant-validation-error Merchant with id: xxx is not configured correctly in MultiPay Returned when there is something wrong with the merchant setup in MultiPay
apm.mtm.payment-not-found Payment was not found by receiptId: 123456789 Returned when a refund is initiated, but not found in MultiPay
apm.mtm.payment-already-refunded Payment already refunded Returned when a payment is already refunded
apm.mtm.unexpected-error Failed to cancel payment with id: 123456789 towards MultiPay APM API Something unexpected happens, i.e no response from MultiPay

Servers

  • apm.dev.payex.comwsstest

    Public server that requires authorization.

    Example of how to fetch a token to use with this API (client_id and client_secret will be provided by us).

    curl -X POST "https://apm.dev.payex.com/authorization/oauth/token" \
          -H "Content-Type: application/x-www-form-urlencoded" \
          --data-urlencode "grant_type=client_credentials" \
          --data-urlencode "client_id=XXXX" \
          --data-urlencode "client_secret=XXXX" \
          --data-urlencode "scope=terminal"
    
    Security:

Operations

  • SUB /ws

    Send messages to the API

    • When sending a PAYMENT_INIT_REQUEST the server will response with a PAYMENT_INIT_RESPONSE message.
    • When sending a STATUS_UPDATE (used for cancel) the server will respond with a STATUS_UPDATE message as a confirmation.
    • When sending a REFUND the server will respond with a PAYMENT_RECEIPT message as a confirmation when the refund is complete.
    Operation IDprocessReceivedMessage

    Available only on servers:

    Accepts one of the following messages:

    • #0PAYMENT_INIT_REQUEST
      Message IDPAYMENT_INIT_REQUEST

      This is sent from client to server when a "POST-flow" is initiated

      object

      Examples

    • #1STATUS_UPDATE
      Message IDSTATUS_UPDATE

      This can be sent from server to client if a end-used decides to abort payment. It can also be sent from client to server to indicate the payment was aborted in terminal

      object

      Examples

    • #2REFUND
      Message IDREFUND

      This is sent from client to server to initiate a refund. It will result in a "PAYMENT_RECEIPT" response sent from server til client when refund is completed.

      object

      Examples

  • PUB /ws

    Messages that you receive from the API

    • Once connected to WebSocket API, a LOGON_CONFIRMATION message will be sent from server.
    • When end-user finalizes payment PAYMENT_RECEIPT message will be sent from server.
    • If the end-user aborts the payment, a STATUS_UPDATE message with state CANCELED will be sent from server.
    • If an unexpected problem occurs, a PROBLEM message will be sent from server.
    Operation IDsendMessage

    Available only on servers:

    Accepts one of the following messages:

    • #0LOGON_CONFIRMATION
      Message IDLOGON_CONFIRMATION

      This is returned to client when a successful logon/subscribe is done

      object

      Examples

    • #1GET_PAYMENT_REQUEST
      Message IDGET_PAYMENT_REQUEST

      This is sent from server to client when a "GET-flow" is initiated

      object

      Examples

    • #2PAYMENT_INIT_RESPONSE
      Message IDPAYMENT_INIT_RESPONSE

      This is sent from server to client as a response to PAYMENT_INIT_REQUEST

      object

      Examples

    • #3STATUS_UPDATE
      Message IDSTATUS_UPDATE

      This can be sent from server to client if a end-used decides to abort payment. It can also be sent from client to server to indicate the payment was aborted in terminal

      object

      Examples

    • #4PAYMENT_RECEIPT
      Message IDPAYMENT_RECEIPT

      This is sent from server to client when a payment has been completed

      object

      Examples

    • #5PROBLEM
      Message IDPROBLEM

      This is sent from server to client when a unexpected problem occurs

      object

      Examples

Messages

  • #1LOGON_CONFIRMATION
    Message IDLOGON_CONFIRMATION

    This is returned to client when a successful logon/subscribe is done

    object
  • #2GET_PAYMENT_REQUEST
    Message IDGET_PAYMENT_REQUEST

    This is sent from server to client when a "GET-flow" is initiated

    object
  • #3PAYMENT_INIT_RESPONSE
    Message IDPAYMENT_INIT_RESPONSE

    This is sent from server to client as a response to PAYMENT_INIT_REQUEST

    object
  • #4PAYMENT_INIT_REQUEST
    Message IDPAYMENT_INIT_REQUEST

    This is sent from client to server when a "POST-flow" is initiated

    object
  • #5STATUS_UPDATE
    Message IDSTATUS_UPDATE

    This can be sent from server to client if a end-used decides to abort payment. It can also be sent from client to server to indicate the payment was aborted in terminal

    object
  • #6PAYMENT_RECEIPT
    Message IDPAYMENT_RECEIPT

    This is sent from server to client when a payment has been completed

    object
  • #7REFUND
    Message IDREFUND

    This is sent from client to server to initiate a refund. It will result in a "PAYMENT_RECEIPT" response sent from server til client when refund is completed.

    object
  • #8PROBLEM
    Message IDPROBLEM

    This is sent from server to client when a unexpected problem occurs

    object

Schemas

  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object

    Payment details

  • array<any>

    Optional array of products

  • object

    Merchant information

  • paymentId
    string
    format: uuid

    Unique identifier for payment request

  • currencyIso
    string

    Currency ISO string (3-letter code) ISO_4217

      Allowed values:
    • "NOK"
    • "SEK"
    • "EUR"
    • "USD"
  • paymentState
    string

    Payment state

      Allowed values:
    • "PENDING"
    • "COMPLETE"
    • "CANCELED"
    • "REVERSED"
    • "ERROR"
  • object

    Customer information

  • customerOrderId
    string
    format: uuid

    TODO:: Denne må beskrives med noe fornuftig

  • saleTransactionId
    string
    format: uuid

    TODO:: Denne må beskrives med noe fornuftig