Explain moving a store product

Says what move would do with the same body, without changing anything: whether it would be refused and why, the subscriptions and purchases that would move, the perks buyers would gain and lose, and what each product would be sold as afterwards.

Safe to repeat.

Guide: Map store products

POST
/api/v1/projects/{projectId}/payment-providers/{paymentProviderId}/products/{mappingId}/explain-move

Authorization

AuthorizationBearer <token>

A project secret key: vh_sk_... for production, vh_sk_test_... for test. Keep it on your servers.

In: header

Path parameters

projectId*string

The project's id, proj_.... A secret key works only in the project it belongs to.

paymentProviderId*string

The id of the project's payment provider connection, pp_conf_....

mappingId*string

The mapping's id, pp_prod_....

Request body

application/json

TypeScript definitions

Use the request body type in TypeScript.

productId*string

The product to move the store product to: another product of the project, of the same type and, for a subscription, renewing over the same period.

Examples

curl -X POST "https://api.voidhash.com/api/v1/projects/proj_tz4a98xxat96iws9zmbrgj3a/payment-providers/pp_conf_k2v8d4m1x7c9b3n6q0w5e2r8/products/pp_prod_q4w8e2r6t1y5u9i3o7p0a2s6/explain-move" \  -H "Authorization: Bearer vh_sk_..." \  -H "Content-Type: application/json" \  -d '{    "productId": "prod_m3c7v1b5n9q2w6e0r4t8y2u6"  }'
{  "refusal": null,  "subscriptionCount": 182,  "activeSubscriptionCount": 41,  "purchaseCount": 0,  "perksGained": [],  "perksLost": [    "cloud-sync"  ],  "isSoldOnTarget": true,  "promotedMappingId": null}
{  "error": {    "type": "invalid_request",    "code": "invalid_body",    "message": "The request body is invalid: Missing key\n  at [\"productId\"]"  }}
{  "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": "product_mapping_not_found",    "message": "This payment provider has no store product mapping pp_prod_q4w8e2r6t1y5u9i3o7p0a2s6.",    "param": "mappingId"  }}

{  "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

StatustypecodeWhen
404not_foundproduct_mapping_not_found—
404not_foundproduct_not_found—

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.