Thank you for your question. My name is***** have been a small animal veterinarian for 13 years and I'd like to help with your question.
It can be stressful whenever a dogs eats something that he shouldn't. What material was it made out of besides the pins? Sometimes materials that don't break apart can be particularly risky because they can become tangled in the intestine an cause a 'linear foreign body" effect. And the pins pose a risk of causing trauma in the intestine also. It might be worth getting him to a veterinarian to take an X-ray just to find out about the pins (the are metal and will show up on an X-ray). Whether the pins are in there or not may effect how you treat him. You have a few choices.
Since the material is likely in the stomach still, making him vomit to try to get them out is an option. If it is successful and he vomits it up, then the problem is solved, however there are a number of risks to this approach. First, there is the possibility that it could get stuck in the esophagus on the way back up and cause him to choke or just lodge somewhere that is very difficult to access to remove it. Second, he could aspirate and develop pneumonia from the vomiting. I have had dogs successfully vomit up things they have swallowed, but I don't think it is worth the risk in this case, especially if there are pins in there. They would be very dangerous to vomit back up.
The second option is that a veterinarian can retrieve the material from the stomach with surgery or an endoscope. This is probably the safest option. The stomach is the safest part of the intestine to do surgery on. The down side is the expense. Surgery to remove the material might run you $1500 or more and endoscopy would be the about the same. There would be a short hospital stay and recovery period, but this option offers the fastest safe resolution to the problem. If there are pins in there it might be the recommended option.
The third option is to feed him high fiber diet and hope that the material can bend and twist it's way through the intestine and pass. I have seen this happen too.... it just depends on how thing move in there. If it passes you are all good, but if it gets stuck then you have to go to surgery to retrieve it. And the surgical cost and complication of removing it from the intestine once it is stuck will be higher than removing it from the stomach now. With small foreign bodies this is a possible option, watch him closely. The first sign of belly pain or vomiting and you need to head to surgery.
I hope this helps, but if you have additional questions please let me know. If not, please rate my answer.