Idempotency

Preventing duplicate API calls

An idempotency key lets you retry a request safely, without creating a duplicate. Send it in the X-Idempotency-Key header.

How It Works

  • Generate a new key, such as a random UUID, for each request.
  • If you retry with the same key, Harbor returns the original response instead of processing the request again.
  • A reused key always returns the original response, even if the request body is different.

When to Use It

Use it on POST and PATCH requests that create or change something:

  • Create a customer
  • Submit or update onboarding
  • Request a level upgrade
  • Create a transfer
  • Create a deposit account

You don't need it for GET requests.


curl --location --request POST 'https://harbor-sandbox.owlpay.com/api/v1/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-API-KEY: {{API_KEY}}' \
--header 'X-Idempotency-Key: {{Idempotency-Key}}' \
--data-raw '{
  "type": "individual",
  "first_name": "John",
  "middle_name": "Michael",
  "last_name": "Doe",
  "email": "[email protected]",
  "phone_country_code": "US",
  "phone_number": "555-555-1234",
  "birth_date": "1988-04-15",
  "description": "A freelance writer who loves exploring national parks."
}'

Did this page help you?