Definition of amalgamated sums of monoids Nicolas Bourbaki, in his Algebra volume, defines an amalgamated sum of monoids as follows:

Let $(M_i)_{i\in I}$ be a family of monoids where $e_i$ is the identity element of $M_i$. We are given a monoid $A$ and a family of homomorphisms $h_i:A\longrightarrow M_i$ for every $i\in I$.
The set $S$ the sum of the family has elements the ordered pairs $(i,x)$ with $i\in I$ and $x\in M_i$. For every triple $\alpha = (i,x,x')$ with $i\in I$ and $x,x'\in M_i$, write $u_\alpha = (i,xx')$ and $v_\alpha = (i,x)\cdot(i,x')$. For every triple $\lambda=(i,j,a)\in I\times I \times A$, write $p_\lambda = (i,h_i(a))$ and $q_\lambda = (j,h_j(a))$. For all $i\in I$, write $\epsilon_i=(i,e_i)$.
The monoid $M$ defined by $S$ and the relators $(u_\alpha, v_\alpha)$, $(p_\lambda, q_\lambda)$ and $(\epsilon_i,e)$ is called the sum of the family $(M_i)_{i\in I}$ amalgamated by $A$.

If we take $(i,x),(j,y)\in M$ with $i\neq j$ and there exists an $a\in A$ such that $h_i(a) = x$, then $$(i,x)\cdot (j,y) = \left(j,h_j(a)\right)\cdot (j,y) = \left(j,h_j(a)\cdot y\right)\in M.$$
But, what if there does not exist an $a\in A$ such that $h_i(a) = x$ or $h_j(a) = y$? How can we compute $(i,x)\cdot(j,y)$?
Thank you very much for any help you're able to provide, and my apologies if I am mistaking something or simply not getting the point of the definition at all.
 A: I am not sure, but I think that this is a mistranslation of the original text of Bourbaki or just a minor mistake (even Bourbaki sometimes had mistakes). I can only suspect that Bourbaki meant "The monoid M generated by S [...]".
There is a general definition of "amalgamated product" found in category theory (which is the same as a "pushout"), and I think this is what they really meant. You can check the definition here: https://en.wikipedia.org/wiki/Free_product#Generalization:_Free_product_with_amalgamation (it is only for two objects of an arbitrary category, but you can easily generalize it to the case of an arbitrary number of objects).
So the "intuitive" idea is that a product $(i,x)\cdot(j,y)$ is either "calculated" as you've described above if there is a suitable preimage in $A$, or becomes a "new" element of $M$. Or better you can think about it as a free monoid over disjoint union $\bigcup\limits_{i\in I} M_i$ factored by a relation generated by $(u_α,v_α)$, $(p_λ,q_λ)$ and $(ϵ_i,e)$.
