/
NUTRINTG Subscription Service

NUTRINTG Subscription Service

Overview

The subscription service is responsible for managing customer subscriptions.

Service provides the following APIs:

  • Unsubscribe

  • Subscribe

  • IYS Consent

Unsubscribe

Unsubscribe process updates subscriptions - set OptStatus field to false.

The request is asynchronous so HTTP response equals to 202 does not mean success. Response body contains traceId which should be used in request to Trace service to find out if the whole process has been successfully finished.

Endpoint for subscription

Endpoints

Method

Endpoints

Method

/subscription/unsubscribe

PUT

Parameters

Name

Type

Description

Example

Name

Type

Description

Example

profileId

body

Customer’s profile id

68d1134a-7a61-4788-83d1-d07267be9a1b

profileSubscriptionId

body

Customer’s subsription id

805bf233-0f12-4861-a071-1f0a2242168a

subscriptionId

body

Subscription’s id

1f6cd97d-9853-4c43-a370-a7e3d87de203

brandOrgCode

body

 

MJNPOL

programCode

body

 

MJNPOL

sourceAccountNumber

body

 

MJNPOL_3a442b9d-8d80-4077-b87e-90fb858e4082

accountSource

body

 

POLGWTPL

Accept-Language

header

 

en-US

access_token

param

Access token to Middleware

 

email

body

Customer’s email address. Necessary for CDS profile update

 

phoneNumber

body

Customer’s phone number

 

channelCode

body

{ DM | EM | PH | PN | SM }

DM

activityDate

body

 

2021-08-09T07:06:14.000000Z

Schema validation

{ "type": "object", "properties": { "webHookKey": { "type": "string", "maxLength": 255 }, "brandCode": { "type": "string", "maxLength": 255 }, "consentData": { "type": "object", "properties": { "recipient": { "type": "string", "maxLength": 283 }, "recipientType": { "type": "string", "enum": [ "BIREYSEL", "TACIR" ] }, "consentDate": { "type": "string", "maxLength": 255 }, "type": { "type": "string", "maxLength": 255 }, "source": { "type": "string", "maxLength": 255 }, "status": { "type": "string", "enum": [ "ONAY", "RET" ] } }, "required": [ "recipient", "recipientType", "type", "consentDate", "source", "status" ], "oneOf": [ { "properties": { "type": { "enum": [ "EPOSTA" ] }, "recipient": { "maxLength": 283, "format": "email" } } }, { "properties": { "type": { "enum": [ "ARAMA", "MESAJ" ] }, "recipient": { "maxLength": 15, "pattern": "^\\+(?:[0-9]?){6,14}[0-9]$" } } } ] } }, "required": [ "webHookKey", "brandCode", "consentData" ] }

Request and response

[{ "profileId": "68d1134a-7a61-4788-83d1-d07267be9a1b", "profileSubscriptionId": "805bf233-0f12-4861-a071-1f0a2242168a", "subscriptionId": "1f6cd97d-9853-4c43-a370-a7e3d87de203", "brandOrgCode": "MJNPOL", "programCode": "MJNPOL", "sourceAccountNumber": "MJNPOL_3a442b9d-8d80-4077-b87e-90fb858e4082", "accountSource": "POLGWTPL", "email": "test.email@test.com", "channelCode": "DM", "activityDate":"2021-08-09T07:06:14.000000Z" }, { "profileId": "68d1134a-7a61-4788-83d1-d07267be9a1b", "profileSubscriptionId": "805bf233-0f12-4861-a071-1f0a2242168a", "subscriptionId": "1f6cd97d-9853-4c43-a370-a7e3d87de203", "brandOrgCode": "MJNPOL", "programCode": "MJNPOL", "sourceAccountNumber": "MJNPOL_3a442b9d-8d80-4077-b87e-90fb858e4082", "accountSource": "POLGWTPL", "phoneNumber": "601219281891", "channelCode": "PH", "activityDate":"2021-08-09T07:06:14.000000Z" }]

Http Response

Example response body

Description

Http Response

Example response body

Description

202

{ "profileId":"68d1134a-7a61-4788-83d1-d07267be9a1b", "correlationId":"9ee6c2c0-8895-11eb-8b59-02662e3dc2be", "traceId":"73c29073-e174-49e9-90f2-f5abae5491c6" }

All validation passed on request body and token is valid.

400

access_token param is not present

Validation failed.

401

Invalid token

 

IYS Consent

Endpoint for consent

Endpoints

Method

Endpoints

Method

/consent

POST

Parameters

Name

Type

Description

Example

Name

Type

Description

Example

webHookKey

String

Refers to the private area requested for calls. It is the private key value entered while saving webhook information on the portal. It has been added to block calls.

ABCDEF123456ABCDEF

brandCode

String

Brand Code

666660

consentData

Object

Added Data Model (Singular)

 

consentData.recipient

String

It is the phone number or e-mail information of the citizen registered in the system. Email addresses cannot be longer than 284 characters long and phone numbers cannot exceed 15 characters.
The phone number must be in the format of +905813334455.
([+][country code][area code][local phone number]) (+905555555555)

info@mysoft.com.tr

consentData.recipientType

 

It only takes 2 values. ("BIREYSEL", "TACIR"). It is the information showing the status of the merchant.

BIREYSEL

consentData.type

String (ENUM)

It only takes 3 values. ("ARAMA", "MESAJ", "EPOSTA") It is the communication channel allowed by the citizen.

EPOSTA

consentDate

String (date-time)

It is the date that the citizen determines the communication permit status. If the buyer type is TACIR, it does not have to be added.

2018-02-10 09:30:00)

source

String (Enum)

It only takes 12 values.

HS_FIZIKSEL_ORTAM

consentData.status

String (Enum)

Takes only 2 values ("ONAY", "RET")
Shows the citizen's permit status.

RET

retailerCode

Integer (Nullable) (int?)

It is the IYS number assigned individually by the IYS to the dealer that mediates the permission.

1

retailerAccess

Integer Generic List (List<int>)

(Nullable) 

It shows the list of IYS numbers assigned individually by the IYS to the dealers with permission access.

[]

specialValue

String (Nullable)

 

 

Schema validation

Request and response

Environments