# JPMC-PDP Documentation from https://developer.payments.jpmorgan.com # Manage a consumer profile You can create and manage a consumer profile using the following operations: - Create a consumer profile - Update a consumer profile - Retrieve a consumer profile - Delete a consumer profile ## Before you begin Learn about [consumer profiles](/docs/commerce/optimization-protection/capabilities/consumer-profile-management/consumer-profiles) and how they work. ## Create a consumer profile You can create a new consumer profile with at least one payment method by sending a `POST`** **request to the `/consumer-profiles` endpoint using the following required fields: **Required fields for creating a consumer profile** | Field name | Data type | Description | Required (R) or Conditionally required (CR) | | --- | --- | --- | --- | | externalConsumerProfileIdentifier | String | Identifies a unique occurrence of a consumer maintained by the merchant or a vendor. Consumer profile contains information relevant to processing transactions such as name, address, account and payment methods information. | R | | consumerProfileAddresses.addressType | String | Codifies the type of address captured for a consumer. Valid values: SHIPPING or BILLING. | R | | profilePaymentMethod | Object | Payment method information. | R | > You must provide a method of payment that you are entitled to when creating a consumer profile or the request will fail. > > If you provide more than one method of payment and a default method of payment is not selected: > > > - Card will be taken as the default. > > - if card is not provided, ACH will be taken as the default. > > - If card and ACH is not provided, SEPA will be taken as the default. > **HTTP Method: **`POST` **Endpoint: **`/consumer-profiles` **Scenario:** Creating a new consumer profile with payment method, address, and communication details provided. ```json { "externalConsumerProfileIdentifier": "3456789fghuj", "cardOnFileReferenceNumber": "123", "firstName": "John", "lastName": "Doe", "profileStatus": "ACTIVE", "consumerProfileAddresses": [ { "firstName": "John", "lastName": "Doe", "consumerAssignedAddressName": "Work", "primaryAddressIndicator": true, "addressType": "SHIPPING", "line1": "400 Elton Farm", "line2": "Apt 123", "city": "Glen Mills", "state": "PA", "postalCode": "19342", "countryCode": "USA", "addressStatus": "ACTIVE" } ], "profilePaymentMethod": { "cardList": [ { "cardExpirationMonthYearNumber": "01/2025", "accountNumber": "1234561111119999", "accountStatus": "ACTIVE", "cardType": "MC", "firstName": "TestFirst", "lastName": "TestLast" } ] }, "communication": { "phoneList": [ { "phoneNumber": "8888888828", "countryCode": "1", "phoneNumberType": "Home" } ], "emailList": [ { "emailAddress": "john.doe.x@gmail.com", "emailAddressType": "Home" } ] } } ``` **Response:** ```json { "consumerProfileId": "PACJGQ", "cardOnFileReferenceNumber": "123", "firstName": "John", "lastName": "Doe", "profileStatus": "ACTIVE", "paymentMethodType": { "cardList": [ { "paymentMethodId": "77ccba29-4857-494a-82bc-2a80e1fa2b9d", "cardExpirationMonthYearNumber": "01/2025", "last4CardNumber": "9999", "accountStatus": "ACTIVE", "cardType": "MC", "firstName": "TestFirst", "lastName": "TestLast", "addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0" } ] }, "communication": { "phoneList": [ { "phoneNumber": "8888888828", "countryCode": "1", "phoneNumberType": "Home" } ], "emailList": [ { "emailAddress": "john.doe.x@gmail.com", "emailAddressType": "Home" } ] }, "addresses": [ { "addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0", "firstName": "John", "lastName": "Doe", "consumerAssignedAddressName": "Work", "primaryAddressIndicator": true, "addressType": "SHIPPING", "line1": "100 Elton Farm", "line2": "Apt 123", "city": "Glen Mills", "state": "PA", "postalCode": "19342", "countryCode": "USA", "addressStatus": "ACTIVE", "paymentMethodIdList": [ "84aeefd8-d776-42fd-8230-eb51369ffedb" ] } ], "createTimestamp": "2024-07-02T10:22:10.591Z", "createUserIdentifier": "jack", "updateTimestamp": "2024-07-02T10:22:10.593Z", "updateUserIdentifier": "jack" } ``` ## Update a consumer profile You can update a consumer profile by sending a `PATCH`** **request to the `/consumer-profiles/{consumer-profile-id}`** **endpoint. **HTTP method:** `POST` **Endpoint:** `/consumer-profiles/PACJGQ` **Scenario:** Updating a consumer profile ```json { "cardOnFileReferenceNumber": "3456789fghuj", "firstName": "John", "lastName": "Doe", "profileStatus": "ACTIVE" } ``` **Response:** ```json { "consumerProfileId": "PACJGQ", "cardOnFileReferenceNumber": "3456789fghuj", "firstName": "John", "lastName": "Doe", "communication": { "phoneList": [ { "phoneNumber": "8888888828", "countryCode": "1", "phoneNumberType": "Home", "communicationIdentifier": "HH04423498968" } ], "emailList": [ { "emailAddress": "john.doe.x@gmail.com", "emailAddressType": "Home", "communicationIdentifier": "EE8141240230923" } ] }, "paymentMethodType": { "cardList": [ { "paymentMethodId": "77ccba29-4857-494a-82bc-2a80e1fa2b9d", "cardExpirationMonthYearNumber": "01/2025", "accountNumber": "1234561111119999", "accountStatus": "ACTIVE", "cardType": "MC", "firstName": "John", "lastName": "Doe", "addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0" } ] }, "addresses": [ { "addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0", "firstName": "John", "lastName": "Doe", "consumerAssignedAddressName": "Work", "primaryAddressIndicator": true, "addressType": "SHIPPING", "line1": "100 Elton Farm", "line2": "Apt 123", "city": "Glen Mills", "state": "PA", "postalCode": "19342", "countryCode": "USA", "addressStatus": "ACTIVE" } ], "correlationIdentifier": "94083a23-cff7-47bd-8223-04a0df6c9421", "createTimestamp": "2021-08-23T00:23:05.353Z", "createUserIdentifier": "jack", "updateTimestamp": "2024-07-02T10:30:25.347Z", "updateUserIdentifier": "jack", "profileStatus": "ACTIVE" } ``` ## Retrieve a consumer profile You can retrieve a consumer profile by sending a `GET`** **request to the `/consumer-profiles/{consumer-profile-id}` endpoint. **HTTP method:** `GET` **Endpoint:** `/consumer-profiles/PACJGQ` **Scenario:** Retrieving a consumer profile with `consumer-profile-id = PACJGO` ```json { "consumerProfileId": "PACJGQ", "cardOnFileReferenceNumber": "3456789fghuj", "firstName": "John", "lastName": "Doe", "communication": { "phoneList": [ { "phoneNumber": "8888888828", "countryCode": "1", "phoneNumberType": "Home", "communicationIdentifier": "HH04423498968" } ], "emailList": [ { "emailAddress": "john.doe.x@gmail.com", "emailAddressType": "Home", "communicationIdentifier": "EE8141240230923" } ] }, "paymentMethodType": { "cardList": [ { "paymentMethodId": "77ccba29-4857-494a-82bc-2a80e1fa2b9d", "cardExpirationMonthYearNumber": "01/2025", "last4CardNumber": "9999", "accountStatus": "ACTIVE", "cardType": "MC", "firstName": "John", "lastName": "Doe", "addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0" } ] }, "addresses": [ { "addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0", "firstName": "John", "lastName": "Doe", "consumerAssignedAddressName": "Work", "primaryAddressIndicator": true, "addressType": "SHIPPING", "line1": "100 Elton Farm", "line2": "Apt 123", "city": "Glen Mills", "state": "PA", "postalCode": "19342", "countryCode": "USA", "addressStatus": "ACTIVE" } ], "correlationIdentifier": "94083a23-cff7-47bd-8223-04a0df6c9421", "createTimestamp": "2021-08-23T00:23:05.353Z", "createUserIdentifier": "jack", "updateTimestamp": "2021-08-23T00:23:05.353Z", "updateUserIdentifier": "jack", "profileStatus": "ACTIVE" } ``` ## Delete a consumer profile You can mark a consumer profile for deletion by sending a `DELETE`** **request to the `/consumer-profiles/{consumer-profile-id}`** **endpoint. **HTTP method:** `DELETE` **Endpoint:** `/consumer-profiles/PACJGQ` **Scenario:** Deleting a consumer profile with `consumer-profile-id = PACJGO` ```json { "responseStatus": "SUCCESS", "responseCode": "ACCEPTED", "responseMessage": "Request Accepted" } ``` ## Related [Consumer profiles](/docs/commerce/optimization-protection/capabilities/consumer-profile-management/consumer-profiles) [Payment methods](/docs/commerce/optimization-protection/capabilities/consumer-profile-management/payment-methods) [Addresses](/docs/commerce/optimization-protection/capabilities/consumer-profile-management/addresses)