> 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/pin-management/es/integrar-la-api-d1/referencia-de-la-api-d1/api-saliente-desde-d1/api-del-consumidor.md).

# API del consumidor

[Descargar D1-Public-OUT-v1-Consumer.yaml](https://openapi.gitbook.com/o/fwy1mtbRONGA2YDKDBr0/spec/D1-Public-OUT-v1-Consumer.yaml)

## Get Consumer Information

> This request is used by the D1 backend to request the details of an end user (consumer) from the issuer backend.\<br/>\
> \
> \<i>If the end user information is associated with the card, it is possible to activate "cardId" query parameter via an onboarding flag.\</i>

```json
{"openapi":"3.0.0","info":{"title":"D1 Services API - BankBackend API","version":"1.0"},"servers":[{"url":"https://YOUR_DOMAIN_NAME","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","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.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"consumerInfo":{"type":"object","title":"ConsumerInfo","description":"The following objects represent the personal information of the end user (consumer).","properties":{"language":{"type":"string","description":"Language of the end user (consumer). Based on ISO format for language (ISO 639–1) and an alpha-2 country code (ISO 3166–1 alpha-2). The language must be lowercase, and the country must be uppercase ideally. The language and country should be separated using a minus character \"-\".<br/>**Note**: This field is mandatory for Click to Pay.","minLength":5,"maxLength":5,"pattern":"^[a-z]{2}-[a-zA-Z]{2}$"},"firstName":{"type":"string","description":"First name of the end user (consumer).<br/>**Note**: This field is mandatory for Click to Pay.","minLength":1,"maxLength":128,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,128}$"},"middleName":{"type":"string","description":"Middle name of the end user (consumer).","minLength":1,"maxLength":128,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,128}$"},"lastName":{"type":"string","description":"Last name of the end user (consumer).<br/>**Note**: This field is mandatory for Click to Pay.","minLength":1,"maxLength":128,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,128}$"},"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 (consumer).","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,40}$"},"email":{"type":"string","description":"Email of the end user (consumer).<br/>**Note**: This field is mandatory for Click to Pay (Mastercard).","pattern":"^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,15}$"},"mobilePhoneNumber":{"type":"object","description":"Phonenumber of the end user (consumer).<br/>**Note**: This field is mandatory for Click to Pay.","properties":{"countryCode":{"type":"string","description":"International country code for \"phoneNumber\".","minLength":1,"maxLength":10,"pattern":"^\\+[0-9]{1,10}$"},"phoneNumber":{"type":"string","description":"Phone number.","minLength":1,"maxLength":14,"pattern":"^[0-9]{1,14}$"}},"required":["countryCode","phoneNumber"]},"residencyAddress":{"type":"object","description":"Residency address.<br/>**Note**: This field is mandatory for Click to Pay.","properties":{"line1":{"type":"string","description":"First line of the address.","minLength":1,"maxLength":256,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,256}$"},"line2":{"type":"string","description":"Second line of the address.","minLength":1,"maxLength":256,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,256}$"},"city":{"type":"string","description":"City.","minLength":1,"maxLength":128,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,128}$"},"state":{"type":"string","description":"State.","minLength":1,"maxLength":128,"pattern":"^[\\p{L}\\p{N}\\u0600-\\u06FF ,.'_#;:\\/-]{1,128}$"},"zipCode":{"type":"string","description":"Zip Code.","minLength":1,"maxLength":10,"pattern":"^[0-9a-zA-Z ]{1,10}$"},"countryCode":{"type":"string","description":"Country code. Based on ISO 3166-1 alpha-2 format.<br/>**Note**: This field is mandatory for Click to Pay.","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"}},"required":["line1","zipCode","countryCode"]}},"required":["firstName","lastName"]},"error":{"title":"error","type":"object","description":"An error occured","properties":{"error":{"type":"string","description":"Detailed description of the error occured."}}},"issuerId":{"maxLength":10,"minLength":10,"type":"string"},"consumerId":{"type":"string","description":"Unique identifier of the consumer. ","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$"},"cardId":{"type":"string","description":"Unique identifier of the card.","minLength":1,"maxLength":48,"pattern":"^[A-Za-z0-9_-]{1,48}$"}},"parameters":{"issuer-id-path":{"description":"The id of the issuer","in":"path","name":"issuerId","required":true,"schema":{"$ref":"#/components/schemas/issuerId"}},"consumer-id-path":{"description":"The id of the consumer","in":"path","name":"consumerId","required":true,"schema":{"$ref":"#/components/schemas/consumerId"}}}},"paths":{"/banking/d1/v1/issuers/{issuerId}/consumers/{consumerId}?cardId=<cardId>":{"get":{"description":"This request is used by the D1 backend to request the details of an end user (consumer) from the issuer backend.<br/>\n\n<i>If the end user information is associated with the card, it is possible to activate \"cardId\" query parameter via an onboarding flag.</i>","responses":{"200":{"description":"All needed information related to the requested end user (consumer).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/consumerInfo"}}}},"403":{"description":"Forbidden (Invalid state)"},"404":{"description":"End user (consumer) was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}}}},"summary":"Get Consumer Information","operationId":"getConsumerInfo","parameters":[{"$ref":"#/components/parameters/issuer-id-path"},{"$ref":"#/components/parameters/consumer-id-path"},{"$ref":"#/components/parameters/x-correlation-id"},{"schema":{"$ref":"#/components/schemas/cardId"},"in":"query","name":"cardId"}]}}}}
```

## Notify Consumer Operations (V2)

> This request is used by D1 to notify the issuer backend about operations done on a consumer.

```json
{"openapi":"3.0.0","info":{"title":"D1 Services API - BankBackend API","version":"1.0"},"servers":[{"url":"https://YOUR_DOMAIN_NAME","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","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.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"consumerOperations":{"title":"Operation","type":"object","required":["operationId","operation","status","startTime","consumerId"],"properties":{"operationId":{"$ref":"#/components/schemas/operationId"},"operation":{"type":"string","enum":["CLICK_TO_PAY_UPDATE","CLICK_TO_PAY_OPTOUT"],"description":"Consumer operation"},"status":{"type":"string","enum":["PENDING","SUCCESSFUL","FAILED"],"description":"The operation status"},"startTime":{"type":"string","description":"Time of the operation","minLength":1,"maxLength":64},"endTime":{"type":"string","description":"End time of the operation","minLength":1,"maxLength":64},"consumerId":{"$ref":"#/components/schemas/consumerId"},"details":{"description":"Optional object to get more details on the operation it self. The object definition will depend on the type of operation.","oneOf":[{"$ref":"#/components/schemas/EmptyDetails"}]},"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."}}},"operationId":{"type":"string","description":"Unique identifier of the operation","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$"},"consumerId":{"type":"string","description":"Unique identifier of the consumer. ","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$"},"EmptyDetails":{"type":"object"},"error":{"title":"error","type":"object","description":"An error occured","properties":{"error":{"type":"string","description":"Detailed description of the error occured."}}}}},"paths":{"/notifications/d1/v2/issuers/{issuerId}/consumers":{"post":{"summary":"Notify Consumer Operations (V2)","operationId":"notify-consumer-operations","description":"This request is used by D1 to notify the issuer backend about operations done on a consumer.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"operations":{"type":"array","items":{"$ref":"#/components/schemas/consumerOperations"}}}}}}},"responses":{"204":{"description":"Successful"},"400":{"description":"Bad Request, Invalid request URI or header, or unsupported nonstandard parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}}},"401":{"description":"The provided Authorization header is missing or invalid"},"404":{"description":"Resource not found. Unknown issuerId or consumerId or accountId or cardId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error"}}}}}}}}}
```


---

# 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/pin-management/es/integrar-la-api-d1/referencia-de-la-api-d1/api-saliente-desde-d1/api-del-consumidor.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.
