PreTransactions
GET api/pre-transactions
Gets pre-transactions by correlation id (Supports OData 4.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.
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 | [ |
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 | |||
---|---|---|---|
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.
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 | [ |
PUT api/pre-transactions/{partnerId}/{preTransactionId}/credit
Credit pre-transaction, if money is captured it will be refunded.
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. |
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 | |||
---|---|---|---|
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. |
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 | ||||
---|---|---|---|---|
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
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}. |
Feeling lost? Click on this link! Portal page