Payment

Authorizing a payment

post

Authorizes a given payment.


Required scopes

  • payment-gateway.authorize_manage

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

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

Pattern: ^[a-z][a-z0-9]+$
Body
amountToAuthorizenumberOptional

Amount that should be authorized.

currencystringOptional

Currency for the amount that should be authorized.

Responses
200
Payment authorized
application/json
post
POST /payment-gateway/{tenant}/payment/authorize HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 172

{
  "amountToAuthorize": 1,
  "currency": "text",
  "threeDSToken": "text",
  "browserInfo": "text",
  "clientIP": "text",
  "order": {
    "id": "text"
  },
  "paymentModeId": "text",
  "creditCardToken": "text"
}
{
  "successful": true,
  "paymentTransactionId": "FTrjO4SrNF0Had7yBCeVU5ziqwL",
  "requiresExternalPayment": true,
  "externalPaymentRedirectURL": "https://www.sandbox.paypal.com/checkoutnow?token=0SC35196GX656501J",
  "externalPaymentParameters": {}
}

Capturing a payment

post

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

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

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

Pattern: ^[a-z][a-z0-9]+$
transactionIdstringRequired

Unique identifier of a payment transaction.

Body
amountnumberOptional

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

currencystringOptional

Currency for the amount that should be captured.

Responses
200
Payment capture response
application/json
post
POST /payment-gateway/{tenant}/payment/{transactionId}/capture HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "amount": 3.99,
  "currency": "EUR"
}
{
  "successful": true,
  "message": "text",
  "captureId": "text"
}

Refunding a payment

post

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

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

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

Pattern: ^[a-z][a-z0-9]+$
transactionIdstringRequired

Unique identifier of a payment transaction.

Body
amountnumberOptional

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

currencystringOptional

Currency for the amount that should be refunded.

captureIdstringOptional

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
application/json
post
POST /payment-gateway/{tenant}/payment/{transactionId}/refund HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "amount": 3.99,
  "currency": "EUR"
}
{
  "successful": true,
  "message": "Success!"
}

Cancelling a payment

post

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

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

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

Pattern: ^[a-z][a-z0-9]+$
transactionIdstringRequired

Unique identifier of a payment transaction.

Responses
200
Payment transaction response
application/json
post
POST /payment-gateway/{tenant}/payment/{transactionId}/cancel HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "successful": true,
  "message": "Success!"
}

Was this helpful?