> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/tokenization/ja/integrate-the-d1-api/d1-api-reference/inbound-api-to-d1/consumer-api.md).

# コンシューマーAPI

## Register consumer

> This request is used by the bank backend to request the registration of the end user with personal information.\
> \> #### Note\
> \> It is strongly recommended to provide the end user personal information such as first and last name, email, phone number, postal address.\
> \>Personal information is used in \`D1 Tokenization\` by the Decision Engine or in \`D1 Push\` when building the card information to push to OEM Wallet. \
> \
> \> #### Note\
> \> Some end user personal information are mandatory for issuers using \`D1 Click to Pay\` service. These mandatory personal information\
> \> such as mobilePhoneNumber or language are tagged bellow with \*"This field is mandatory for Click to Pay"\*. <br>

```json
{"openapi":"3.0.0","info":{"title":"D1 Inbound Consumer API","version":"2.0"},"tags":[{"name":"Consumer","description":"Different operations for end user (consumer) management."}],"servers":[{"url":"https://api.d1.thalescloud.io/banking/v2","description":"Production server"},{"url":"https://api.d1-stg.thalescloud.io/banking/v2","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"A JWT generated by the [Get Authorization Token API](oauth2-api).<br/>The server checks the validity of the provided token to control access to this protected resource. Please refer to [Get OAuth 2.0 access token](../../../integrate-the-d1-api/get-oauth-2.0-access-token) for more details on the flow and on how to get this JWT.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"consumerInfo":{"additionalProperties":false,"type":"object","title":"ConsumerInfo","description":"the following object represents the personal information of the end user.","properties":{"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"language":{"type":"string","description":"Language as defined by ISO 639-2 standard.\n<br/>**Note**: This field is mandatory for Click to Pay.\n<br/>List of languages accepted : abk, aar, afr, alb, amh, ara, arm, aze, bel, ben, bis, bos, bul, bur, cat, nya, chi, hrv, cze, dan, div, dut, dzo, eng, est, fij, fin, fre, geo, ger, gre, grn, hat, hau, heb, hin, hun, ice, ind, gle, ita, jpn, kaz, khm, kin, kor, kur, kir, lao, lat, lav, lit, ltz, mac, mlg, may, mlt, mao, mah, mon, nau, nep, nor, orm, oss, pus, per, pol, por, rum, roh, rus, smo, sag, srp, sin, slo, slv, som, spa, swa, swe, tgk, tam, tha, ton, tur, tuk, ukr, urd, uzb, vie,\n","minLength":3,"maxLength":3,"pattern":"^[a-z]{3}$"},"firstName":{"type":"string","description":"First name of the end user (Unicode characters allowed).<br/>**Note**: This field is mandatory for Click to Pay.","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"middleName":{"type":"string","description":"Middle name of the end user (Unicode characters allowed).","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"lastName":{"type":"string","description":"Last name of the end user (Unicode characters allowed).<br/>**Note**: This field is mandatory for Click to Pay.","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"secondLastName":{"type":"string","description":"Second Last name of the end user (Unicode characters allowed).","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"dateOfBirth":{"type":"string","description":"Date of Birth.","pattern":"^\\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[0-1])$"},"title":{"type":"string","description":"Title of the end user.<br/>By default D1 support the following title value<br/>- Mr.<br/>- Mrs.<br/>- Miss<br/>Please contact Thales integration team for the support of other value<br/>To not fill in if not applicable.","minLength":2,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"nationality":{"type":"string","description":"Main nationality of the end user in ISO 3166-1 Alpha-2 Code","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"},"email":{"type":"string","description":"Email of the end user.<br/>**Note**: This field is mandatory for Click to Pay with Mastercard.","minLength":5,"maxLength":256,"pattern":"^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,15}$"},"mobilePhoneNumber":{"additionalProperties":false,"description":"Phonenumber of the end user (consumer).  Shall respect the E-164 format.<br/>**Note**: This field is mandatory for Click to Pay.","type":"object","required":["countryCode","phoneNumber"],"properties":{"countryCode":{"type":"string","description":"Internantional country code of the end user's phonenumber. Shall start with the '+' sign.","minLength":1,"maxLength":10,"pattern":"^\\+[0-9]{1,10}$"},"phoneNumber":{"type":"string","description":"National phonenumber of the end user. Shall not contain the first '0' of the national phonenumber. If present as input parameter, D1 will ignore it.","minLength":1,"maxLength":14,"pattern":"^[0-9]{1,14}$"}}},"residencyAddress":{"additionalProperties":false,"type":"object","description":"Residency address of the end user (consumer).<br/>In the context of Click to Pay it will be used as \"billing address\" associated to each cards.<br/>**Note**: This field is mandatory for Click to Pay with Visa. When set for Click to Pay Mastercard, all fields inside the residencyAddress must be provided, in accordance with Mastercard specification.","required":["line1","city","state","zipCode","countryCode"],"properties":{"recipientName":{"type":"string","description":"Free text field containing the name of the recipient of post mail in case the name is different from first/last name (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line1":{"type":"string","description":"First line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line2":{"type":"string","description":"Second line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line3":{"type":"string","description":"First line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line4":{"type":"string","description":"Fourth line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"city":{"type":"string","description":"City.","minLength":1,"maxLength":32,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,32}$"},"state":{"type":"string","description":"State.<br/><b>Note</b>: For Click to Pay, this field shall be the second part of ISO_3166-2 format in upper case, representing the state (country subdivision) based on the country.","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"zipCode":{"type":"string","description":"Zip Code.","minLength":1,"maxLength":10,"pattern":"^[0-9a-zA-Z -]{1,10}$"},"countryCode":{"type":"string","description":"Country code in ISO 3166-1 alpha-2.<br/>**Note**: This field is mandatory for Click to Pay.","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"}}}},"required":["firstName","lastName"]},"preferences":{"additionalProperties":false,"type":"object","title":"Preferences","description":"the following object represents the preferences of the end user","properties":{"notificationChannel":{"type":"array","description":"list by order of preference the communication channel D1 must use to send notification to user<br/>This do no superseded the restricted list of channel defined at message configuration level</br>if not provided, D1 manage to send the message with the following preference order:<br/>- IN_APP_NOTIFICATION<br/>- SMS<br/>- EMAIL","maxItems":3,"uniqueItems":true,"items":{"type":"string","enum":["SMS","EMAIL","IN_APP_NOTIFICATION"]}}}},"errorGeneric":{"additionalProperties":false,"type":"object","description":"Generic error returned by the APIs.","properties":{"errorCode":{"type":"string","description":"The type of the error"},"error":{"type":"string","description":"Provide more error details if possible.<br/>For example name of the field with invalid format.<br/>This field is for troubleshooting purposes only, it can change at any time so MUST NOT be parsed, and is not supposed to be human readable so CANNOT be displayed to end users."}}}},"responses":{"ServiceUnavailableError":{"description":"The service is temporarily unavailable. You may retry your request later."}}},"paths":{"/issuers/{issuerId}/consumers/{consumerId}":{"put":{"description":"This request is used by the bank backend to request the registration of the end user with personal information.\n> #### Note\n> It is strongly recommended to provide the end user personal information such as first and last name, email, phone number, postal address.\n>Personal information is used in `D1 Tokenization` by the Decision Engine or in `D1 Push` when building the card information to push to OEM Wallet. \n\n> #### Note\n> Some end user personal information are mandatory for issuers using `D1 Click to Pay` service. These mandatory personal information\n> such as mobilePhoneNumber or language are tagged bellow with *\"This field is mandatory for Click to Pay\"*. \n","tags":["Consumer"],"requestBody":{"content":{"application/json":{"schema":{"description":"The following object represent the end user (consumer).","additionalProperties":false,"type":"object","properties":{"personalInformation":{"$ref":"#/components/schemas/consumerInfo"},"preferences":{"$ref":"#/components/schemas/preferences"}}}}}},"responses":{"204":{"description":"Successful consumer registration."},"400":{"description":"Bad Request, Invalid request URI, header, paramters. The below table defines the possible 'Bad request' error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| FIELD_INVALID_FORMAT |  Contains the field in error (first found) | no | JSON not well formatted or<br>One field is not expected format as defined in this documentation |\n| FIELD_INVALID_VALUE  | - | no | One field value is not allowed for the given field |        \n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"401":{"description":"Unauthorized request, the provided Authorization header is missing or invalid. In the table below only the field \"error\" is provided.\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| AUTHORIZER_UNAUTHORIZED  | Unauthorized message | no | Access token not valid       |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"403":{"description":"Forbidden action, check the state of the linked consumer or card. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n| AUTHORIZER_FORBIDDEN  | not\\_authorized error message | no | User\\_is\\_not\\_authorized\\_to\\_access\\_this\\_resource |\n| CONSUMER_INVALID_STATE  | contains the state of the resource  | no | Consumer already exists and is deleted |\n| MISSING_C2P_MANDATORY_INFORMATION  | contains the missing field  | no | All required fields for Click to Pay are not present (firstName, lastName, language, mobilePhoneNumber, countryCode, email) or residencyAddress.state length > 3 |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"404":{"description":"Ressource not found, Unknown issuerId or consumerId or card id'. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"500":{"description":"Internal Server Error. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | yes | No error details available         |\n| INTERNAL_ERROR | Error details if any | no | The server has encountered an error when executing the request. |\n"},"503":{"$ref":"#/components/responses/ServiceUnavailableError"}},"summary":"Register consumer","operationId":"registerConsumer"}}}}
```

## Get Card List

> This request is used to request the end user card list.\
> It will return the cards & digital cards and associated accounts.

```json
{"openapi":"3.0.0","info":{"title":"D1 Inbound Consumer API","version":"2.0"},"tags":[{"name":"Consumer","description":"Different operations for end user (consumer) management."}],"servers":[{"url":"https://api.d1.thalescloud.io/banking/v2","description":"Production server"},{"url":"https://api.d1-stg.thalescloud.io/banking/v2","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"A JWT generated by the [Get Authorization Token API](oauth2-api).<br/>The server checks the validity of the provided token to control access to this protected resource. Please refer to [Get OAuth 2.0 access token](../../../integrate-the-d1-api/get-oauth-2.0-access-token) for more details on the flow and on how to get this JWT.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"cardId":{"type":"string","description":"Unique identifier of the card.","minLength":1,"maxLength":48,"pattern":"^[A-Za-z0-9_-]{1,48}$"},"newCardId":{"type":"string","description":"Unique identifier of the new card. Provided in case the card is in REPLACED state.","minLength":1,"maxLength":48,"pattern":"^[A-Za-z0-9_-]{1,48}$"},"cardProductId":{"type":"string","description":"Unique identifier of the type of card ( defined during the onboarding of D1)","minLength":1,"maxLength":48,"pattern":"^[A-Za-z0-9_-]{1,48}$"},"threeDSsupport":{"type":"boolean","description":"Determines if the card supports EMV 3-D Secure (3DS) flows."},"scheme":{"description":"The card scheme","enum":["MASTERCARD","VISA","AMEX"],"type":"string"},"auxiliaryScheme":{"description":"The card auxiliary scheme","enum":["DANKORT"]},"cardLast4":{"type":"string","pattern":"^\\d{4}$","description":"Last 4 digits of the PAN"},"cardExpiryDate":{"type":"string","description":"Expiry date of the card in MMYY format","pattern":"^(0[1-9]|1[0-2])\\d{2}$"},"newCardExpiryDate":{"type":"string","description":"New Expiry date of the card in MMYY format. Provided in case of ongoing RENEWAL operation.","pattern":"^(0[1-9]|1[0-2])\\d{2}$"},"cardState":{"type":"string","description":"the state of the card","enum":["INACTIVE","ACTIVE","SUSPENDED","DELETED","REPLACED"]},"creationDate":{"type":"string","title":"Creation date","description":"The time the resource has been created.\nFormat ISO 8601 YYYY-MM-DDThh:mm:ssTZD","minLength":1,"maxLength":64,"pattern":"^[0-9]{4}-((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(0[469]|11)-(0[1-9]|[12][0-9]|30)|02-(0[1-9]|[12][0-9]))T([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]{3}Z|\\.[0-9]{2}([\\+\\-](0[1-9]|1[0-2])):00)$"},"lastUpdate":{"type":"string","title":"Last update date","description":"The time the resource has been last updated.\nFormat ISO 8601 YYYY-MM-DDThh:mm:ssTZD","minLength":1,"maxLength":64,"pattern":"^[0-9]{4}-((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(0[469]|11)-(0[1-9]|[12][0-9]|30)|02-(0[1-9]|[12][0-9]))T([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]{3}Z|\\.[0-9]{2}([\\+\\-](0[1-9]|1[0-2])):00)$"},"AccountInformation":{"additionalProperties":false,"type":"object","required":["default","number","currencyCode"],"properties":{"default":{"type":"boolean","description":"true if the account is the default consumer account"},"type":{"type":"string","description":"Type of the Account. By default if not provided, it is a 'CHECKING' account.","enum":["CHECKING","SAVINGS"]},"number":{"type":"string","minLength":2,"maxLength":24,"pattern":"^[a-zA-Z0-9_]{2,24}$","description":"Account number used for posting to Core Banking System"},"currencyCode":{"$ref":"#/components/schemas/currencyCode"}}},"currencyCode":{"type":"string","pattern":"^[A-Z]{3}$","description":"Currency Code in ISO 4217 alpha code format"},"errorGeneric":{"additionalProperties":false,"type":"object","description":"Generic error returned by the APIs.","properties":{"errorCode":{"type":"string","description":"The type of the error"},"error":{"type":"string","description":"Provide more error details if possible.<br/>For example name of the field with invalid format.<br/>This field is for troubleshooting purposes only, it can change at any time so MUST NOT be parsed, and is not supposed to be human readable so CANNOT be displayed to end users."}}}},"responses":{"ServiceUnavailableError":{"description":"The service is temporarily unavailable. You may retry your request later."}}},"paths":{"/issuers/{issuerId}/consumers/{consumerId}/cards":{"get":{"description":"This request is used to request the end user card list.\nIt will return the cards & digital cards and associated accounts.","tags":["Consumer"],"responses":{"200":{"description":"Successful get end user card list","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"cards":{"type":"array","description":"list of cards that are associated to the end user","items":{"additionalProperties":false,"type":"object","required":["cardId","cardProductId","scheme","panSuffix","exp","state","ongoingOperation","creationTime"],"properties":{"cardId":{"$ref":"#/components/schemas/cardId"},"newCardId":{"$ref":"#/components/schemas/newCardId"},"cardProductId":{"$ref":"#/components/schemas/cardProductId"},"threeDSsupport":{"$ref":"#/components/schemas/threeDSsupport"},"scheme":{"$ref":"#/components/schemas/scheme"},"auxiliaryScheme":{"$ref":"#/components/schemas/auxiliaryScheme"},"panSuffix":{"$ref":"#/components/schemas/cardLast4"},"exp":{"$ref":"#/components/schemas/cardExpiryDate"},"newExp":{"$ref":"#/components/schemas/newCardExpiryDate"},"state":{"$ref":"#/components/schemas/cardState"},"stateReason":{"description":"reason associated to the state","type":"string","enum":["CLOSED_ACCOUNT","CLOSED_CARD","CARD_LOST","CARD_FOUND","CARD_STOLEN","CARD_BROKEN","CARD_NOT_RECEIVED","FRAUD","USER_DECISION","ISSUER_DECISION","CVV2_LOCKED","EXPIRY_DATE_LOCKED","PIN_LOCKED"]},"ongoingOperation":{"type":"string","enum":["NONE","RENEWAL"]},"creationTime":{"$ref":"#/components/schemas/creationDate"},"lastUpdateTime":{"$ref":"#/components/schemas/lastUpdate"},"accountList":{"type":"array","description":"This represent the list of account the card will be attached to.<br/>This list is used for the posting","items":{"$ref":"#/components/schemas/AccountInformation"}}}}}}}}}},"400":{"description":"Bad Request, Invalid request URI, header, paramters. The below table defines the possible 'Bad request' error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| FIELD_INVALID_FORMAT |  Contains the field in error (first found) | no | JSON not well formatted or<br>One field is not expected format as defined in this documentation |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"401":{"description":"Unauthorized request, the provided Authorization header is missing or invalid. In the table below only the field \"error\" is provided.\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| AUTHORIZER_UNAUTHORIZED  | Unauthorized message | no | Access token not valid       |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"403":{"description":"Forbidden action detected by WAF or the application.<br>\nThe below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                           |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| AUTHORIZER_FORBIDDEN  | not authorized error message | no | User is not authorized to access this resource |\n| CONSUMER_INVALID_STATE | Deleted consumer message | no | Consumer is in DELETED state |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"404":{"description":"Ressource not found, Unknown issuerId or consumerId or card id'. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n| UNKNOWN_CONSUMER  | -        | no | Consumer does not exist |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"500":{"description":"Internal Server Error. The below table defines the possible error:\n|errorCode       | error       | Retryable | Comments                           |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| INTERNAL_ERROR | error details if any | no | The server has encountered an error when executing the request.  |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"503":{"$ref":"#/components/responses/ServiceUnavailableError"}},"summary":"Get Card List","operationId":"getConsumer"}}}}
```

## Delete

> This request is used by the bank backend to request the deletion of an end user.\<br/>It will also in cascade delete all the accounts, cards and digital cards owned by the end user.\<br/>\<b>Note:\</b> The deletion of the end user cannot be reverted. If the same end user is willing to reuse the solution, we will require a new end user registration with a new consumerId.

```json
{"openapi":"3.0.0","info":{"title":"D1 Inbound Consumer API","version":"2.0"},"tags":[{"name":"Consumer Operations","description":"Different operations that can be done on a end user."}],"servers":[{"url":"https://api.d1.thalescloud.io/banking/v2","description":"Production server"},{"url":"https://api.d1-stg.thalescloud.io/banking/v2","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"A JWT generated by the [Get Authorization Token API](oauth2-api).<br/>The server checks the validity of the provided token to control access to this protected resource. Please refer to [Get OAuth 2.0 access token](../../../integrate-the-d1-api/get-oauth-2.0-access-token) for more details on the flow and on how to get this JWT.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"reason":{"type":"string","title":"reason","pattern":"^[a-zA-Z0-9 ]{1,64}$","description":"The reason why the action is performed. \n\nThis a free text field in case the bank wants to send details, that will be returned in the operations list. "},"operationId":{"type":"string","description":"Unique identifier of the operation","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$"},"errorGeneric":{"additionalProperties":false,"type":"object","description":"Generic error returned by the APIs.","properties":{"errorCode":{"type":"string","description":"The type of the error"},"error":{"type":"string","description":"Provide more error details if possible.<br/>For example name of the field with invalid format.<br/>This field is for troubleshooting purposes only, it can change at any time so MUST NOT be parsed, and is not supposed to be human readable so CANNOT be displayed to end users."}}}},"responses":{"ServiceUnavailableError":{"description":"The service is temporarily unavailable. You may retry your request later."}}},"paths":{"/issuers/{issuerId}/consumers/{consumerId}/operations:delete":{"post":{"description":"This request is used by the bank backend to request the deletion of an end user.<br/>It will also in cascade delete all the accounts, cards and digital cards owned by the end user.<br/><b>Note:</b> The deletion of the end user cannot be reverted. If the same end user is willing to reuse the solution, we will require a new end user registration with a new consumerId.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"reason":{"$ref":"#/components/schemas/reason"}}}}}},"responses":{"200":{"description":"End user was deleted Successfully","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"operationId":{"$ref":"#/components/schemas/operationId"}}}}}},"400":{"description":"Bad Request, Invalid request URI, header, paramters. The below table defines the possible 'Bad request' error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| FIELD_INVALID_FORMAT |  Contains the field in error (first found) | no | JSON not well formatted or<br>One field is not expected format as defined in this documentation |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"401":{"description":"Unauthorized request, the provided Authorization header is missing or invalid. In the table below only the field \"error\" is provided.\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| AUTHORIZER_UNAUTHORIZED  | Unauthorized message | no | Access token not valid       |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"403":{"description":"Forbidden action detected by WAF or the application.<br>\nThe below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                           |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| AUTHORIZER_FORBIDDEN  | not authorized error message | no | User is not authorized to access this resource |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"404":{"description":"Ressource not found, Unknown issuerId or consumerId or card id'. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n| UNKNOWN_CONSUMER  | -        | no | Consumer does not exist |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"500":{"description":"Internal Server Error. The below table defines the possible error:\n|errorCode       | error       | Retryable | Comments                           |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| INTERNAL_ERROR | error details if any | no | The server has encountered an error when executing the request.  |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"503":{"$ref":"#/components/responses/ServiceUnavailableError"}},"summary":"Delete","tags":["Consumer Operations"],"operationId":"deleteConsumer-v2"}}}}
```

## Update consumer information

> This request is used by the bank backend to request the update of the consumer information.\
> \> #### Note\
> \> Some end user personal information are mandatory for issuers using \`D1 Click to Pay\` service. These mandatory personal information\
> \> such as mobilePhoneNumber or language are tagged bellow with \*"This field is mandatory for Click to Pay"\*. <br>

```json
{"openapi":"3.0.0","info":{"title":"D1 Inbound Consumer API","version":"2.0"},"tags":[{"name":"Consumer Operations","description":"Different operations that can be done on a end user."}],"servers":[{"url":"https://api.d1.thalescloud.io/banking/v2","description":"Production server"},{"url":"https://api.d1-stg.thalescloud.io/banking/v2","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"A JWT generated by the [Get Authorization Token API](oauth2-api).<br/>The server checks the validity of the provided token to control access to this protected resource. Please refer to [Get OAuth 2.0 access token](../../../integrate-the-d1-api/get-oauth-2.0-access-token) for more details on the flow and on how to get this JWT.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"consumerInfoForUpdate":{"additionalProperties":false,"type":"object","title":"ConsumerInfo","description":"the following object represents the personal information of the end user.","properties":{"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"language":{"type":"string","description":"Language as defined by ISO 639-2 standard.\n<br/>**Note**: This field is mandatory for Click to Pay.\n<br/>List of languages accepted : abk, aar, afr, alb, amh, ara, arm, aze, bel, ben, bis, bos, bul, bur, cat, nya, chi, hrv, cze, dan, div, dut, dzo, eng, est, fij, fin, fre, geo, ger, gre, grn, hat, hau, heb, hin, hun, ice, ind, gle, ita, jpn, kaz, khm, kin, kor, kur, kir, lao, lat, lav, lit, ltz, mac, mlg, may, mlt, mao, mah, mon, nau, nep, nor, orm, oss, pus, per, pol, por, rum, roh, rus, smo, sag, srp, sin, slo, slv, som, spa, swa, swe, tgk, tam, tha, ton, tur, tuk, ukr, urd, uzb, vie,\n","minLength":3,"maxLength":3,"pattern":"^[a-z]{3}$"},"firstName":{"type":"string","description":"First name of the end user (Unicode characters allowed).<br/>**Note**: This field is mandatory for Click to Pay.","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"middleName":{"type":"string","description":"Middle name of the end user (Unicode characters allowed).","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"lastName":{"type":"string","description":"Last name of the end user (Unicode characters allowed).<br/>**Note**: This field is mandatory for Click to Pay.","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"secondLastName":{"type":"string","description":"Second Last name of the end user (Unicode characters allowed).","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"dateOfBirth":{"type":"string","description":"Date of Birth.","pattern":"^\\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[0-1])$"},"title":{"type":"string","description":"Title of the end user.<br/>By default D1 support the following title value<br/>- Mr.<br/>- Mrs.<br/>- Miss<br/>Please contact Thales integration team for the support of other value<br/>To not fill in if not applicable.","minLength":2,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"nationality":{"type":"string","description":"Main nationality of the end user in ISO 3166-1 Alpha-2 Code","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"},"email":{"type":"string","description":"Email of the end user.<br/>**Note**: This field is mandatory for Click to Pay with Mastercard.","minLength":5,"maxLength":256,"pattern":"^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,15}$"},"mobilePhoneNumber":{"additionalProperties":false,"description":"Phonenumber of the end user (consumer). Shall respect the E-164 format.<br/>**Note**: This field is mandatory for Click to Pay.","type":"object","required":["countryCode","phoneNumber"],"properties":{"countryCode":{"type":"string","description":"Internantional country code of the end user's phonenumber. Shall start with the '+' sign.","minLength":1,"maxLength":10,"pattern":"^\\+[0-9]{1,10}$"},"phoneNumber":{"type":"string","description":"National phonenumber of the end user. Shall not contain the first '0' of the national phonenumber. If present as input parameter, D1 will ignore it.","minLength":1,"maxLength":14,"pattern":"^[0-9]{1,14}$"}}},"residencyAddress":{"additionalProperties":false,"type":"object","description":"Residency address of the end user (consumer).<br/>In the context of Click to Pay it will be used as \"billing address\" associated to each cards.<br/>**Note**: When set for Click to Pay Mastercard, all fields inside the residencyAddress must be provided, in accordance with Mastercard specification.","required":["line1","city","state","zipCode","countryCode"],"properties":{"recipientName":{"type":"string","description":"Free text field containing the name of the recipient of post mail in case the name is different from first/last name (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line1":{"type":"string","description":"First line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line2":{"type":"string","description":"Second line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line3":{"type":"string","description":"First line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"line4":{"type":"string","description":"Fourth line of the address (Unicode characters allowed).","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,64}$"},"city":{"type":"string","description":"City.","minLength":1,"maxLength":32,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,32}$"},"state":{"type":"string","description":"State.<br/><b>Note</b>: For Click to Pay, this field shall be the second part of ISO_3166-2 format in upper case, representing the state (country subdivision) based on the country.","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\p{M} ,.'_#;:\\/-]{1,40}$"},"zipCode":{"type":"string","description":"Zip Code.","minLength":1,"maxLength":10,"pattern":"^[0-9a-zA-Z -]{1,10}$"},"countryCode":{"type":"string","description":"Country code in ISO 3166-1 alpha-2.<br/>**Note**: This field is mandatory for Click to Pay.","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"}}}},"required":["firstName","lastName"]},"preferences":{"additionalProperties":false,"type":"object","title":"Preferences","description":"the following object represents the preferences of the end user","properties":{"notificationChannel":{"type":"array","description":"list by order of preference the communication channel D1 must use to send notification to user<br/>This do no superseded the restricted list of channel defined at message configuration level</br>if not provided, D1 manage to send the message with the following preference order:<br/>- IN_APP_NOTIFICATION<br/>- SMS<br/>- EMAIL","maxItems":3,"uniqueItems":true,"items":{"type":"string","enum":["SMS","EMAIL","IN_APP_NOTIFICATION"]}}}},"operationId":{"type":"string","description":"Unique identifier of the operation","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$"},"errorGeneric":{"additionalProperties":false,"type":"object","description":"Generic error returned by the APIs.","properties":{"errorCode":{"type":"string","description":"The type of the error"},"error":{"type":"string","description":"Provide more error details if possible.<br/>For example name of the field with invalid format.<br/>This field is for troubleshooting purposes only, it can change at any time so MUST NOT be parsed, and is not supposed to be human readable so CANNOT be displayed to end users."}}}},"responses":{"ServiceUnavailableError":{"description":"The service is temporarily unavailable. You may retry your request later."}}},"paths":{"/issuers/{issuerId}/consumers/{consumerId}/operations:update":{"post":{"description":"This request is used by the bank backend to request the update of the consumer information.\n> #### Note\n> Some end user personal information are mandatory for issuers using `D1 Click to Pay` service. These mandatory personal information\n> such as mobilePhoneNumber or language are tagged bellow with *\"This field is mandatory for Click to Pay\"*. \n","tags":["Consumer Operations"],"requestBody":{"content":{"application/json":{"schema":{"description":"The following object represent the information of the consumer or cardholder.","additionalProperties":false,"type":"object","properties":{"personalInformation":{"$ref":"#/components/schemas/consumerInfoForUpdate"},"preferences":{"$ref":"#/components/schemas/preferences"}}}}}},"responses":{"200":{"description":"Consumer successfully updated.","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"operationId":{"$ref":"#/components/schemas/operationId"}}}}}},"400":{"description":"Bad Request, Invalid request URI, header, paramters. The below table defines the possible 'Bad request' error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no        | No error details available         |\n| FIELD_INVALID_FORMAT |  Contains the field in error (first found) | no | JSON not well formatted or<br>One field is not expected format as defined in this documentation |   \n| FIELD_INVALID_VALUE   | - | no | One field value is not allowed for the given field |     \n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"401":{"description":"Unauthorized request, the provided Authorization header is missing or invalid. In the table below only the field \"error\" is provided.\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| AUTHORIZER_UNAUTHORIZED  | Unauthorized message | no | Access token not valid       |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"403":{"description":"Forbidden action, check the state of the linked consumer or card. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n| AUTHORIZER_FORBIDDEN  | not\\_authorized error message | no | User\\_is\\_not\\_authorized\\_to\\_access\\_this\\_resource |\n| CONSUMER_INVALID_STATE  | contains the state of the resource  | no | Consumer already exists and is deleted |\n| MISSING_C2P_MANDATORY_INFORMATION  | contains the missing field  | no | All required fields for Click to Pay are not present (firstName, lastName, language, mobilePhoneNumber, countryCode, email) or residencyAddress.state length > 3 |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"404":{"description":"Ressource not found, Unknown issuerId or consumerId or card id'. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n| UNKNOWN_CONSUMER  | -        | no | Consumer does not exist |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorGeneric"}}}},"500":{"description":"Internal Server Error. The below table defines the possible error:\n| errorCode      | error       | Retryable | Comments                             |\n| -------------- | ------------| ----------| -----------------------------------|\n| -              | -           | no | No error details available         |\n| INTERNAL_ERROR | Error details if any | no | The server has encountered an error when executing the request. |\n"},"503":{"$ref":"#/components/responses/ServiceUnavailableError"}},"summary":"Update consumer information","operationId":"editConsumer"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/tokenization/ja/integrate-the-d1-api/d1-api-reference/inbound-api-to-d1/consumer-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
