One way to do it:

1) /v2/claim posted with claim code returns information about the badge.
2) /v2/claim/{badgeid} posted with the claim code claims the badge.