import { WaffoPancake } from "@waffo/pancake-ts";const client = new WaffoPancake({ merchantId: process.env.WAFFO_MERCHANT_ID!, privateKey: process.env.WAFFO_PRIVATE_KEY!,});const { store } = await client.stores.create({ name: "My Digital Store" });console.log(store.id); // => "STO_2aUyqjCzEIiEcYMKj7TZtw"console.log(store.slug); // => "my-digital-store-a1b2c3"
// Uses callApi() helper from authentication.mdxconst result = await callApi("POST", "/v1/actions/store/create-store", { name: "My Digital Store",});console.log(result.data.store.id); // => "STO_2aUyqjCzEIiEcYMKj7TZtw"console.log(result.data.store.slug); // => "my-digital-store-a1b2c3"
// Uses callApi() helper from authentication.mdxString body = """ {"name":"My Digital Store"}""";String response = callApi("POST", "/v1/actions/store/create-store", body);System.out.println(response);// => {"data":{"store":{"id":"STO_2aUyqjCzEIiEcYMKj7TZtw","slug":"my-digital-store-a1b2c3",...}}}
# Uses call_api() helper from authentication.mdxresult = call_api("POST", "/v1/actions/store/create-store", { "name": "My Digital Store",})store = result["data"]["store"]print(store["id"]) # => "STO_2aUyqjCzEIiEcYMKj7TZtw"print(store["slug"]) # => "my-digital-store-a1b2c3"
// Uses callAPI() helper from authentication.mdxbody := map[string]interface{}{ "name": "My Digital Store",}result, err := callAPI("POST", "/v1/actions/store/create-store", body)if err != nil { log.Fatal(err)}fmt.Println(string(result))// => {"data":{"store":{"id":"STO_2aUyqjCzEIiEcYMKj7TZtw","slug":"my-digital-store-a1b2c3",...}}}
// Uses call_api() helper from authentication.mdxlet body = serde_json::json!({ "name": "My Digital Store"});let result = call_api("POST", "/v1/actions/store/create-store", &body).await?;println!("{}", result);// => {"data":{"store":{"id":"STO_2aUyqjCzEIiEcYMKj7TZtw","slug":"my-digital-store-a1b2c3",...}}}
/* Uses call_api() helper from authentication.mdx */const char *body = "{\"name\":\"My Digital Store\"}";char *response = call_api("POST", "/v1/actions/store/create-store", body);printf("%s\n", response);free(response);
// Uses callApi() helper from authentication.mdxstd::string body = R"({"name":"My Digital Store"})";std::string response = callApi("POST", "/v1/actions/store/create-store", body);std::cout << response << std::endl;// => {"data":{"store":{"id":"STO_2aUyqjCzEIiEcYMKj7TZtw","slug":"my-digital-store-a1b2c3",...}}}