Skip to content

Purchase API

Credit card purchase using Nets Payment Service Provider

Section titled “Credit card purchase using Nets Payment Service Provider”

Vimonds Nets payment integration supports purchase with credit card. The purchase flow consists of an initialize call and entering of credit card information, followed by a callback from Nets.

A subscription purchase is initialized using the following endpoint:

curl --location --request POST 'http://{api-domain}/api/{platform}/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId},
"productPaymentId": {productPaymentId},
"callbackUrl": "{api-domain}/{platform}/order/callback",
"payment": {
"paymentMethod": "CREDITCARD"
}
}
}'

Example response:

{
"autorenewStatus": "NOT_STARTED",
"earliestEndDate": "2020-01-16T10:57:04Z",
"endDate": "2020-01-17T10:57:04Z",
"accessEndDate": "2020-01-17T16:57:04Z",
"id": 8051,
"price": 414.1,
"initPrice": 10.0,
"productName": "Product group 1 subscription-20-days",
"productId": 2,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-16T10:57:04Z",
"userId": 10018,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10041,
"orderRef": "ee6181495d2a417086d80d1206c030f5",
"status": "INITIALIZE",
"paymentObject": {
"callbackUri": {},
"initializeUri": {},
"url": "{Nets redirect url}",
"name": "Nets",
"paymentMethod": "CREDITCARD",
"redirectUrl": {}
},
"currency": "NOK",
"userPaymentMethod": {},
"autorenewErrors": 0,
"statusText": "Purchase initialized",
"registered": "2020-01-16T10:57:04Z",
"activePeriods": 1,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"paymentMethod": "CREDITCARD",
"period": "P20D"
}

The url present in order.payment.url is a link to a nets window where end user should enter the credit card information. Once done, Nets will validate the credit card and make a callback to the callbackUrl sent in the initialize request. The Vimond API then makes a charge towards Nets. The callback request will typically look something like this:

curl --location --request GET 'http://{api-domain}/api/{platform}/order?token={token added by vimond to the callback url}&transactionId={nets transaction ID}&responseCode={nets response code}' \
--header 'Accept: application/xml'

Example response:

<order uri="/api/web/order/8051">
<autorenewStatus>ACTIVE</autorenewStatus>
<earliestEndDate>2020-01-16T10:57:04Z</earliestEndDate>
<endDate>2020-01-17T10:57:04Z</endDate>
<accessEndDate>2020-01-17T16:57:04Z</accessEndDate>
<id>8051</id>
<price>414.1</price>
<initPrice>10.0</initPrice>
<productName>Product group 1 subscription-20-days</productName>
<productId>2</productId>
<productUri uri="/api/web/productgroup/3/products/2" />
<productGroupId>3</productGroupId>
<productGroup uri="/api/web/productgroup/3" />
<startDate>2020-01-16T10:57:04Z</startDate>
<userId>10018</userId>
<ip>127.0.0.1</ip>
<period>1728000</period>
<periodIso>P20D</periodIso>
<platformId>1</platformId>
<productPaymentId>10041</productPaymentId>
<productPayment uri="/api/web/productgroup/3/products/2/productPayments/10041" />
<orderRef>ee6181495d2a417086d80d1206c030f5</orderRef>
<status>ACTIVE</status>
<currency>NOK</currency>
<paymentInfo>492500******0004</paymentInfo>
<paymentInfoExpiryDate>2022-02-01T00:00:00Z</paymentInfoExpiryDate>
<userPaymentMethod>
<allowOneClickBuy>true</allowOneClickBuy>
<expireDate>2022-02-01T00:00:00Z</expireDate>
<extAgreementRef>E9GPuIj/PzIuVDIXatQOsoMsV9A=</extAgreementRef>
<id>0ea6821f-f016-4e0e-9f94-12701a460419</id>
<paymentInfo>492500******0004</paymentInfo>
<paymentProviderId>23</paymentProviderId>
<registered>2020-01-16T10:57:04Z</registered>
<userId>10018</userId>
<userPaymentMethodStatus>ACTIVE</userPaymentMethodStatus>
<userPaymentMethodType>CREDIT_CARD</userPaymentMethodType>
</userPaymentMethod>
<autorenewErrors>0</autorenewErrors>
<statusText>Purchase sucessfull</statusText>
<externalOrderRef>E9GPuIj/PzIuVDIXatQOsoMsV9A=</externalOrderRef>
<registered>2020-01-16T10:57:04Z</registered>
<activePeriods>1</activePeriods>
<vat>0.0</vat>
<trialOverride>DEFAULT</trialOverride>
</order>

