Skip to content

External references

Link a record to its id in one of your systems, or remove that link.

Version v1.1, updated

On this page

An external reference links a record of BIRP to its id in one of your systems, for one source. These two operations manage the links of records that already exist.

Fields

Send says the field is in responses. Receive says a write accepts it; a reference is sent as an object, such as category for category_id. Totals, VAT, numbers and statuses are computed by BIRP and never received.

External reference
FieldTypeRequiredReceive (inbound)Send (outbound)Notes
external_idstringYesYesYes
idstring (uuid)YesNoYes
resourcestringYesNoYesOne of: products, categories, customers, warehouses, orders, invoices.
sourcestringYesNoYes

Links a record to its id in one of your systems, or replaces the link of that source.

  • Scope: the write scope of the resource in the path (products:write, categories:write, customers:write, stock:write, orders:write, invoices:write).

  • Idempotency: Idempotency-Key accepted and recommended.

{resource} is one of products, categories, customers, warehouses, orders, invoices. The scope is the write scope of that resource; warehouses use stock:write.

PUT/v1/{resource}/{id}/external-refs/{source}
Link a record to its id in an external system

Parameters

resourcerequiredstring, in path
Kind of record: products, categories, customers, warehouses, orders or invoices. The operation needs the write scope of that resource (stock:write for warehouses).One of products, categories, customers, warehouses, orders, invoicesExample products
sourcerequiredstring, in path
External system, in lowercase.Example woocommerce
Idempotency-Keystring, in header
Unique value for this request (for example a UUID), 1 to 128 printable ASCII characters. A retry with the same key and the same request gets the stored response for 24 hours, with Idempotency-Replayed: true; the same key with a different request answers 422 idempotency_key_reused. Required on POST, optional on PUT, PATCH and DELETE.Example 00000000-0000-4000-8000-0000000000a1
idrequiredstring (uuid), in path
Identifier of the record.Example 00000000-0000-4000-8000-000000000011

Request body

application/json

external_idrequiredstring
Identifier of the record in the external system.
PUT /v1/{resource}/{id}/external-refs/{source}
curl -X PUT "https://api.birp.io/v1/products/00000000-0000-4000-8000-000000000011/external-refs/woocommerce" \
  -H "Authorization: Bearer $BIRP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"external_id":"1042"}'
200 OKJSON
{
  "data": {
    "external_id": "1042",
    "id": "00000000-0000-4000-8000-000000000011",
    "resource": "products",
    "source": "woocommerce"
  }
}

Errors particular to this operation:

  • 404 not_found

  • 409 external_id_conflict

  • 422 validation_failed

Removes the link of a record for one source. The record itself stays.

  • Scope: the write scope of the resource in the path (products:write, categories:write, customers:write, stock:write, orders:write, invoices:write).

  • Idempotency: Idempotency-Key accepted and recommended.

The scope is the write scope of the resource in the path.

DELETE/v1/{resource}/{id}/external-refs/{source}
Remove the link to an external system

Parameters

resourcerequiredstring, in path
Kind of record: products, categories, customers, warehouses, orders or invoices. The operation needs the write scope of that resource (stock:write for warehouses).One of products, categories, customers, warehouses, orders, invoicesExample products
sourcerequiredstring, in path
External system, in lowercase.Example woocommerce
Idempotency-Keystring, in header
Unique value for this request (for example a UUID), 1 to 128 printable ASCII characters. A retry with the same key and the same request gets the stored response for 24 hours, with Idempotency-Replayed: true; the same key with a different request answers 422 idempotency_key_reused. Required on POST, optional on PUT, PATCH and DELETE.Example 00000000-0000-4000-8000-0000000000a1
idrequiredstring (uuid), in path
Identifier of the record. Also answered when the record has no external id for this source.Example 00000000-0000-4000-8000-000000000011
DELETE /v1/{resource}/{id}/external-refs/{source}
curl -X DELETE "https://api.birp.io/v1/products/00000000-0000-4000-8000-000000000011/external-refs/woocommerce" \
  -H "Authorization: Bearer $BIRP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

The answer is 204 No Content, with no body.

Errors particular to this operation:

  • 404 not_found

  • 422 validation_failed

  • references-and-external-ids
  • sync-products
  • customers