deprecated
This guide is for the deprecated Flex.API. Please don't use it for new implementations.
See Integration Options, and feel welcome to ask our friendly help desk.
This is by far the most important API request of the Flex.API. In order to create a new payment transaction you send a POST
request to /payment/init
.
POST /payment/init HTTP/1.1
Host: api-testing.secuconnect.com
Content-Type: application/json; charset=utf-8;
Accept: application/json
Accept-Charset: utf-8
{
"data"
: {
"apikey"
:
"6801fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7ace"
,
"payment_type"
:
"debit"
,
"demo"
: 1,
"payment_action"
:
"sale"
,
"url_success"
:
"https://example.org/SUCCESS"
,
"url_failure"
:
"https://example.org/FAILURE"
,
"url_push"
:
"https://example.org/PUSH"
,
"apiversion"
:
"2.11"
,
"language"
:
"de_DE"
,
"title"
:
"Herr"
,
"firstname"
:
"Max"
,
"lastname"
:
"Mustermann"
,
"street"
:
"Musterstr."
,
"housenumber"
:
"112 a"
,
"zip"
:
"09555"
,
"city"
:
"Musterhausen"
,
"country"
:
"DE"
,
"telephone"
:
"+4912342134123"
,
"dob_value"
:
"01.02.1903"
,
"email"
:
"max@example.org"
,
"ip"
:
"172.31.6.49"
,
"currency"
:
"EUR"
,
"amount"
:
"199"
,
"purpose"
:
"Test order 1"
}
}
Parameter overview:
Attribute | Type | Description |
---|---|---|
|
| Your individual API key. It identifies the merchant, determines the contract, and grants access to the API. 40 alphanumeric digits like |
|
| Determines the payment method:
You can only use the contracted methods. The same method might be active in demo mode or not. Please ask our customer service for more payment methods. |
|
| Optional demo flag:
If ommitted, it defaults to Please be careful with the flag and make sure to remove the demo parameter for transactions in the productive environment. |
|
| Optional. Determines the workflow:
In the Having the If omitted, the payment action defaults to |
|
| Optional, the language of the payment window:
If omitted, it defaults to |
|
| Optional |
|
| First name(s), like |
|
| Last name(s), like |
|
| Optional company name, like |
|
| Street without house number, like |
|
| Full house number (including additions for split or joined properties; for example, |
|
| Postal code, like |
|
| Official town name. |
|
| Country as ISO-3166 Alpha-2 code; for example |
|
| Phone number (international format), like |
|
| Optional date of birth (format example |
|
| E-mail address. |
|
| IP address of the buyer as string. |
|
| Amount to pay in the smallest unit; for example Monetary amounts are expressed in the smallest currency unit (e. g. Euro Cent). |
|
| Optional currency as ISO-4217 Alpha-3 code; for example If omitted, the currency defaults to Euro ( |
|
| Optional purpose line. It is displayed for each position (a) at the bank statement of the payer, and (b) at our detailed advice note for the merchant. For example |
|
| Optional API version, for example |
|
| URL to return in case of success. See section Return Customer To Merchant Page. |
|
| URL to return in any case of failure. See section Return Customer To Merchant Page. |
|
| URL to receive push messages on status changes. See section Receive Status Notifications (Push API). |
If everthing is fine, the API responds with 200 OK
:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8;
...
{
"status"
:
"ok"
,
"data"
: {
"hash"
:
"tujevzgobryk3303"
,
"iframe_url"
:
"https://api.secupay.ag/payment/tujevzgobryk3303"
},
"errors"
: null
}
As you remember from the Getting Started section, the hash is needed for subsequent API calls, and the iframe URL displays our payment window.
Parameter overview:
Attribute | Type | Description |
---|---|---|
|
| Whether the query was successful or not:
|
|
| Transaction identifier, needed for subsequent API calls. |
|
| URL for authorisation or payment, depending on the Despite its name, you should not open the
|