Payment-Gateway Service

Download OpenAPI specification:Download

The Emporix API Payment-Gateway Service allows you to manage your payment methods.


Key Features:

  • Create payment strategies
  • Configure payment methods per site
  • Get transaction logs
  • Enable refunds and cancellation
  • Capture payments

Key Benefits:

  • Simplify payment processes
  • React quickly to market needs and integrate with any payment provider
  • Give your customers the choice of their payment methods
  • Have an overview of transaction history

Payment

Authorizing a payment

Authorizes a given payment.


Required scopes

  • payment-gateway.authorize_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

Request Body schema: application/json
amountToAuthorize
number

Amount that should be authorized.

currency
string

Currency for the amount that should be authorized.

threeDSToken
string

Contains a token generated during the 3DS authentication process.

browserInfo
string

Holds information related to the user's web browser.

clientIP
string

Stores the Internet Protocol (IP) address of the client or user making a request or transaction.

object
paymentModeId
string

Identifier of a payment mode configured in the payment-gateway service for a given tenant.

creditCardToken
string

Indicates a payment method token, usually generated on a frontend site, when an user provides a credit card information.

Responses
200

Payment authorized

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

422

Unprocessable Entity. The payment action is not supported.

500

Internal Server Error.

post/{tenant}/payment/authorize
Request samples
application/json
{
  • "amountToAuthorize": 0,
  • "currency": "string",
  • "threeDSToken": "string",
  • "browserInfo": "string",
  • "clientIP": "string",
  • "order": {
    },
  • "paymentModeId": "string",
  • "creditCardToken": "string"
}
Response samples
application/json
{}

Capturing a payment

Creates a flow to capture a given payment transaction. The capture operation requires transactionId, thus it can be invoked only if the payment had been previously authorized.


Required scopes

  • payment-gateway.capture_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

transactionId
required
string

Unique identifier of a payment transaction.

Request Body schema: application/json
amount
number

Amount that should be captured. The amount should not be greater than amount that was authorized.

currency
string

Currency for the amount that should be captured.

Responses
200

Payment capture response

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

422

Unprocessable Entity. The payment action is not supported.

500

Internal Server Error.

post/{tenant}/payment/{transactionId}/capture
Request samples
application/json
{
  • "amount": 3.99,
  • "currency": "EUR"
}
Response samples
application/json
{
  • "successful": true,
  • "message": "string",
  • "captureId": "string"
}

Refunding a payment

Creates a flow to return a given payment. The refund operation requires transactionId, thus it can be invoked only if the payment has been authorized and captured previously.


Required scopes

  • payment-gateway.refund_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

transactionId
required
string

Unique identifier of a payment transaction.

Request Body schema: application/json
amount
number

Amount that should be refunded. The amount should not be greater than amount that was captured.

currency
string

Currency for the amount that should be refunded.

captureId
string

Capture identifier. The value is mandatory only if there were more captures for a payment and the refund should be related to a specific capture. In another case the value can be skipped and the capture related to the payment will be chosen automatically.

Responses
200

Payment transaction response

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

422

Unprocessable Entity. The payment action is not supported.

500

Internal Server Error.

post/{tenant}/payment/{transactionId}/refund
Request samples
application/json
{
  • "amount": 3.99,
  • "currency": "EUR"
}
Response samples
application/json
{
  • "successful": true,
  • "message": "Success!"
}

Cancelling a payment

Creates a flow to cancel a given payment transaction. The cancel operation requires transactionId, thus it can be invoked only if the payment has been authorized previously.


Required scopes

  • payment-gateway.cancel_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

transactionId
required
string

Unique identifier of a payment transaction.

Responses
200

Payment transaction response

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

422

Unprocessable Entity. The payment action is not supported.

500

Internal Server Error.

post/{tenant}/payment/{transactionId}/cancel
Request samples
Response samples
application/json
{
  • "successful": true,
  • "message": "Success!"
}

Payment mode

Creating a single payment mode entity

Creates a new payment mode for a given tenant. Currently the service supports the following payment methods:


Required scopes

  • payment-gateway.paymentmodes_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

Request Body schema: application/json
code
required
string

Indicates a code of a given method.

active
boolean

Indicates whether a give mode is active.

provider
required
string

Indicates which provider should be used.

Enum: "INVOICE" "CASH_ON_DELIVERY" "SPREEDLY" "SPREEDLY_SAFERPAY" "UNZER"
object

