{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Reefpay Docs","description":"Reefpay is the groundbreaking payment gateway that lets you integrate with the future of payments."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"act-on-behalf-of-a-client","__idx":0},"children":["Act on behalf of a client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A platform needs to do things for its merchants: run a transaction, pull a report, board an integration. It does not need their credentials."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Acting-As-Client-Id"]}," names the merchant. You keep authenticating as yourself."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-it-works","__idx":1},"children":["How it works"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Three headers, and only the third changes."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"Api-Key: $d48045e5-f017-4633-a5e7-4efb56f70afa\nClient-Id: CLIENT-01KFDKXMQ637EKEAY410MSQSXB\nX-Acting-As-Client-Id: CLIENT-01KFDKXMQ637ETEAY410MSQTUH\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Api-Key"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client-Id"]}," stay the reseller's. The request is then carried out as though the named client had made it: its integrations are used, its transactions are created, and a report returns its data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The header is accepted on ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["every"]}," operation in the API."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-three-rules","__idx":2},"children":["The three rules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["It works from a parent to its own children, and no further."]}," Naming a client you do not own is rejected. Ownership is the client's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]}," relationship — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/platforms/how-accounts-work"},"children":["How accounts work"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A merchant never sends it."]}," Merchants have no children, so there is nobody to act as. A merchant calling for itself omits the header entirely."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sending your own client ID is not the same as omitting the header."]}," This is the one that catches people. It reads like a harmless no-op, and some operations reject it. If you mean \"act as myself\", leave the header out."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-one-exception","__idx":3},"children":["The one exception"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/clients"]}," cannot use it, because the client you would be acting as does not exist yet."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Boarding works the other way round: you authenticate as the reseller and set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]}," in the body to your own client ID. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/platforms/create-and-update-a-client"},"children":["Create and update a client"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"a-worked-example","__idx":4},"children":["A worked example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Boarding a merchant and taking its first payment, as a platform:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/clients"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]}," set to your ID. No acting header. Store the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_key"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," it returns."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/integrations"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Acting-As-Client-Id"]}," set to the new client, or with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client"]}," in the body naming it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/transactions"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Acting-As-Client-Id"]}," set to the new client. The transaction belongs to the merchant, routed through the merchant's integration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/transactions"]}," with the same header to read that merchant's activity alone — or without it, plus ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]}," as a filter, to read across your portfolio."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":5},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/platforms/how-accounts-work"},"children":["How accounts work"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/platforms/client-reports"},"children":["Client reports"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/get-started/authentication"},"children":["Authentication"]}]}]}]},"headings":[{"value":"Act on behalf of a client","id":"act-on-behalf-of-a-client","depth":1},{"value":"How it works","id":"how-it-works","depth":2},{"value":"The three rules","id":"the-three-rules","depth":2},{"value":"The one exception","id":"the-one-exception","depth":2},{"value":"A worked example","id":"a-worked-example","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Act on behalf of a client","shortTitle":"Act on behalf","intro":"One header lets a reseller run a request for a merchant it owns, without ever holding that merchant's API key.","type":"how-to","seo":{"title":""}},"lastModified":"2026-10-15T04:24:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/platforms/act-on-behalf-of-a-client","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}