Credit card purchase using Dibs Payment Service Provider

Section titled “Credit card purchase using Dibs Payment Service Provider”

Vimonds Dibs payment integration supports purchase with credit card. The purchase flow consists of an initialize call and entering of credit card information, followed by a callback from Dibs.

A subscription purchase is initialized using the following endpoint:

curl --location --request POST 'http://{api-domain}/api/{platform}/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId},
"productPaymentId": {productPaymentId},
"callbackUrl": "{api-domain}/{platform}/order/callback",
"payment": {
"paymentMethod": "CREDITCARD"
}
}
}'

Example response

{
"autorenewStatus": "NOT_STARTED",
"earliestEndDate": "2020-01-16T11:09:17Z",
"endDate": "2020-01-26T11:09:17Z",
"accessEndDate": "2020-01-26T17:09:17Z",
"id": 8055,
"price": 414.1,
"initPrice": 74.12,
"productName": "Product group 1 subscription-20-days",
"productId": 2,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-16T11:09:17Z",
"userId": 10020,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10121,
"orderRef": "9056",
"status": "INITIALIZE",
"paymentObject": {
"callbackUri": {},
"initializeUri": {},
"url": "{Dibs redirect url}",
"name": "Dibs",
"paymentMethod": "CREDITCARD",
"redirectUrl": {}
},
"currency": "NOK",
"userPaymentMethod": {},
"autorenewErrors": 0,
"statusText": "Purchase initialized",
"registered": "2020-01-16T11:09:17Z",
"activePeriods": 1,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"paymentMethod": "CREDITCARD",
"period": "P20D"
}

The url present in order.payment.url is a link to a Dibs window where end user should enter the credit card information. Once done, Dibs will validate the credit card, charge the amount and make a callback to the callbackUrl sent in the initialize request. This request will typically look like this:

curl --location --request GET 'http://{api-domain}/api/{platform}/order?token={token added by vimond to the callback url}&referenceData={Ref to vimond order}&ccType=MASTERCARD&expY={expire year of cc}&ccPrefix={prefix of cc number}&verifyId={DIBS reference number}&acquirerResponseCode={acquirerResponseCode}&sum={amount>}csrf={Cross-site request forgery token}&ccPart={masked card number}&reply={Dibs response code}&MAC={MAC}&expM={expire month of cc}&' \
--header 'Accept: application/xml'

Example response

<order uri="/api/web/order/8055">
<autorenewStatus>ACTIVE</autorenewStatus>
<earliestEndDate>2020-01-16T11:09:17Z</earliestEndDate>
<endDate>2020-01-26T11:09:17Z</endDate>
<accessEndDate>2020-01-26T17:09:17Z</accessEndDate>
<id>8055</id>
<price>414.1</price>
<initPrice>74.12</initPrice>
<productName>Product group 1 subscription-20-days</productName>
<productId>2</productId>
<productUri uri="/api/web/productgroup/3/products/2"/>
<productGroupId>3</productGroupId>
<productGroup uri="/api/web/productgroup/3"/>
<startDate>2020-01-14T15:26:48Z</startDate>
<userId>10020</userId>
<ip>127.0.0.1</ip>
<period>1728000</period>
<periodIso>P20D</periodIso>
<platformId>1</platformId>
<productPaymentId>10121</productPaymentId>
<productPayment uri="/api/web/productgroup/3/products/2/productPayments/10121"/>
<orderRef>9056</orderRef>
<status>ACTIVE</status>
<currency>NOK</currency>
<paymentInfo>5100 10** **** 0000</paymentInfo>
<paymentInfoExpiryDate>2024-07-01T00:00:00Z</paymentInfoExpiryDate>
<userPaymentMethod>
<allowOneClickBuy>true</allowOneClickBuy>
<expireDate>2024-07-01T00:00:00Z</expireDate>
<extAgreementRef>608260231</extAgreementRef>
<id>63886cf5-1410-4c27-aa54-f944c8d0fb1d</id>
<paymentInfo>5100 10** **** 0000</paymentInfo>
<paymentProviderId>21</paymentProviderId>
<registered>2020-01-16T11:09:17Z</registered>
<userId>10020</userId>
<userPaymentMethodStatus>ACTIVE</userPaymentMethodStatus>
<userPaymentMethodType>CREDIT_CARD</userPaymentMethodType>
</userPaymentMethod>
<autorenewErrors>0</autorenewErrors>
<statusText>Purchase sucessfull</statusText>
<externalOrderRef>608260231</externalOrderRef>
<registered>2020-01-16T11:09:17Z</registered>
<activePeriods>1</activePeriods>
<trialOverride>DEFAULT</trialOverride>
</order>

