Sign in

Sync store ↔ policy links

PUT https://{organization}.myguper.com/api/register/store/walletLink

A redemption policy only applies at the stores linked to it. Each link is a (store, wallet) pair, where wallet is the policy id.

Sets all the links of one side at once, in a single transaction. Anchor one side and send the complete list of the other:

  • {"wallet": 108, "stores": [22, 23, 41]} — the policy will apply exactly at these stores.
  • {"store": 22, "wallets": [108, 109]} — exactly these policies will apply at this store.

The list is the final state, not an increment: links missing from it are removed, and an empty list removes every link of the anchor. Invalid ids (0, negative, non-numeric) are ignored, and repeated ids are merged. Sending the same body twice gives the same result.

If any store does not exist in the organization, nothing is changed and the response is 422.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header.

Headers

Name Type Description
x-guper-authorization * string User token issued by Guper.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Request body

Content-Type: application/json

{
    "wallet": 108,                                              // optional
    "stores": [                                                 // optional
        22,
        23,
        41
    ],
    "store": null,                                              // optional
    "wallets": null                                             // optional
}

Responses

{
    "organization": "acme",
    "wallet": 108,
    "linked": [22, 23, 41],
    "created": 1,
    "removed": 2
}
Copied to clipboard