Skip to main content
This guide walks you through a complete request / response cycle against the Contracts Inbound API — one of the simplest async integrations to start with. By the end you’ll have submitted a batch, polled its status, and parsed both the success and error shapes. The same pattern (auth headers + async submission + gu_id polling) applies to every REST API integration in this docs site, so what you learn here transfers directly to AP, AR, GL, Lease, Sales, and the rest.
Need SFTP file-based integration instead? Jump to the SFTP file delivery section at the bottom.

Prerequisites

1

Get your API credentials

Contact your Tango onboarding lead to request a client identifier and API key. You’ll receive two values:
  • x-client — a string identifying your client.
  • x-api-key — a secret bound to that client.
Both are needed on every request. Keep x-api-key in a secret manager, never in source control.
The test (testapi.tangoanalytics.com) and production (api.tangoanalytics.com) keys are different. Don’t reuse the same value across environments.
2

Confirm a supplier site exists

The Contracts Inbound API upserts on the key (supplier_site_number, contract_number). Your supplier_site_number must already exist in Tango — if it doesn’t, submission will fail with supplier_site_number does not exist.Ask your Tango onboarding lead which supplier site numbers are pre-loaded in your test environment, or pick one from the data your team has already migrated.
3

Pick an environment

Use the test environment for everything in this guide:
For production, swap the base URL to https://api.tangoanalytics.com and the credentials to your prod values.

Submit your first batch

The Contracts Inbound endpoint accepts a JSON body with a records array. The minimum required fields per record are: contract_number, contract_name, supplier_site_number, contract_start_date, contract_end_date, contract_amount.
You’ll get back an immediate acknowledgement:
Hang onto that gu_id — you’ll use it in the next step. It uniquely identifies the batch and can be polled repeatedly. If you lose it you cannot retrieve the result; you’d need to resubmit (which would also overwrite, since the upsert key is (supplier_site_number, contract_number)).

Poll for status

Tango processes the batch asynchronously. Hit the shared status endpoint until you get a terminal state (COMPLETED or ERROR):
You’ll see one of three response shapes, in this order:
Keep polling. There’s no time guarantee — small batches typically clear within seconds; multi-thousand-record submissions can take a few minutes.
Polling cadence. Start at 5–10 seconds, back off to 30–60 seconds after a minute, and cap at 2 minutes. Don’t poll faster than every 5 seconds; it doesn’t make the batch finish sooner.

Handle errors properly

A few error patterns to watch for:
Your x-client / x-api-key headers are missing, mistyped, or don’t have access to the endpoint. Verify both values and confirm with Tango that your client has the right permissions enabled.
The submission itself was rejected before queueing — usually a malformed JSON body or a content-type mismatch. The status_message field will tell you which. A gu_id is NOT returned for these.
Tango couldn’t process the batch at all (rare). Check status_message for context; resubmit the batch.
See the Validations table in the per-integration .md reference for the full list of error messages. Common ones:
  • <field> is missing or empty — required field omitted.
  • <field> does not match expected format — usually a date in something other than MM/DD/YYYY.
  • supplier_site_number does not exist — referenced an unknown entity.
  • <field> does not match lookup value — sent a value outside the configured lookup set.

Where to go next

Browse all integrations

See every available integration grouped by domain.

API reference

The full OpenAPI 3.1 spec catalogue.

Async patterns deep dive

More on gu_id, pagination, retries, and idempotency.

Field conventions

Date formats, null-omission rules, currency handling.

Alternative: SFTP file delivery

If you’re integrating via SFTP files instead of REST APIs, the flow is different but simpler:
1

Get SFTP credentials

Tango will provision a username + password (or SSH key) for the relevant SFTP host:
  • Production: sftp.tangoanalytics.com
  • Test (SIT/UAT): sftpdev.tangoanalytics.com
2

Drop a pipe-delimited `.txt` file

Use the integration’s documented path and naming pattern, e.g.:
Body is one record per line, fields separated by |. See the integration’s .md reference for the exact column order.
3

Wait for Tango to consume the file

Tango’s batch program picks up files on a pre-agreed schedule. Once consumed, the file moves to a Processed/ subfolder with a timestamp suffix. Any errors are written to a service log and emailed to the configured contact.
Most file-based integrations have a REST API counterpart that’s preferred for new work. Check the integrations list to see which mode is appropriate for your use case.