BimpHelp

External IDs in the Bimp API: mapping objects to your system

Updated 4 min read

On this page
In short

An external ID is a "source + externalId" pair that links a Bimp object (UUID) to an identifier in your store or marketplace. Six methods with the ExternalId suffix are available for four resources: products, counterparty, customer order and sales. The link is created by api-saveExternalId.

What an external ID is

An external ID is a link between a Bimp object and its identifier in your system, stored as a source + externalId pair. Because of it, the integration does not have to store Bimp UUIDs: it looks up the Bimp object by its own identifier and creates the link after the first import. Typical examples are a product ID on a website, a user ID in a store, or a marketplace order number.

Link fields:

FieldWhat it means
sourceIdentifier of the external system (prom, rozetka, shopify). Case-insensitive: the value is trimmed and converted to lower case
externalIdIdentifier of the object in the external system (string)
UUID of the Bimp objectNamed in the request according to the resource (see the table below)

For one Bimp object you can store a separate externalId for each source.

Which resources support external IDs

Four resources support external IDs; all paths start with /org2/, and the methods are POST.

ResourcePathObject UUID parameterReference
Products/org2/nomenclature/api-…ExternalIdnomenclatureUuidnomenclature
Counterparties/org2/counterparty/api-…ExternalIdcounterpartyUuidcounterparty
Customer orders/org2/invoiceForCustomerPayment/api-…ExternalIdorderUuidinvoice-for-customer-payment
Sales/org2/salesInvoice/api-…ExternalIdsalesInvoiceUuidsales-invoice

The full set of paths for each resource is api-saveExternalId, api-readExternalId, api-readByExternalId, api-readExternalIdsList, api-readWithoutExternalId, api-deleteExternalId.

Which methods are available

All six methods work the same way for every resource. Below, <uuidField> is the parameter from the table above.

MethodWhat it doesRequest bodydata in the response
api-saveExternalIdCreates or updates a link<uuidField>, source, externalId (all required){"success": true}
api-readExternalIdReturns the object’s external ID for source<uuidField>, source (required){"externalId": "..."} or null
api-readByExternalIdFinds a Bimp object by external IDsource, externalId (required)Bimp object (see below) or null if there is no link
api-readExternalIdsListList of links with filterspagination (required), source, <uuidField>array of links
api-readWithoutExternalIdObjects without a link for sourcepagination, source (required)array of Bimp objects
api-deleteExternalIdDeletes a link<uuidField> (required), sourcetrue

pagination looks like {"offset": 0, "count": 100} (maximum count is 100), see Limits, pagination and errors.

What the read methods return, by resource:

ResourcereadByExternalId and readExternalIdsListreadWithoutExternalId
ProductsreadByExternalId: nomenclatureUuid, name; list: nomenclatureUuid, name, source, externalIdnomenclatureUuid, name
CounterpartyreadByExternalId: counterpartyUuid, name; list: counterpartyUuid, name, source, externalIdcounterpartyUuid, name
Customer orderorderUuid, date, number, source, externalIdorderUuid, number, date, amount, comment, counterpartyName, counterpartyUuid, currency, statusName
SalessalesInvoiceUuid, date, number, source, externalIdsalesInvoiceUuid, number, date, amount, comment, counterpartyName, counterpartyUuid, currency (the list may be fuller)

How to map an order to your system

The typical flow for customer orders looks like this, and for products and counterparties it is identical.

  1. For a new order from the store, check whether it already exists in Bimp. Call api-readByExternalId:

    curl -X POST https://app.bimpsoft.com/org2/invoiceForCustomerPayment/api-readByExternalId \
      -H "access-token: <COMPANY_ACCESS_TOKEN>" \
      -H "Content-Type: application/json" \
      -d '{"source": "myshop", "externalId": "ORD-10452"}'

    The response {"success": true, "data": null} means the order has not been imported yet.

  2. Create the order with the /org2/invoiceForCustomerPayment/api-create method, see the reference.

  3. Save the link:

    curl -X POST https://app.bimpsoft.com/org2/invoiceForCustomerPayment/api-saveExternalId \
      -H "access-token: <COMPANY_ACCESS_TOKEN>" \
      -H "Content-Type: application/json" \
      -d '{"orderUuid": "<ORDER_UUID>", "source": "myshop", "externalId": "ORD-10452"}'
    { "success": true, "data": { "success": true } }
  4. To find orders not yet mapped to your system, call api-readWithoutExternalId:

    curl -X POST https://app.bimpsoft.com/org2/invoiceForCustomerPayment/api-readWithoutExternalId \
      -H "access-token: <COMPANY_ACCESS_TOKEN>" \
      -H "Content-Type: application/json" \
      -d '{"pagination": {"offset": 0, "count": 100}, "source": "myshop"}'

Full scenarios are in Syncing orders with an online store and Syncing the product catalog.

The api-deleteExternalId method deletes the link for the given source. If source is not passed, all external links of this object are deleted. The method returns true both when the link was deleted and when there was none.

curl -X POST https://app.bimpsoft.com/org2/nomenclature/api-deleteExternalId \
  -H "access-token: <COMPANY_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"nomenclatureUuid": "<NOMENCLATURE_UUID>", "source": "prom"}'

FAQ

Which Bimp objects support external IDs?

Four resources: products (nomenclature), counterparty, customer order (invoiceForCustomerPayment) and sales (salesInvoice). The same six methods are available for each.

What is the source parameter?

An identifier of the external system, for example prom or rozetka. The value is case-insensitive: Bimp trims spaces and converts it to lower case. One object can have a separate external ID for each source.

How do I find objects that are not yet mapped to my system?

Call readWithoutExternalId of the corresponding resource with the pagination and source parameters. The method returns objects that have no link for this source.

What does readByExternalId return if there is no link?

A successful response with data: null, not an error.

Was this article helpful?

Read next

Didn't find the answer?Write to us — support replies during business hours.