Purchase using Altapay Payment Service Provider

Section titled “Purchase using Altapay Payment Service Provider”

Vimonds Altapay payment integration supports purchase with credit card. The purchase flow consists of an initialize call and entering of credit card information, followed by a callback from Altapay.

A subscription purchase is initialized by the following:

curl --location --request POST 'http://{api-domain}/api/{platform}/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId},
"productPaymentId": {productPaymentId},
"payment": {
"paymentMethod": "EXTERNAL_CREDITCARD",
"baseUrl": "{api-domain}/api",
"resetUrl": "{api-domain}/api",
"callbackOk": "{api-domain}/api/web/order/callback",
"callbackFail": "{api-domain}/api/web/order/callback",
"callbackRedirect": "{api-domain}/api/web/order/callback"
}
}
}'

Example response

{
"autorenewStatus": "NOT_STARTED",
"earliestEndDate": "2020-01-16T11:59:42Z",
"endDate": "2020-01-17T11:59:42Z",
"accessEndDate": "2020-01-17T17:59:42Z",
"id": 8059,
"price": 414.1,
"initPrice": 10.0,
"productName": "Product group 1 subscription-20-days",
"productId": 2,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-16T11:59:42Z",
"userId": 10024,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10022,
"orderRef": "8059",
"status": "INITIALIZE",
"paymentObject": {
"callbackUri": {},
"initializeUri": {},
"url": "{altapay redirect url}",
"name": "Altapay",
"paymentMethod": "CREDITCARD",
"redirectUrl": {}
},
"currency": "NOK",
"userPaymentMethod": {},
"autorenewErrors": 0,
"statusText": "Purchase initialized",
"registered": "2020-01-16T11:59:42Z",
"activePeriods": 1,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"paymentMethod": "CREDITCARD",
"period": "P20D"
}

The url present in order.payment.url is a link to a Altapay iframe where end user should enter the credit card information. Once done, Altapay will validate the credit card, charge the amount and make a callback to the callbackOk url sent in the initialize request. This request will typically look like this:

curl --location --request POST 'http://{api-domain}/api/{platform}/order' \
--header 'Content-Type: application/x-www-form-urlencoded'\
--data-urlencode 'transaction_id={Altapay transaction Id}'\
--data-urlencode 'credit_card_token={Altapay credit card token}'
--data-urlencode 'amount={amount}'\
--data-urlencode 'nature=CreditCard'\
--data-urlencode 'payment_status=recurring_confirmed'\
--data-urlencode 'transaction_info[base_url]={api-domain}/api'\
--data-urlencode 'type={payment type - typically subscriptionAndCharge}'\
--data-urlencode 'blacklist_token={Altapay blacklist_token}'\
--data-urlencode 'embedded_window=0'\
--data-urlencode 'require_capture=false'\
--data-urlencode 'avs_text={some text}'\
--data-urlencode 'masked_credit_card={masked card number}'\
--data-urlencode 'payment_id={Altapay payment Id}'\
--data-urlencode 'avs_code={Altapay avs code}'\
--data-urlencode 'xml={large xml containing transaction info}'\
--data-urlencode 'checksum={Altapay checksum}'\
--data-urlencode 'transaction_info[reset_url]={api-domain}/api'\
--data-urlencode 'currency={Altapay currency code}'\
--data-urlencode 'shop_orderid={Vimond order id}'\
--data-urlencode 'status=succeeded'