Map of configuration values for a particular gateway. Supported and required values for Spreedly:

  • Spreedly/GatewayToken - Indicates Spreedly gateway. Valid for SPREEDLY, SPREEDLY_SAFERPAY.
  • Spreedly/EnvironmentKey - Indicates Spreedly environment key. Valid for SPREEDLY, SPREEDLY_SAFERPAY.
  • Spreedly/AccessSecret - Indicates Spreedly access secret. Valid for SPREEDLY, SPREEDLY_SAFERPAY.
  • Spreedly/PaymentMethodType - Indicates payment method type, for example: paypal. Valid for SPREEDLY.
  • Spreedly/RedirectURL - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL. Valid for SPREEDLY.
  • Spreedly/SignatureSecret - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used. Valid for SPREEDLY.
  • Spreedly/SCAProviderToken - Indicates the Spreedly SCA (Strong Customer Authentication) provider token (3DS credit cart). Valid for SPREEDLY.
  • Spreedly/ReceiverId - Indicates the Spreedly Receiver identifier. Valid for SPREEDLY_SAFERPAY.
  • Saferpay/BasicAuth - Base64 encoded username and password of Saferpay account. Valid for SPREEDLY_SAFERPAY.
  • Saferpay/CustomerId - Saferpay customer ID. Valid for SPREEDLY_SAFERPAY.
  • Saferpay/TerminalId - Saferpay terminal ID. Valid for SPREEDLY_SAFERPAY.
  • Saferpay/TestEnvironment - Indicates if the configuration is done for test environment or a production one. If true then https://test.saferpay.com is used as a destination. Otherwise https://www.saferpay.com is used. Valid for SPREEDLY_SAFERPAY.
  • Saferpay/RedirectUrl - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL. Valid for SPREEDLY_SAFERPAY.
  • Unzer/PaymentMethodType - Indicates a payment method type. Currently supported value is PAYLATER_INVOICE. Valid for UNZER.
  • Unzer/PublicKey - Indicates a Unzer public key. Valid for UNZER.
  • Unzer/PrivateKey - Indicates a Unzer private key. Valid for UNZER.
  • Unzer/CustomerType - Indicates a customer type. Currently supported value is B2C. Valid for UNZER. requestBodies: { }
Responses
200

Payment mode configured in the payment-gateway service for a given tenant.

400

Bad request. The syntax of the request is incorrect.

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

409

Conflict. The resource already exists.

500

Internal Server Error.

post/{tenant}/paymentmodes/config
Request samples
application/json
{
  • "code": "paypal",
  • "active": true,
  • "provider": "SPREEDLY",
  • "configuration": {
    }
}
Response samples
application/json
{
  • "id": "92d77b2b-9385-43ad-a859-55176fbcbd36",
  • "code": "credit_card",
  • "active": true,
  • "provider": "SPREEDLY",
  • "configuration": {
    }
}

Retrieving a list of payment modes

Retrieves a list of configured payment modes for a given tenant.


Required scopes

  • payment-gateway.paymentmodes_read
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

Responses
200

Get all payment modes configured in the payment-gateway service for a given tenant.

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

500

Internal Server Error.

get/{tenant}/paymentmodes/config
Request samples
Response samples
[
  • {
    },
  • {
    },
  • {
    }
]

Retrieving a single payment mode

Retrieves a single payment mode configuration for a given tenant based on a payment mode identifier.


Required scopes

  • payment-gateway.paymentmodes_read
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

id
required
string

Unique identifier of a payment mode.

Responses
200

Payment mode configured in the payment-gateway service for a given tenant.

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

500

Internal Server Error.

get/{tenant}/paymentmodes/config/{id}
Request samples
Response samples
application/json
{
  • "id": "92d77b2b-9385-43ad-a859-55176fbcbd36",
  • "code": "credit_card",
  • "active": true,
  • "provider": "SPREEDLY",
  • "configuration": {
    }
}

Updating a single payment mode

Updates a single payment mode for a given tenant based on a unique mode identifier.


Required scopes

  • payment-gateway.paymentmodes_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

id
required
string

Unique identifier of a payment mode.

Request Body schema: application/json
active
boolean

Indicates whether a give mode is active.

object

Map of configuration values for a particular gateway. Supported and required values for Spreedly:

  • Spreedly/GatewayToken - Indicates Spreedly gateway.
  • Spreedly/EnvironmentKey - Indicates Spreedly environment key.
  • Spreedly/AccessSecret - Indicates Spreedly access secret.
  • Spreedly/PaymentMethodType - Indicates payment method type, for example: paypal.
  • Spreedly/RedirectURL - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL.
  • Spreedly/SignatureSecret - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used.
  • Spreedly/SCAProviderToken - Indicates the Spreedly SCA (Strong Customer Authentication) provider token (3DS credit cart). requestBodies: { }
Responses
200

Payment mode configured in the payment-gateway service for a given tenant.

400

Bad request. The syntax of the request is incorrect.

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

500

Internal Server Error.

put/{tenant}/paymentmodes/config/{id}
Request samples
application/json
{
  • "active": true,
  • "configuration": {
    }
}
Response samples
application/json
{
  • "id": "92d77b2b-9385-43ad-a859-55176fbcbd36",
  • "code": "credit_card",
  • "active": true,
  • "provider": "SPREEDLY",
  • "configuration": {
    }
}

Deleting a single payment mode

Deletes a single payment mode for a given tenant based on a unique mode identifier.


Required scopes

  • payment-gateway.paymentmodes_manage
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

id
required
string

Unique identifier of a payment mode.

Responses
200

OK

400

Bad request. The syntax of the request is incorrect.

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

500

Internal Server Error.

delete/{tenant}/paymentmodes/config/{id}
Request samples
Response samples
application/json
{
  • "code": 400,
  • "timestamp": "2023-10-03T12:23:31.485306Z",
  • "message": "The syntax of the request is incorrect."
}

