We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c73ac0 commit 761ca3bCopy full SHA for 761ca3b
core/b2b/client.ts
@@ -14,6 +14,7 @@ const ENV = z
14
env: z.object({
15
B2B_API_TOKEN: z.string(),
16
BIGCOMMERCE_CHANNEL_ID: z.string(),
17
+ BIGCOMMERCE_STORE_HASH: z.string(),
18
}),
19
})
20
.transform(({ env }) => env);
@@ -29,7 +30,7 @@ const B2BTokenResponseSchema = z.object({
29
30
});
31
32
export async function loginWithB2B({ customerId, customerAccessToken }: LoginWithB2BParams) {
- const { B2B_API_TOKEN, BIGCOMMERCE_CHANNEL_ID } = ENV.parse(process);
33
+ const { B2B_API_TOKEN, BIGCOMMERCE_CHANNEL_ID, BIGCOMMERCE_STORE_HASH } = ENV.parse(process);
34
35
const apiHost = getAPIHostname();
36
@@ -39,6 +40,8 @@ export async function loginWithB2B({ customerId, customerAccessToken }: LoginWit
39
40
Accept: 'application/json',
41
'Content-Type': 'application/json',
42
authToken: B2B_API_TOKEN,
43
+ 'X-Store-Hash': BIGCOMMERCE_STORE_HASH,
44
+ 'X-Auth-Token': B2B_API_TOKEN,
45
},
46
body: JSON.stringify({
47
channelId: BIGCOMMERCE_CHANNEL_ID,
0 commit comments