Update a store product mapping
Replaces a mapping's configuration, such as its offers.
The last update wins.
Guide: Map store products
A project secret key: vh_sk_... for production, vh_sk_test_... for test. Keep it on your servers.
In: header
Path parameters
The project's id, proj_.... A secret key works only in the project it belongs to.
The id of the project's payment provider connection, pp_conf_....
The mapping's id, pp_prod_....
Request body
application/json
TypeScript definitions
Use the request body type in TypeScript.
Replaces the mapping's settings, such as its offers. The store product of a mapping with purchases cannot change.
A payment source mapping's new environment, production, test or all; see the create body.
Examples
curl -X PATCH "https://api.voidhash.com/api/v1/projects/proj_tz4a98xxat96iws9zmbrgj3a/payment-providers/pp_conf_k2v8d4m1x7c9b3n6q0w5e2r8/products/pp_prod_q4w8e2r6t1y5u9i3o7p0a2s6" \ -H "Authorization: Bearer vh_sk_..." \ -H "Content-Type: application/json" \ -d '{ "configuration": { "productId": "com.example.pro_monthly", "offers": [ { "id": "winback-50", "offerId": "com.example.winback_50" } ] } }'{ "id": "pp_prod_q4w8e2r6t1y5u9i3o7p0a2s6", "paymentProviderId": "pp_conf_k2v8d4m1x7c9b3n6q0w5e2r8", "productId": "prod_x8k2m5q9v3n7c1z4w6e0r2t5", "providerProductKey": "com.example.pro_monthly", "isActive": true, "isSold": true, "environment": "all", "configuration": { "productId": "com.example.pro_monthly", "offers": [ { "id": "winback-50", "offerId": "com.example.winback_50" } ] }}{ "error": { "type": "invalid_request", "code": "invalid_product_mapping", "message": "Price price_1PqR8sT2uV3wX4yZ belongs to Stripe product prod_Qa1Bc2De3Fg4Hi, not prod_Qz9Yx8Wv7Ut6Sr", "param": "configuration" }}{ "error": { "type": "unauthenticated", "code": "invalid_api_key", "message": "This secret key is not valid." }}{ "error": { "type": "permission_denied", "code": "permission_denied", "message": "Insufficient permissions." }}{ "error": { "type": "not_found", "code": "project_not_found", "message": "There is no project proj_tz4a98xxat96iws9zmbrgj3a, or this credential cannot use it.", "param": "projectId" }}{ "error": { "type": "internal", "code": "internal_error", "message": "Something went wrong on our side. Try again, and contact support with the Request-Id header if it keeps failing." }}Response body
application/json
application/json
application/json
application/json
application/json
application/json
Errors
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request | invalid_product_mapping | When changing the store product of a mapping with purchases, or taking over a store product linked to another product. |
It can also fail with the errors every operation shares, such as unauthenticated; see Errors.
More in Payment provider products
Something wrong or missing on this page? Tell us by email or on Discord.