> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shoply.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask for a payout

> Asks the seller to pay the affiliate, where the store allows payouts. The amount comes off their affiliate balance now and goes back if the seller declines or the request is taken back. One at a time. Shoply moves no money: the seller pays it and marks it paid.

Needs the buyer's token: `Authorization: Bearer shoply_ct_...`, from Sign in with the code.

It is counted for the buyer's token: 30 changes in ten minutes.



## OpenAPI

````yaml /api-reference/openapi.json post /stores/{storeId}/customer/affiliate/payouts
openapi: 3.1.0
info:
  title: Shoply API
  version: '1'
  description: >-
    Everything a store's own server can do with a secret API key: its catalogue,
    orders, customers, marketing, finance and the rest of what the dashboard
    does. And the Customer API, which a buyer's own device asks with a token of
    theirs.
servers:
  - url: https://api.shoply.gg/v1
security:
  - apiKey: []
tags:
  - name: API key
  - name: Store
  - name: Domain
  - name: Payment methods
  - name: Analytics
  - name: Storefronts
  - name: Storefront code
  - name: Payment Routing
  - name: Custom payment methods
  - name: Products
  - name: Product pictures
  - name: Stock
  - name: Categories
  - name: Upsells
  - name: Subscriptions
  - name: Orders
  - name: Invoices
  - name: Reviews
  - name: Coupons
  - name: Coupon categories
  - name: Coupon pop-up
  - name: Sales
  - name: Blog
  - name: Search settings
  - name: Redirects
  - name: Sitemap
  - name: Cart Recovery
  - name: Email Marketing
  - name: Email Templates
  - name: Customers
  - name: Affiliates
  - name: Support Tickets
  - name: Blacklist
  - name: Fraud protection
  - name: Disputes
  - name: Finance
  - name: Tax
  - name: Expenses
  - name: Expense setup
  - name: API requests
  - name: Webhook endpoints
  - name: Webhook deliveries
  - name: Customer API
