Modify a travel document

  • Customers
  • Customer account
  • 3 routes
How do I modify a customer's travel document?

This scenario allows a client to modify their travel document regardless of its type

Overview

Use this scenario to read the customer context, review the relevant legal information, and then update one travel document on the same account. This sequence helps secure the change by confirming that the right customer and the right document are being targeted first.

Prerequisites

  • Have a valid customer_id.
  • Send authorization, x-api-key, and accept-language on customer-scoped routes.
  • Prepare the travel-document data that must be corrected before the update call.

Process workflow

Legend:
Mandatory
Optional
1

Retrieve a customer's information

Mandatory

Use GET/v0/customers/{customer_id} to confirm the customer account context before editing a travel document.

Prerequisites

Prepare customer_id. Keep x-api-key and, when the route is customer-scoped, a valid bearer token.

Calling CURL

curl -X GET \
  -H "x-api-key: YOUR_API_KEY" \
  -H "accept-language: en-US" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.clubmed.com/v0/customers/{customer_id}"

Example answer

{
  "id": "customer-1",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane@example.com"
}

info: Use the returned identity data to confirm that the right customer is selected before reading or patching travel documents.


Response codes

  • 200 OK: the expected data is returned.
  • 400 Bad Request: the request is invalid or incomplete.
  • 401 Unauthorized: the token is missing or invalid.
  • 403 Forbidden: access is denied in this context.
  • 404 Not Found: the requested resource cannot be found.
GET/v0/customers/{customer_id}
See more
2

Review legal information

Mandatory

Use GET/v0/legal_info to retrieve the legal constraints that may impact the travel-document data you are about to maintain.

Prerequisites

Prepare the parameters required by the call. Keep x-api-key and, when the route is customer-scoped, a valid bearer token.

Calling CURL

curl -X GET \
  -H "x-api-key: YOUR_API_KEY" \
  -H "accept-language: en-US" \
  "https://api.clubmed.com/v0/legal_info"

Example answer

{
  "terms_url": "https://example.com/terms",
  "privacy_url": "https://example.com/privacy"
}

info: Review the legal constraints first so mandatory travel-document fields are validated against the right market context.


Response codes

  • 200 OK: the expected data is returned.
  • 400 Bad Request: the request is invalid or incomplete.
  • 404 Not Found: the requested resource cannot be found.
GET/v0/legal_info
See more
3

Modify a travel document

Mandatory

Use PATCH/v1/customers/{customer_id}/travel_documents to modify a travel document.

Prerequisites

Prepare customer_id. Keep x-api-key and, when the route is customer-scoped, a valid bearer token. Validate the request body before the call to avoid a validation error.

Calling CURL

curl -X PATCH \
  -H "x-api-key: YOUR_API_KEY" \
  -H "accept-language: en-US" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"documents": [{"id": "doc-1", "number": "XX123456", "expiration_date": "2030-07-01"}]}' \
  "https://api.clubmed.com/v1/customers/{customer_id}/travel_documents"

Example answer

HTTP/1.1 204 No Content

info: Success may be returned without a response body. Read the resource again afterwards if you need to display the final state.


Response codes

  • 204 No Content: the operation is applied successfully.
  • 400 Bad Request: the body or parameters are invalid.
  • 401 Unauthorized: the token is missing or invalid.
  • 403 Forbidden: access is denied in this context.
  • 404 Not Found: the target resource cannot be found.
PATCH/v1/customers/{customer_id}/travel_documents
See more