Payment

Authorizing a payment

post

Authorizes a given payment.

Required scopes
This endpoint requires the following scopes:
  • : Needed to perform a payment authorization flow by a tenant employee.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
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
all ofOptional
Responses
200

Payment authorized

application/json
Responseall of
post
/payment-gateway/{tenant}/payment/authorize
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

{
  "order": {
    "id": "text"
  },
  "paymentModeId": "text",
  "creditCardToken": "text",
  "threeDSToken": "text",
  "browserInfo": "text",
  "clientIP": "text",
  "amountToAuthorize": 1,
  "currency": "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
This endpoint requires the following scopes:
  • : Needed to perform a payment capture flow by a tenant employee.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
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
/payment-gateway/{tenant}/payment/{transactionId}/capture
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
This endpoint requires the following scopes:
  • : Needed to perform a payment refund flow by a tenant employee.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
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
/payment-gateway/{tenant}/payment/{transactionId}/refund
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
This endpoint requires the following scopes:
  • : Needed to perform a payment cancel flow by a tenant employee.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
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
/payment-gateway/{tenant}/payment/{transactionId}/cancel
POST /payment-gateway/{tenant}/payment/{transactionId}/cancel HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "successful": true,
  "message": "Success!"
}

Last updated

Was this helpful?