paths:
  /stores/{storeId}/customer/affiliate/payouts:
    post:
      tags:
        - Customer API
      summary: Ask for a payout
      description: >-
        Asks the seller to pay the affiliate, where the store allows payouts.
        The amount comes off their affiliate balance now and goes back if the
        seller declines or the request is taken back. One at a time. Shoply
        moves no money: the seller pays it and marks it paid.


        Needs the buyer's token: `Authorization: Bearer shoply_ct_...`, from
        Sign in with the code.


        It is counted for the buyer's token: 30 changes in ten minutes.
      operationId: customer.affiliate.payouts.create
      parameters:
        - name: storeId
          in: path
          required: true
          description: >-
            The store's ID, from Settings, General in its dashboard. It is not a
            secret: a page may show it.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  description: >-
                    How much, in the store's currency, up to their affiliate
                    balance.
                  example: 25
                details:
                  type: string
                  description: How they want to be paid, in their own words.
                  example: 'PayPal: ada@example.com'
              required:
                - amount
                - details
      responses:
        '201':
          description: It worked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    nullable: true
                  code:
                    nullable: true
                  data:
                    type: object
                    properties:
                      member:
                        type: boolean
                      canJoin:
                        type: boolean
                      offered:
                        type: object
                        properties:
                          commission:
                            type: integer
                          discount:
                            type: integer
                      active:
                        type: boolean
                      code:
                        type: string
                      link:
                        type: string
                      linkStart:
                        type: string
                      commission:
                        type: integer
                      discount:
                        type: integer
                      clicks:
                        type: integer
                      orders:
                        type: integer
                      earned:
                        type: object
                        properties:
                          amount:
                            type: integer
                          currencyCode:
                            type: string
                      balance:
                        type: object
                        properties:
                          currencyCode:
                            type: string
                          amount:
                            type: number
                      paidOut:
                        type: object
                        properties:
                          amount:
                            type: integer
                          currencyCode:
                            type: string
                      can:
                        type: object
                        properties:
                          editLink:
                            type: boolean
                          toStore:
                            type: boolean
                          payouts:
                            type: boolean
                      payout:
                        type: object
                        properties:
                          id:
                            type: string
                          amount:
                            type: integer
                          currencyCode:
                            type: string
                          details:
                            type: string
                          status:
                            type: string
                          note:
                            type: string
                          dateRequested:
                            type: string
                          dateResolved:
                            nullable: true
                      payouts:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            amount:
                              type: integer
                            currencyCode:
                              type: string
                            details:
                              type: string
                            status:
                              type: string
                            note:
                              type: string
                            dateRequested:
                              type: string
                            dateResolved:
                              nullable: true
                      changes:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            kind:
                              type: string
                            amount:
                              type: integer
                            balanceAfter:
                              type: number
                            currencyCode:
                              type: string
                            dateCreated:
                              type: string
                      limits:
                        type: object
                        properties:
                          codeMin:
                            type: integer
                          codeMax:
                            type: integer
                          details:
                            type: integer
              example:
                success: true
                message: null
                code: null
                data:
                  member: true
                  canJoin: false
                  offered:
                    commission: 10
                    discount: 5
                  active: true
                  code: ada-keys
                  link: https://northwind.myshoply.gg/?ref=ada-keys
                  linkStart: https://northwind.myshoply.gg/?ref=
                  commission: 20
                  discount: 5
                  clicks: 0
                  orders: 0
                  earned:
                    amount: 0
                    currencyCode: USD
                  balance:
                    amount: 7.5
                    currencyCode: USD
                  paidOut:
                    amount: 0
                    currencyCode: USD
                  can:
                    editLink: true
                    toStore: true
                    payouts: true
                  payout:
                    id: 76868d15-1286-4aa1-9181-1034971e5bf9
                    amount: 5
                    currencyCode: USD
                    details: 'PayPal: ada@example.com'
                    status: requested
                    note: ''
                    dateRequested: '2026-10-22T16:20:19Z'
                    dateResolved: null
                  payouts:
                    - id: 76868d15-1286-4aa1-9181-1034971e5bf9
                      amount: 5
                      currencyCode: USD
                      details: 'PayPal: ada@example.com'
                      status: requested
                      note: ''
                      dateRequested: '2026-10-22T16:20:19Z'
                      dateResolved: null
                  changes:
                    - id: 22405d5e-68b8-45a2-88c7-87cd881975c1
                      kind: payout
                      amount: -5
                      balanceAfter: 7.5
                      currencyCode: USD
                      dateCreated: '2026-10-22T16:20:19Z'
                    - id: 6b4221ce-60ee-4856-99c2-8efe0af9321b
                      kind: add
                      amount: 12.5
                      balanceAfter: 12.5
                      currencyCode: USD
                      dateCreated: '2026-10-22T16:20:19Z'
                  limits:
                    codeMin: 2
                    codeMax: 40
                    details: 300
        '401':
          $ref: '#/components/responses/NoToken'
        '403':
          $ref: '#/components/responses/StoreSaysNo'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/Refused'
        '429':
          $ref: '#/components/responses/CustomerTooMany'
      security:
        - customerToken: []
      x-codeSamples:
        - lang: javascript
          label: Node.js
          source: >
            import { ShoplyCustomer } from "@shoplygg/node";


            const buyer = new ShoplyCustomer({ storeId: "YOUR_STORE_ID", token
            });


            const result = await buyer.affiliate.payouts.create({
              amount: 25,
              details: "PayPal: ada@example.com",
            });
        - lang: php
          label: PHP
          source: >
            <?php


            require 'vendor/autoload.php';


            $buyer = new Shoply\Customer(['storeId' => 'YOUR_STORE_ID', 'token'
            => $token]);


            $result = $buyer->affiliate->payouts->create([
                'amount' => 25,
                'details' => 'PayPal: ada@example.com',
            ]);
        - lang: python
          label: Python
          source: >
            import shoply


            buyer = shoply.Customer("YOUR_STORE_ID", token=token)


            result = buyer.affiliate.payouts.create(amount=25, details="PayPal:
            ada@example.com")
components:
  responses:
    NoToken:
      description: >-
        No buyer's token was sent, or it was an API key
        (`customer_token_required`), or the token has ended or is another
        store's (`invalid_customer_token`). Sign the buyer in again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    StoreSaysNo:
      description: >-
        The store does not let a buyer do this itself: `cancel_off`, `undo_off`,
        `pause_off`, `affiliates_closed`. Its customer panel says the same.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    NotFound:
      description: >-
        There is no such thing in this store: `not_found`. A store that is not
        the key's own is answered the same way.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    Refused:
      description: >-
        The request was understood and not carried out. `validation_failed` says
        what is wrong with each field under `errors`; other codes are the
        route's own.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    CustomerTooMany:
      description: >-
        Too many requests for now: `rate_limited`, or the route's own
        (`code_cooldown`, `code_paused`, `store_busy`). `Retry-After` says how
        many seconds to wait.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
  schemas:
    Refusal:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: What is wrong, in words for a person.
        code:
          type: string
          description: What is wrong, as a word that does not change.
        data:
          nullable: true
        errors:
          type: object
          description: >-
            For `validation_failed`: what is wrong with each field, by the
            field's name.
          additionalProperties:
            type: string
      required:
        - success
        - message
        - code
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A secret API key, made under Developers in the dashboard:
        `Authorization: Bearer shoply_sk_...`
    customerToken:
      type: http
      scheme: bearer
      description: >-
        A buyer's token, from Sign in with the code: `Authorization: Bearer
        shoply_ct_...`. It reaches that buyer's own orders at one store, and no
        route that takes a key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.