Example response

<order uri="/api/web/order/8059">
<autorenewStatus>ACTIVE</autorenewStatus>
<earliestEndDate>2020-01-16T11:59:42Z</earliestEndDate>
<endDate>2020-01-17T11:59:42Z</endDate>
<accessEndDate>2020-01-17T17:59:42Z</accessEndDate>
<id>8059</id>
<price>414.1</price>
<initPrice>10.0</initPrice>
<productName>Product group 1 subscription-20-days</productName>
<productId>2</productId>
<productUri uri="/api/web/productgroup/3/products/2"/>
<productGroupId>3</productGroupId>
<productGroup uri="/api/web/productgroup/3"/>
<startDate>2020-01-16T11:59:42Z</startDate>
<userId>10024</userId>
<ip>127.0.0.1</ip>
<period>1728000</period>
<periodIso>P20D</periodIso>
<platformId>1</platformId>
<productPaymentId>10022</productPaymentId>
<productPayment uri="/api/web/productgroup/3/products/2/productPayments/10022"/>
<orderRef>8059</orderRef>
<status>ACTIVE</status>
<currency>NOK</currency>
<paymentInfo>758639******2932</paymentInfo>
<paymentInfoExpiryDate>2021-01-01T00:00:00Z</paymentInfoExpiryDate>
<userPaymentMethod>
<allowOneClickBuy>true</allowOneClickBuy>
<expireDate>2021-01-01T00:00:00Z</expireDate>
<extAgreementRef>35448072</extAgreementRef>
<id>564e70cb-512b-4754-9693-39b58fc73eea</id>
<paymentInfo>758639******2932</paymentInfo>
<paymentProviderId>22</paymentProviderId>
<registered>2020-01-16T11:59:42Z</registered>
<userId>10024</userId>
<userPaymentMethodStatus>ACTIVE</userPaymentMethodStatus>
<userPaymentMethodType>CREDIT_CARD</userPaymentMethodType>
</userPaymentMethod>
<autorenewErrors>0</autorenewErrors>
<statusText>Purchase sucessfull</statusText>
<externalOrderRef>35448072:rG0PlXHSOkTMtMbUIlZG5GcRepCgqkDXe6oDszmxswh90nxpEMFcYYW+H38MfzX86bREFwEVtak+dVkkCgPXaQ==+1</externalOrderRef>
<registered>2020-01-16T11:59:42Z</registered>
<activePeriods>1</activePeriods>
<trialOverride>DEFAULT</trialOverride>
</order>

Purchase using Braintree Payment Service Provider

Section titled “Purchase using Braintree Payment Service Provider”

Vimonds Braintree payment integration supports purchase with credit card and paypal. The purchase flow consists of an initialize and a capture call to Vimonds API. Note that the Vimond API depends on a payment nonce to make a charge. So any portal must integrate with Braintrees client in order to generate it.

A subscription purchase is initialized by the following:

curl --location --request POST 'http://{api-domain}/api/{platform}/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId}
"productPaymentId": {productPaymentId},
"payment": {
"paymentMethod": "BRAINTREE",
"deviceData": "{device data}",
"endUserIp": "{end user ip}",
"nonce": "{braintree nonce}",
"generateClientToken": "true",
"paymentType": "{CC || PayPal}"
}
}
}'

Example response

{
"autorenewStatus": "NOT_STARTED",
"earliestEndDate": "2020-01-16T12:14:10Z",
"endDate": "2020-01-17T12:14:10Z",
"accessEndDate": "2020-01-17T18:14:10Z",
"id": 8063,
"price": 414.1,
"initPrice": 10.0,
"productName": "Product group 1 subscription-20-days",
"productId": 2,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-16T12:14:10Z",
"userId": 10026,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10141,
"status": "INITIALIZE",
"paymentObject": {
"callbackUri": {},
"initializeUri": {},
"name": "Braintree",
"paymentMethod": "BRAINTREE",
"redirectUrl": {}
},
"currency": "USD",
"userPaymentMethod": {},
"autorenewErrors": 0,
"statusText": "Purchase initialized",
"registered": "2020-01-16T12:14:10Z",
"activePeriods": 1,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"paymentMethod": "BRAINTREE",
"period": "P20D"
}

