Payment sessions

Create payment session

Creates a payment session. The response contains a sessionUrl that is used to redirect the customer to the payment page — you can use it as the src attribute in a link or iframe.

post/v3/payment/sessions

Request

  • Base URL: https://test-api.kashier.io
  • URL: https://test-api.kashier.io/v3/payment/sessions
  • Auth: API key in header Authorization and API key in header api-key

Request body

expireAtstring required

When the payment session expires. Must be a future ISO 8601 timestamp.

maxFailureAttemptsinteger required

Maximum number of payment attempts.

paymentTypestring

Payment type, e.g. credit.

amountstring required

Order amount, e.g., 100.

currency'EGP' | 'USD' | 'GBP' | 'EUR' required

Order currency, e.g., EGP.

orderstring required

Unique order identifier. (The docs' body table names this field orderId, but request and response examples use order.)

merchantIdstring required

Merchant account number or merchant ID, e.g., MID-123-123.

modestring

Mode of operation, test or live, e.g., mode="test". (Documented in the body table but not present in the docs' request example.)

descriptionstring

Order description; must be less than 120 characters.

allowedMethodsstring

Defines allowed payment methods. Default: card, bank_installments, wallet, bnpl. If you want to display only a specific provider (for example, Valu or QNB), you can do so by specifying it within array brackets alongside its payment method. For example: bnpl[valu], bank_installments[qnb], and so on.

defaultMethodstring

To determine which method you want PaymentUI to open on. By default PaymentUI opens on card method. defaultMethod accepts the pattern "method,provider/abbreviation". Example: for the installment method use bank_installments; to open PaymentUI on certain installment plans of NBE bank use bank_installments,NBE.

merchantRedirectstring required

merchantRedirect should be URI encoded: urlencode(https://www.your_website.com/redirect)

serverWebhookstring

Pass an endpoint to receive server-to-server notifications. Your application only needs a page that accepts unauthenticated POST requests; the event object is sent as JSON in the request body.

redirectMethodstring nullable

The redirection method after payment. Default method is get, ex: redirectMethod="post"

failureRedirectboolean

To choose to redirect after first payment failure or not. Its value is TRUE or FALSE; default value is TRUE.

connectedAccountstring

Used in case of making payments on behalf of your Connected Account by passing the Sub Merchant/Connected Account Merchant Id, e.g. connectedAccount="MID-452-644".

typestring required

Defines the type of Kashier origin. Default: external.

brandColorstring

Specifies branding color using a hex or rgba value. Default: rgba(45, 164, 78, 0.9).

display'ar' | 'en' required

Specifies the display language of the I-frame. Options: ar or en.

iframeBackgroundColorstring

Background color of the payment iframe, e.g. #FFFFFF.

manualCaptureboolean

TRUE: Authorize first, then capture/release. FALSE: Direct capture without authorization.

saveCard'optional' | 'forced'

Defines if card information is saved. Options: optional or forced.

retrieveSavedCardboolean

Whether to retrieve the customer's saved cards on the payment page.

interactionSource'MOTO' | 'ECOMMERCE'

Must be MOTO or ECOMMERCE when using a token or saving a card for repeat payments.

enable3DSboolean

TRUE: Enables 3DS for saved card payments. FALSE: Disables 3DS.

notesstring

Add any additional information about this payment. This could include special instructions, or context for the recipient.

Response

Payment session created. sessionUrl redirects the customer to the payment page.

status'CREATED' | 'OPENED' | 'PENDING' | 'ABANDONED' | 'PAID' | 'FAILED' | 'EXPIRED' | 'AUTHORIZED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' | 'REFUND_PENDING' | 'VOIDED' | 'REVERSED' | 'REJECTED'

Where a payment session currently is. A session starts CREATED, becomes OPENED when the customer lands on the payment page, PENDING while an attempt is in flight, and then settles into one of the final states. ABANDONED is what Abandon a payment session sets; EXPIRED is what the session reaches on its own at expireAt.

failureAttemptsinteger
capturedAmountnumber
refundedAmountnumber
_idstring
merchantIdstring
expireAtstring
maxFailureAttemptsinteger
paymentParamsobject

The payment parameters the session was created with (echoed back, plus hash/store info).

apiKeystring
createdAtstring
updatedAtstring
__vinteger
sessionUrlstring

The URL that will be used to redirect the customer to the payment page. You can use it as the src attribute in a link or iframe.

Changes

No recorded changes to this operation across all 1 revision of this API.