From 0763f274e2711ec9d1d7b596f5d73b5b30cbb322 Mon Sep 17 00:00:00 2001 From: franklin Date: Tue, 22 Sep 2026 16:54:48 -0500 Subject: [PATCH] feat: add Idempotency-Key header to support idempotent requests --- _build/api.yaml | 44 +++++++++++++++++++ .../commons/headers/idempotency_key.yml | 7 +++ resources/checkouts/checkouts.yml | 1 + resources/orders/order.yml | 1 + resources/orders/order_charge_param.yml | 1 + resources/orders/order_charges_param.yml | 1 + 6 files changed, 55 insertions(+) create mode 100644 parameters/commons/headers/idempotency_key.yml diff --git a/_build/api.yaml b/_build/api.yaml index 44898681..2e15792d 100644 --- a/_build/api.yaml +++ b/_build/api.yaml @@ -2257,6 +2257,17 @@ paths: schema: type: string style: simple + - description: Unique key to make the request idempotent. Retrying a request + with the same key returns the original response instead of performing the + operation again. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple requestBody: content: application/json: @@ -2398,6 +2409,17 @@ paths: schema: type: string style: simple + - description: Unique key to make the request idempotent. Retrying a request + with the same key returns the original response instead of performing the + operation again. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple requestBody: content: application/json: @@ -5903,6 +5925,17 @@ paths: schema: type: string style: simple + - description: Unique key to make the request idempotent. Retrying a request + with the same key returns the original response instead of performing the + operation again. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple requestBody: content: application/json: @@ -8458,6 +8491,17 @@ paths: schema: type: string style: simple + - description: Unique key to make the request idempotent. Retrying a request + with the same key returns the original response instead of performing the + operation again. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple requestBody: content: application/json: diff --git a/parameters/commons/headers/idempotency_key.yml b/parameters/commons/headers/idempotency_key.yml new file mode 100644 index 00000000..b6a1c114 --- /dev/null +++ b/parameters/commons/headers/idempotency_key.yml @@ -0,0 +1,7 @@ +in: header +name: "Idempotency-Key" +description: Unique key to make the request idempotent. Retrying a request with the same key returns the original response instead of performing the operation again. +required: false +schema: + type: string +example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" diff --git a/resources/checkouts/checkouts.yml b/resources/checkouts/checkouts.yml index 9cfe1e02..c1fac1f4 100644 --- a/resources/checkouts/checkouts.yml +++ b/resources/checkouts/checkouts.yml @@ -115,3 +115,4 @@ post: parameters: - $ref: '../../parameters/commons/headers/accept_language.yml' - $ref: '../../parameters/commons/headers/x_child_company_id.yml' + - $ref: '../../parameters/commons/headers/idempotency_key.yml' diff --git a/resources/orders/order.yml b/resources/orders/order.yml index bbde2566..d317def9 100644 --- a/resources/orders/order.yml +++ b/resources/orders/order.yml @@ -39,6 +39,7 @@ post: parameters: - $ref: '../../parameters/commons/headers/accept_language.yml' - $ref: '../../parameters/commons/headers/x_child_company_id.yml' + - $ref: '../../parameters/commons/headers/idempotency_key.yml' get: tags: - Orders diff --git a/resources/orders/order_charge_param.yml b/resources/orders/order_charge_param.yml index 89077dbf..fc294ecb 100644 --- a/resources/orders/order_charge_param.yml +++ b/resources/orders/order_charge_param.yml @@ -27,3 +27,4 @@ post: - $ref: '../../parameters/commons/path_param/id.yml' - $ref: '../../parameters/commons/headers/accept_language.yml' - $ref: '../../parameters/commons/headers/x_child_company_id.yml' + - $ref: '../../parameters/commons/headers/idempotency_key.yml' diff --git a/resources/orders/order_charges_param.yml b/resources/orders/order_charges_param.yml index 796e9e30..ca38929d 100644 --- a/resources/orders/order_charges_param.yml +++ b/resources/orders/order_charges_param.yml @@ -27,3 +27,4 @@ post: - $ref: '../../parameters/commons/path_param/id.yml' - $ref: '../../parameters/commons/headers/accept_language.yml' - $ref: '../../parameters/commons/headers/x_child_company_id.yml' + - $ref: '../../parameters/commons/headers/idempotency_key.yml'