Payment - frontend

Initializing a payment

Initializes a payment by accepting a request sent from the frontend.


Required scopes

  • No scope is required
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

Request Body schema: application/json
object
paymentModeId
string

Identifier of a payment mode configured in the payment-gateway service for a given tenant.

creditCardToken
string

Indicates a payment method token, usually generated on a frontend site, when an user provides a credit card information.

Responses
200

Payment initialized

400

Bad request. The syntax of the request is incorrect.

401

Unauthorized

422

Unprocessable Entity. The payment action is not supported.

500

Internal Server Error.

post/{tenant}/payment/frontend/initialize
Request samples
application/json
{
  • "order": {
    },
  • "paymentModeId": "string",
  • "creditCardToken": "string"
}
Response samples
application/json
{}

Authorizing a payment

Authorize a payment by accepting a request sent from the frontend.


Required scopes

  • No scope is required
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

Request Body schema: application/json
threeDSToken
string

Contains a token generated during the 3DS authentication process.

browserInfo
string

Holds information related to the user's web browser.

clientIP
string

Stores the Internet Protocol (IP) address of the client or user making a request or transaction.

object
paymentModeId
string

Identifier of a payment mode configured in the payment-gateway service for a given tenant.

creditCardToken
string

Indicates a payment method token, usually generated on a frontend site, when an user provides a credit card information.

Responses
200

Payment authorized

400

Bad request. The syntax of the request is incorrect.

401

Unauthorized

422

Unprocessable Entity. The payment action is not supported.

500

Internal Server Error.

post/{tenant}/payment/frontend/authorize
Request samples
application/json
{
  • "threeDSToken": "string",
  • "browserInfo": "string",
  • "clientIP": "string",
  • "order": {
    },
  • "paymentModeId": "string",
  • "creditCardToken": "string"
}
Response samples
application/json
{}

Payment mode - frontend

Retrieving all the payment modes

Retrieves a list of configured payment modes for a given tenant with publicly available properties (excluding all secrets, signatures etc). The endpoint should be used by a frontend application to fetch all the possible payment methods configured for a particular tenant.


Required scopes

  • No scope is required
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

Responses
200

Payment modes configured in the payment-gateway service for a given tenant that returns only properties publicly available.

401

Unauthorized

get/{tenant}/paymentmodes/frontend
Request samples
Response samples
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Retrieving a single payment mode

Retrieves a single payment mode for a given tenant with publicly available properties (excluding all secrets, signatures etc). The endpoint should be used by a frontend application to fetch a payment method configuration for a particular tenant.


Required scopes

  • No scope is required
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

id
required
string

Unique identifier of a payment mode.

Responses
200

Payment modes configured in the payment-gateway service for a given tenant that returns only properties publicly available.

401

Unauthorized

404

Not found. The resource does not exist.

get/{tenant}/paymentmodes/frontend/{id}
Request samples
Response samples
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Transaction

Retrieving many transactions

Retrieves many payment transactions. A particular transaction contains all transactions' events attached as an entries of the response body.


Required scopes

  • payment-gateway.paymenttransactions_read
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

query Parameters
pageNumber
integer >= 1
Default: 1

The page number to be retrieved, where the size of the pages is specified by the pageSize parameter. The number of the first page is 1.

pageSize
integer [ 1 .. 50 ]
Default: 50

The number of documents being retrieved on one page.

sort
string

Fields to sort the response data by following the order of the parameters from left to right. Can contain multiple fields in the following format: field name:sort direction, separated by a comma. The colon preceding the sort direction parameter is optional, and the descending order is taken only if it is equal to desc or DESC. The ascending order is assumed in any other case.

Example: sort=sort=name,metadata.createdAt:desc
header Parameters
X-Total-Count
boolean

To get information how many entities meet the filtering requirements, the X-Total-Count header has been introduced. The header is optional and its default value is false. If the header is provided and it is set to true, then the total count is returned in the X-Total-Count response header. In both cases (X-Total-Count true, false or not provided), the response body has the same format (array of entities). This means that the information about the total count is returned only on demand, provided that the X-Total-Count header is present in a request.

Responses
200

Payment transactions response

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

500

Internal Server Error.

get/{tenant}/transactions
Request samples
Response samples
application/json
[
  • {
    }
]

Retrieving a single transaction

Retrieves a single payment transaction. The transaction contains all the transaction's events attached as an entries of the response body.


Required scopes

  • payment-gateway.paymenttransactions_read
SecurityOAuth2
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name. Note: The tenant name should always be written in lowercase.

transactionId
required
string

Unique identifier of a payment transaction.

Responses
200

Payment transaction response

401

Unauthorized

403

Access forbidden. The caller is not allowed to access this resource.

404

Not found. The resource does not exist.

500

Internal Server Error.

get/{tenant}/transactions/{transactionId}
Request samples
Response samples
application/json
{
  • "id": "d8abfb12-0266-43dc-905e-415158029d45",
  • "provider": "SPREEDLY",
  • "paymentInformation": {
    },
  • "entries": [
    ]
}