Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Authorization Requirement

Important: All requests to this endpoint must be authorized using a bearer token. Ensure that your API calls include a valid token in the header to authenticate and gain access to the endpoint functionalities.

GET api/pre-transactions

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

Expand
titleExample
Code Block
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

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

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.

Expand
titleExample - for all fields in the response follow the link
Code Block
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

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

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

Expand
titleExample
Code Block
Request:
GET /api/pre-transactions/url/{partnerId}/{referenceId}

Response:
"{some-url}/ref/{partnerId}/{referenceId}"

Request

Name

Description

Data Type

Example

partnerId

PartnerId. Provided to you by LINK Mobility.

int

10295

referenceId

string

“random-string”

Response information

Name

Description

Data Type

Example

URI

Pretransaction url

URI

https://some-url


POST api/pre-transactions

Creates a new pre-transaction.

Expand
titleExample - for all fields in the request follow the link
Code Block
Request:
POST /api/pre-transactions/
{
  "sourceId": 0,
  "partnerId": 0,
  "expiryUtc": "2023-11-28T14:38:09.642Z",
  "correlationId": "string",
  "viewTemplateName": "string",
  "returnUrl": "string",
  "statusCallbackUrl": "string",
  "smsStatusCallbackUrl": "string",
  "expiredUrl": "string",
  "cancelUrl": "string",
  "skipLandingPage": true,
  "referenceId": "string",
  "ocr": "string",
  "msisdn": "string",
  "smsNotificationOriginator": "string",
  "smsNotificationText": "string",
  "smsNotificationSendTimeUtc": "2023-11-28T14:38:09.642Z",
  "description": "string",
  "currency": "string",
  "amount": 0,
  "paymentProviders": [
        "Payment",
        "Providers",
        "List"
    ],
  "paymentOperation": "string",
  "campaignId": 0,
  "authentication": {
    "authenticationMethods": [
      "string"
    ],
    "socialSecurityNumber": "string"
  },
  "customProperties": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "accessedURLDateUtc": "2023-11-28T14:38:09.642Z",
  "enableRecurring": true,
  "customAmountEnabled": true,
  "subscriberId": "string",
  "recurringOptional": true,
  "recurringId": "00000000-0000-0000-0000-000000000000",
  "sendSms": true,
  "orderNumber": "string",
  "language": "string",
  "segment": "string",
  "customLandingPageUrl": "string",
  "minAmount": 0,
  "customAmounts": [
    0
  ]
}

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.

Expand
titleExample
Code Block
Request:
PUT /api/pre-transactions/{partnerId}/{preTransactionId}/credit
{
"sample string 1"
}

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

Name

Description

Data Type

Example

Amount

string

“amount“

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

Expand
titleExample
Code Block
Request:
PUT api/pre-transactions/{partnerId}/{preTransactionId}/capture

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

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.

Expand
titleExample
Code Block
Request:
PUT /api/pre-transactions/{partnerId}/{preTransactionId}/paid?
PUT /api/pre-transactions/{partnerId}/{preTransactionId}/paid?paymentTransactionId={paymentTransactionId}&statusDescription={statusDescription}

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

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

Expand
titleExample
Code Block
Request:
PUT api/pre-transactions/ref/{partnerId}/{referenceId}/paid?paymentTransactionId={paymentTransactionId}&statusDescription={statusDescription}

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

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}.