{
  "info": {
    "name": "Mereu API v1",
    "description": "Configure every empty variable. Keys stay on your server; no expiry by default, optional term in the cabinet. Numeric variables must be filled with integer values. Read-only datasets start with mode=snapshot; see the CRM examples for checkpointing and changes. Financial requests are manual and require verified payment/return facts. Persist UUIDs and payloads before sending; update revisions from responses. No automatic payment scripts. Read /developers first.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://mereu.md/api/v1",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "",
      "type": "string"
    },
    {
      "key": "location_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "card_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "card_code",
      "value": "",
      "type": "string"
    },
    {
      "key": "quote_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "checkout_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "transaction_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "source",
      "value": "my_pos",
      "type": "string"
    },
    {
      "key": "account_id",
      "value": "merchant-1",
      "type": "string"
    },
    {
      "key": "external_location_id",
      "value": "store-1",
      "type": "string"
    },
    {
      "key": "document_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "refund_document_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "currency",
      "value": "MDL",
      "type": "string"
    },
    {
      "key": "paid_at",
      "value": "",
      "type": "string"
    },
    {
      "key": "occurred_at",
      "value": "",
      "type": "string"
    },
    {
      "key": "provider_payment_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "provider_refund_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "checkout_revision",
      "value": "",
      "type": "string"
    },
    {
      "key": "paid_total_minor",
      "value": "",
      "type": "string"
    },
    {
      "key": "refunded_total_minor",
      "value": "",
      "type": "string"
    },
    {
      "key": "refunded_eligible_minor",
      "value": "",
      "type": "string"
    },
    {
      "key": "page_limit",
      "value": "100",
      "type": "string"
    },
    {
      "key": "previewCheckout_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "prepareCheckout_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "commitCheckout_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "cancelCheckout_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "recordObservedPurchase_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "recordRefund_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "reverseTransaction_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "markPaymentStarted_operation_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "customers_cursor",
      "value": "",
      "type": "string"
    },
    {
      "key": "cards_cursor",
      "value": "",
      "type": "string"
    },
    {
      "key": "transactions_cursor",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "GET /account",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/account",
        "description": "Get tenant context and granted scopes. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu."
      }
    },
    {
      "name": "GET /reference-data",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/reference-data",
        "description": "Get supported country currency and timezone suggestions. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu."
      }
    },
    {
      "name": "GET /locations",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/locations",
        "description": "List locations. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu."
      }
    },
    {
      "name": "GET /programs",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/programs",
        "description": "List programs. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu."
      }
    },
    {
      "name": "POST /checkouts/preview",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{previewCheckout_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/checkouts/preview",
        "description": "Calculate benefit without reservation. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"location_id\": \"{{location_id}}\",\n  \"card_id\": \"{{card_id}}\",\n  \"amounts\": {\n    \"total_before_loyalty\": {\n      \"amount_minor\": 10000,\n      \"currency\": \"{{currency}}\"\n    },\n    \"eligible_amount\": {\n      \"amount_minor\": 10000,\n      \"currency\": \"{{currency}}\"\n    },\n    \"tax_included_minor\": 0,\n    \"tip_minor\": 0,\n    \"surcharge_minor\": 0\n  },\n  \"reward\": {\n    \"mode\": \"none\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "POST /checkouts",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{prepareCheckout_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/checkouts",
        "description": "Reserve benefit for an external sale. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"quote_id\": \"{{quote_id}}\",\n  \"external_ref\": {\n    \"source\": \"{{source}}\",\n    \"account_id\": \"{{account_id}}\",\n    \"location_id\": \"{{external_location_id}}\",\n    \"id\": \"{{document_id}}\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "GET /checkouts/{id}",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/checkouts/{{checkout_id}}",
        "description": "Reconcile checkout status. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu."
      }
    },
    {
      "name": "POST /checkouts/{id}/commit",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{commitCheckout_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/checkouts/{{checkout_id}}/commit",
        "description": "Commit after verified external payment. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Set checkout_revision to the latest returned revision. Commit paid_total_minor must be the quote expected_paid_total and the verified actual payment.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expected_revision\": {{checkout_revision}},\n  \"paid_total\": {\n    \"amount_minor\": {{paid_total_minor}},\n    \"currency\": \"{{currency}}\"\n  },\n  \"paid_at\": \"{{paid_at}}\",\n  \"provider_payment_id\": \"{{provider_payment_id}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "POST /checkouts/{id}/cancel",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{cancelCheckout_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/checkouts/{{checkout_id}}/cancel",
        "description": "Release prepared reservation. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Set checkout_revision to the latest returned revision. Commit paid_total_minor must be the quote expected_paid_total and the verified actual payment.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expected_revision\": {{checkout_revision}},\n  \"reason\": \"Verified unpaid in our POS\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "POST /purchases",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{recordObservedPurchase_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/purchases",
        "description": "Record already paid purchase for accrual only. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"location_id\": \"{{location_id}}\",\n  \"card_id\": \"{{card_id}}\",\n  \"external_ref\": {\n    \"source\": \"{{source}}\",\n    \"account_id\": \"{{account_id}}\",\n    \"location_id\": \"{{external_location_id}}\",\n    \"id\": \"{{document_id}}\"\n  },\n  \"paid_total\": {\n    \"amount_minor\": 10000,\n    \"currency\": \"{{currency}}\"\n  },\n  \"eligible_amount\": {\n    \"amount_minor\": 10000,\n    \"currency\": \"{{currency}}\"\n  },\n  \"paid_at\": \"{{paid_at}}\",\n  \"provider_payment_id\": \"{{provider_payment_id}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "GET /transactions/{id}",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/transactions/{{transaction_id}}",
        "description": "Get Transaction. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu."
      }
    },
    {
      "name": "POST /transactions/{id}/refunds",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{recordRefund_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/transactions/{{transaction_id}}/refunds",
        "description": "Record full or partial provider refund. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"external_ref\": {\n    \"source\": \"{{source}}\",\n    \"account_id\": \"{{account_id}}\",\n    \"location_id\": \"{{external_location_id}}\",\n    \"id\": \"{{refund_document_id}}\"\n  },\n  \"refunded_total\": {\n    \"amount_minor\": {{refunded_total_minor}},\n    \"currency\": \"{{currency}}\"\n  },\n  \"refunded_eligible_amount\": {\n    \"amount_minor\": {{refunded_eligible_minor}},\n    \"currency\": \"{{currency}}\"\n  },\n  \"occurred_at\": \"{{occurred_at}}\",\n  \"provider_refund_id\": \"{{provider_refund_id}}\",\n  \"reason\": \"Verified return in our POS\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "POST /transactions/{id}/reversal",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{reverseTransaction_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/transactions/{{transaction_id}}/reversal",
        "description": "Record verified void of a sale. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"external_ref\": {\n    \"source\": \"{{source}}\",\n    \"account_id\": \"{{account_id}}\",\n    \"location_id\": \"{{external_location_id}}\",\n    \"id\": \"{{refund_document_id}}\"\n  },\n  \"refunded_total\": {\n    \"amount_minor\": {{refunded_total_minor}},\n    \"currency\": \"{{currency}}\"\n  },\n  \"refunded_eligible_amount\": {\n    \"amount_minor\": {{refunded_eligible_minor}},\n    \"currency\": \"{{currency}}\"\n  },\n  \"occurred_at\": \"{{occurred_at}}\",\n  \"provider_refund_id\": \"{{provider_refund_id}}\",\n  \"reason\": \"Verified return in our POS\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "POST /checkouts/{id}/payment-started",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{markPaymentStarted_operation_id}}",
            "description": "Persist one UUID per operation; repeat the same UUID and exact body on retry."
          }
        ],
        "url": "{{base_url}}/checkouts/{{checkout_id}}/payment-started",
        "description": "Confirm payment is about to start before applying the benefit or charging. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Set checkout_revision to the latest returned revision. Commit paid_total_minor must be the quote expected_paid_total and the verified actual payment.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expected_revision\": {{checkout_revision}}\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "POST /cards/resolve",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/cards/resolve",
        "description": "Resolve an exact card code without contact data. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"location_id\": \"{{location_id}}\",\n  \"card_code\": \"{{card_code}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "GET /data/customers",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/data/customers?mode=snapshot&limit={{page_limit}}&cursor={{customers_cursor}}",
        "description": "Read and synchronize customers. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Complete all snapshot pages with cursor=next_cursor. Then mode=changes&cursor=sync_cursor; apply deletes/upserts and checkpoint atomically. Keep each resource cursor separate; clear it before a new snapshot."
      }
    },
    {
      "name": "GET /data/customers (changes)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/data/customers?mode=changes&limit={{page_limit}}&cursor={{customers_cursor}}",
        "description": "Read and synchronize customers. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Complete all snapshot pages with cursor=next_cursor. Then mode=changes&cursor=sync_cursor; apply deletes/upserts and checkpoint atomically. Keep each resource cursor separate; clear it before a new snapshot. Requires the saved sync_cursor/next_cursor for THIS resource; empty or expired cursor requires bootstrap."
      }
    },
    {
      "name": "GET /data/cards",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/data/cards?mode=snapshot&limit={{page_limit}}&cursor={{cards_cursor}}",
        "description": "Read and synchronize cards. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Complete all snapshot pages with cursor=next_cursor. Then mode=changes&cursor=sync_cursor; apply deletes/upserts and checkpoint atomically. Keep each resource cursor separate; clear it before a new snapshot."
      }
    },
    {
      "name": "GET /data/cards (changes)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/data/cards?mode=changes&limit={{page_limit}}&cursor={{cards_cursor}}",
        "description": "Read and synchronize cards. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Complete all snapshot pages with cursor=next_cursor. Then mode=changes&cursor=sync_cursor; apply deletes/upserts and checkpoint atomically. Keep each resource cursor separate; clear it before a new snapshot. Requires the saved sync_cursor/next_cursor for THIS resource; empty or expired cursor requires bootstrap."
      }
    },
    {
      "name": "GET /data/transactions",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/data/transactions?mode=snapshot&limit={{page_limit}}&cursor={{transactions_cursor}}",
        "description": "Read and synchronize transactions. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Complete all snapshot pages with cursor=next_cursor. Then mode=changes&cursor=sync_cursor; apply deletes/upserts and checkpoint atomically. Keep each resource cursor separate; clear it before a new snapshot."
      }
    },
    {
      "name": "GET /data/transactions (changes)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/data/transactions?mode=changes&limit={{page_limit}}&cursor={{transactions_cursor}}",
        "description": "Read and synchronize transactions. Fill verified references, money amounts and persisted operation UUIDs before sending. No payment is executed by Mereu. Complete all snapshot pages with cursor=next_cursor. Then mode=changes&cursor=sync_cursor; apply deletes/upserts and checkpoint atomically. Keep each resource cursor separate; clear it before a new snapshot. Requires the saved sync_cursor/next_cursor for THIS resource; empty or expired cursor requires bootstrap."
      }
    }
  ]
}