Create Prepayment/Pay by Invoice
In the API-only flow, merchants can initiate prepayment transactions directly via API without using the SmartPay widget. This method allows full backend control over the transaction process. When a merchant triggers a prepayment through the API, they provide details such as the transaction amount, currency, customer details, billing address, etc. The API responds with an authorization and a unique invoice reference, which the merchant includes on the buyer's invoice.
The buyer uses this invoice reference to complete the payment, ensuring that the payment is correctly associated with the transaction. This approach allows merchants to handle the entire payment process backend-only, streamlining operations without needing a frontend integration with the SmartPay widget.
This endpoint uses the SmartPay BaseURL and Authorization.
Prepayment initiation as API-only
Request
Path:
POST {baseUrl}/payment/authorize
Header:
Content-Type: application/json
Accept-Language: en-US
Authorization: Basic M2lwN2Yx...OGU3Mg==
{
"merchantKey": "bec422d6-b944-46f4-8cc1-a2896e340553",
"payment": {
"currencyCode": "EUR",
"amount": 50.99,
"description": "SMP-Transaction-01"
},
"billingAddress": {
"addressLine1": "Leopoldstrasse",
"number": "244",
"city": "Munich",
"postCode": "80807",
"countryCode": "DE"
},
"shippingAddress": {
"addressLine1": "Leopoldstrasse",
"number": "244",
"city": "Munich",
"postCode": "80807",
"countryCode": "DE"
},
"consumer": {
"emailAddress": "email@mail.com",
"gender": "f",
"lastName": "John",
"firstName": "Jonnion",
"middleName": "",
"title": "Mr",
"culture": "en-en",
"dateOfBirth": "2000-01-01",
"mobilePhone": "015xx22-2135466",
"taxId": "00745948504594"
},
"paymentOption": {
"invoicePayment": {
"type": "PREPMNT"
}
}
}
API Parameters:
Name | Description | Type |
---|---|---|
paymentOption | Details of the payment. | Object |
invoicePayment | Details of the invoice. | Object |
type | Either prepayment - PREPMNT, or Pay upon Invoice - PAYINVC. | String |
Response
Status Code:
201 (prepayment successfully created)
Header:
Content-Type: application/json
Accept-Language: en-US
{
"description": "SMP-Transaction-01",
"paymentStatus": "CAPTURED",
"creationDate": "2024-10-09T10:50:15.708Z",
"lastStatusDate": "2024-10-09T10:50:19.705Z",
"transactionOverview": {
"transactionId": "9b02425b-f346-4f16-892b-6716d5ecf9ac",
"paymentMethod": "PREPMNT",
"amount": 50.99,
"currencyCode": "EUR",
"mit": false,
"paymentOrigin": "PAYMENT_AUTHORIZE_S2S"
},
"reconciliationReferenceId": "sYfon1IJl9iZ7bpsa7fXO",
"transactionReference": "119344737107896",
"modificationId": "9b02425b-f346-4f16-892b-6716d5ecf9ac"
}