PreTransactions

GET api/pre-transactions

Gets pre-transactions by correlation id (Supports OData 4.0).

Request: GET api/pre-transactions?partnerId={partnerId}&correlationId={correlationId} Response: [ { "preTransactionId": "452c1d44-5a0d-4216-b5da-a4533036e010", "correlationId": "sample string 2", "msisdn": "sample string 3", "currency": "sample string 4", "amount": 5.0 } ]

Request information

Request information

Name

Value

Description

Data Type

Example

partnerId

required

PartnerId. Provided to you by LINK Mobility.

int

10295

correlationId

required

Correlation id - can be anything the consumer of the API needs.

string

“random-string”

Response information

Response information

Name

Description

Data Type

Example

PreTransactionId

Pre-transaction id.

GUID

“452c1d44-5a0d-4216-b5da-a4533036e010“

CorrelationId

Correlation id - can be anything the consumer of the API needs.

String

“random-string”

Msisdn

Phone number used by phone payment and for sending sms notification.

String

“+47 123 123 123”

Currency

Currency code (ISO-4217).

String

“EUR“

Amount

Amount (supports 2 decimals).

Decimal

10.25



GET api/pre-transactions/ref/{partnerId}/{referenceId}

Gets pre-transaction by partner id and pre-transaction id.

Request: GET /api/pre-transactions/ref/{partnerId}/{referenceId} Response: [ { "preTransactionId": "452c1d44-5a0d-4216-b5da-a4533036e010", "smsNotificationSent": false, "smsNotificationDelivered": false, "smsNotificationParts": 0, "mobileInvoiceUrl": "url", "partnerId": partnerId, "expiryUtc": "dateUTC", "statusCallbackUrl": "url", "smsStatusCallbackUrl": "url", "referenceId": "referenceId", "ocr": "12345678", "msisdn": "phone number", "smsNotificationOriginator": "1234", "smsNotificationText": "text", "smsNotificationSendTimeUtc": "dateUtc", "description": "some text", "currency": "USD", "amount": 1.00, "paymentProviders": [ "Payment", "Providers", "List" ], "sendSms": false } ]

Request information

Request information

Name

Value

Description

Data Type

Example

partnerId

required

PartnerId. Provided to you by LINK Mobility.

int

10295

referenceId

required

 

string

“random-string”

Response information - required fields only

Response information - required fields only

Name

Description

Data Type

Example

PartnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

Currency

Currency code (ISO-4217)

string

“EUR”

Amount

Amount to charge customer. With or without 2 decimals. Example: 1 or 1.00

decimal

10.25

PaymentProviders

Possible PaymentProviders that you support. The user will be able to choose from these on the payment landing page.

Collection of string

[
“Payment“,
”Providers”,
”List”
]



GET api/pre-transactions/url/{partnerId}/{referenceId}

Gets pre-transaction url by partnerId and referenceId. This method will not evaluate the existence of the pre transaction

Request: GET /api/pre-transactions/url/{partnerId}/{referenceId} Response: "{some-url}/ref/{partnerId}/{referenceId}"

Request

Request

Name

Description

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

referenceId

 

string

“random-string”

Response information

Response information

Name

Description

Data Type

Example

URI

Pretransaction url

URI

https://some-url


POST api/pre-transactions

Creates a new pre-transaction.

Request (body)

Request (body)

Name

Description

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

Currency

Currency code (ISO-4217) in UPPER case.

string

“USD”

Amount

Amount to charge customer. With or without 2 decimals.

decimal

10.25

PaymentProviders

Possible PaymentProviders that you support. The user will be able to choose from these on the payment landing page

Collection of string

[
“Payment“,
”Providers”,
”List”
]

 


PUT api/pre-transactions/{partnerId}/{preTransactionId}/credit

Credit pre-transaction, if money is captured it will be refunded.

Request URI

Request URI

Name

Description

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

preTransactionId

Pre-transaction id.

GUID

“452c1d44-5a0d-4216-b5da-a4533036e010“

Request Body

Request Body

Name

Description

Data Type

Example

 

Amount

string

“amount“

Response information

Response information

Status Code

Description

Message

200

OK

 

400

Bad Request

Refund amount is greater than the remaining amount on the invoice.
Pre-transaction id '{preTransactionId}' failed crediting {message}

403

Forbidden

Pre-transaction id '{preTransactionId}' failed crediting {status}.

404

Not Found

Pre-transaction id '{preTransactionId}' doesn't have matching payment.

500

Internal Server Error

Pre-transaction id '{preTransactionId}' failed crediting {message}.


PUT api/pre-transactions/{partnerId}/{preTransactionId}/capture

Capture authorized pre-transaction

Request

Request

Name

Description

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

preTransactionId

Pre-transaction id.

GUID

“452c1d44-5a0d-4216-b5da-a4533036e010“

Response information

Response information

Status Code

Description

Message

200

OK

 

400

Bad Request

Unable to capture pre-transaction id '{preTransactionId}': No transaction found.
Unable to capture pre-transaction id '{preTransactionId}' with transaction status '{transaction.StatusCode}' - only 'Authorized' transactions are supported.

403

Forbidden

Unable to capture pre-transaction id '{preTransactionId}': {status}

404

Not Found

Pre-transaction id '{preTransactionId}' not found.

500

Internal Server Error

Pre-transaction id '{preTransactionId}' failed capture {message}.


PUT api/pre-transactions/{partnerId}/{preTransactionId}/paid

Credit pre-transaction, if money is captured it will be refunded.

Request

Request

Name

Description

Required

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

required

int

10295

preTransactionId

Pre-transaction id.

required

GUID

“452c1d44-5a0d-4216-b5da-a4533036e010“

paymentTransactionId

External transaction id.

optional

string

“some-string“

statusDescription

Description of the payment status.

optional

string

“some-string“

Response information

Response information

Status Code

Description

Message

200

OK

 

400

Bad Request

Unable to set pre-transaction id '{preTransactionId}' as paid: It is already captured.

404

Not Found

Pre-transaction id '{preTransactionId}' not found.

500

Internal Server Error

Pre-transaction id '{preTransactionId}' failed setting as paid {message}.


PUT api/pre-transactions/{partnerId}/{preTransactionId}/paid

Set pre-transaction via referenceId as paid externally through other channel

Request

Request

Name

Description

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

referenceId

Reference id.

string

“some-string““

paymentTransactionId

External transaction id.

string

“some-string“

statusDescription

Description of the payment status.

string

“some-string“

Response information

Response information

Status Code

Description

Message

200

OK

 

400

Bad Request

Unable to set pre-transaction with reference id '{referenceId}' as paid: It is already captured.

404

Not Found

Pre-transaction with reference id '{referenceId}' not found.

500

Internal Server Error

Pre-transaction with reference id '{referenceId}' failed setting as paid {message}.

Feeling lost? Click on this link! Portal page