The purchase is then captured by the following:

curl --location --request PUT 'http://{api-domain}/api/{platform}/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"id": {orderId}
"productPaymentId": {productPaymentId},
"payment": {
"paymentMethod": "BRAINTREE",
"deviceData": "{device data}",
"endUserIp": "{end user ip}",
"nonce": "{nonce generated by braintree client}",
"generateClientToken": "true",
"paymentType": "{CC || PayPal}"
}
}
}'

Example response

{
"autorenewStatus": "ACTIVE",
"earliestEndDate": "2020-01-16T12:14:10Z",
"endDate": "2020-01-17T12:14:10Z",
"accessEndDate": "2020-01-17T18:14:10Z",
"id": 8063,
"price": 414.1,
"initPrice": 10.0,
"productName": "Product group 1 subscription-20-days",
"productId": 2,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-16T12:14:10Z",
"userId": 10026,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10141,
"status": "ACTIVE",
"currency": "USD",
"paymentInfo": "401288******1881",
"paymentInfoExpiryDate": "2021-12-01T00:00:00Z",
"userPaymentMethod": {
"id": "a14402d4-ca58-40af-a25a-703a5f8deaf6",
"userId": 10026,
"extAgreementRef": "8tvv8tb",
"paymentInfo": "401288******1881",
"expireDate": "2021-12-01T00:00:00Z",
"registered": "2020-01-16T12:16:12Z",
"userPaymentMethodStatus": "ACTIVE",
"userPaymentMethodType": "CREDIT_CARD",
"allowOneClickBuy": true,
"paymentProviderId": 61,
"expirationDate": "2021-12-01T00:00:00Z"
},
"autorenewErrors": 0,
"statusText": "Purchase sucessfull",
"externalOrderRef": "8tvv8tb",
"registered": "2020-01-16T12:14:10Z",
"activePeriods": 1,
"vat": 0.0,
"trialOverride": "DEFAULT",
"period": "P20D"
}

Purchase using Klarna Direkt Payment Service Provider

Section titled “Purchase using Klarna Direkt Payment Service Provider”

The purchase flow consists of a single capture call to Vimonds API. Note that the Vimond API depends on a klarna token to make a charge. So any portal must integrate with Klarnas clients in order to generate it. Also, SEK is the only currency currently supported.

A subscription purchase is initialized by the following:

curl --location --request PUT 'http://{api-domain}/api/{platform}/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId}
"productPaymentId": {productPaymentId},
"payment": {
"paymentMethod": "KLARNA",
"klarnaEmail": "{klarna email}",
"customerToken": "{klarna token}"
}
}
}'

Example response

{
"autorenewStatus": "ACTIVE",
"earliestEndDate": "2020-01-15T10:45:09Z",
"endDate": "2020-01-25T10:45:09Z",
"accessEndDate": "2020-01-25T16:45:09Z",
"id": 8023,
"price": 122.45,
"initPrice": 46.79,
"productName": "Product group 1 subscription-15-days",
"productId": 1,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-15T10:45:09Z",
"userId": 10012,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10081,
"status": "ACTIVE",
"currency": "EUR",
"paymentInfo": "testuser@vimond.com",
"paymentInfoExpiryDate": "3000-01-01T00:00:00Z",
"userPaymentMethod": {
"id": "2b641b95-ed9a-47a5-afaf-017d5d50c273",
"userId": 10012,
"extAgreementRef": "klarna-token",
"paymentInfo": "testuser@vimond.com",
"expireDate": "3000-01-01T00:00:00Z",
"registered": "2020-01-15T10:45:08Z",
"userPaymentMethodStatus": "ACTIVE",
"userPaymentMethodType": "KLARNA",
"allowOneClickBuy": true,
"paymentProviderId": 10142
},
"autorenewErrors": 0,
"statusText": "Purchase sucessfull",
"registered": "2020-01-15T10:45:09Z",
"activePeriods": 1,
"vat": 0.0,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"period": "P15D"
}

