You can use a normal unique index treating the json as text. Here is a complete example showing how it works (Corrected):
Create the table:
create table tmp (payload json, name text);
Create our index:
create unique index testindex on tmp ((payload::text), name);
Insert some rows. The first four will work, the rest will fail.
insert into tmp (payload, name) values ('{}', 'foo');
// Succeeds
insert into tmp (payload, name) values ('{}', 'bar');
// Succeeds
insert into tmp (payload, name) values ('{"a":"b"}'::json, 'foo');
// Succeeds
insert into tmp (payload, name) values ('{"a":"b"}'::json, 'bar');
// Succeeds
insert into tmp (payload, name) values ('{"a":"b"}'::json, 'foo');
// Fails due to index
insert into tmp (payload, name) values ('{}', 'bar');
// Fails due to index
If something here isn't working as you expect, please clarify.