One click buy is the concept of reusing already stored payment methods to make new purchases. This is supported by all the above Payment Providers and requires the user to have an already stored userPaymentMethod.

curl --location --request PUT 'http://{api-domain}/api/web/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId},
"productPaymentId": {productPaymentId},
"payment": {
"paymentMethod": "ONE_CLICK_BUY"
},
"userPaymentMethod": {
"id": {userPaymentMethodId}
}
}
}'

Example response

{
"autorenewStatus": "ACTIVE",
"earliestEndDate": "2020-01-15T10:45:09Z",
"endDate": "2020-01-25T10:45:09Z",
"accessEndDate": "2020-01-25T16:45:09Z",
"id": 8023,
"price": 122.45,
"initPrice": 46.79,
"productName": "Product group 1 subscription-15-days",
"productId": 1,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-15T10:45:09Z",
"userId": 10012,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10081,
"status": "ACTIVE",
"currency": "EUR",
"userPaymentMethod": {
"id": "2b641b95-ed9a-47a5-afaf-017d5d50c273",
"userId": 10012,
"extAgreementRef": "random",
"paymentInfo": "1111 11** **** 1111",
"expireDate": "2020-12-20T00:00:00Z",
"registered": "2020-01-15T10:45:08Z",
"userPaymentMethodStatus": "ACTIVE",
"userPaymentMethodType": "CREDIT_CARD",
"allowOneClickBuy": true,
"captureAttemptLog": "Auth ok.",
"paymentProviderId": 41
},
"autorenewErrors": 0,
"statusText": "Purchase sucessfull",
"registered": "2020-01-15T10:45:09Z",
"activePeriods": 1,
"vat": 0.0,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"period": "P15D"
}

If given a voucher code, this can be used during a purchase to get discount. It can be used in all type of purchases (oneClickBuy, regular purchase) with all of the above payment providers.

curl --location --request PUT 'http://{api-domain}/api/web/order' \
--header 'Accept: application/json;v=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {bearerToken}' \
--data-raw '{
"order": {
"userId": {userId},
"productPaymentId": {productPaymentId},
"payment": {
"paymentMethod": "ONE_CLICK_BUY"
},
"userPaymentMethod": {
"id": {userPaymentMethodId}
},
"voucherCode": "{vouchercode}"
}
}'

Example response

{
"autorenewStatus": "ACTIVE",
"earliestEndDate": "2020-01-15T10:45:09Z",
"endDate": "2020-01-25T10:45:09Z",
"accessEndDate": "2020-01-25T16:45:09Z",
"id": 8023,
"price": 122.45,
"initPrice": 0.0,
"productName": "Product group 1 subscription-15-days",
"productId": 1,
"productGroupId": 3,
"productGroupUri": {},
"startDate": "2020-01-15T10:45:09Z",
"userId": 10012,
"ip": "127.0.0.1",
"platformId": 1,
"productPaymentId": 10081,
"status": "ACTIVE",
"currency": "EUR",
"userPaymentMethod": {
"id": "2b641b95-ed9a-47a5-afaf-017d5d50c273",
"userId": 10012,
"extAgreementRef": "random",
"paymentInfo": "1111 11** **** 1111",
"expireDate": "2020-12-20T00:00:00Z",
"registered": "2020-01-15T10:45:08Z",
"userPaymentMethodStatus": "ACTIVE",
"userPaymentMethodType": "CREDIT_CARD",
"allowOneClickBuy": true,
"captureAttemptLog": "Auth ok.",
"paymentProviderId": 41
},
"autorenewErrors": 0,
"statusText": "Purchase sucessfull",
"registered": "2020-01-15T10:45:09Z",
"activePeriods": 1,
"vat": 0.0,
"changeAction": "NEW",
"trialOverride": "DEFAULT",
"period": "P15D",
"voucherCode": "voucher1234"
}