Pin Payments · Capability

Pin Payments API — Customers

Pin Payments API — Customers. 11 operations. Lead operation: Create a customer. Self-contained Naftiko capability covering one Pin Payments business surface.

Run with Naftiko Pin PaymentsCustomers

What You Can Do

POST
Post — Create a customer
/v1/customers
GET
Get — List customers
/v1/customers
GET
Get — Retrieve a customer
/v1/customers/{customer-token}
PUT
Put — Update a customer
/v1/customers/{customer-token}
DELETE
Delete — Delete a customer
/v1/customers/{customer-token}
GET
Get — List cards for a customer
/v1/customers/{customer-token}/cards
POST
Post — Add a card to a customer
/v1/customers/{customer-token}/cards
DELETE
Delete — Remove a non-primary card from a customer
/v1/customers/{customer-token}/cards/{card-token}
GET
Get — List charges for a customer
/v1/customers/{customer-token}/charges
GET
Get — List subscriptions for a customer
/v1/customers/{customer-token}/subscriptions
DELETE
Delete — Cancel a customer subscription
/v1/customers/{customer-token}/subscriptions/{sub-token}

MCP Tools

create-customer

Create a customer

list-customers

List customers

read-only idempotent
retrieve-customer

Retrieve a customer

read-only idempotent
update-customer

Update a customer

idempotent
delete-customer

Delete a customer

idempotent
list-cards-customer

List cards for a customer

read-only idempotent
add-card-customer

Add a card to a customer

remove-non-primary-card-customer

Remove a non-primary card from a customer

idempotent
list-charges-customer

List charges for a customer

read-only idempotent
list-subscriptions-customer

List subscriptions for a customer

read-only idempotent
cancel-customer-subscription

Cancel a customer subscription

idempotent

Capability Spec

pin-payments-customers.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Pin Payments API — Customers
  description: 'Pin Payments API — Customers. 11 operations. Lead operation: Create a customer. Self-contained Naftiko capability
    covering one Pin Payments business surface.'
  tags:
  - Pin Payments
  - Customers
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PIN_PAYMENTS_API_KEY: PIN_PAYMENTS_API_KEY
capability:
  consumes:
  - type: http
    namespace: pin-payments-customers
    baseUri: https://api.pinpayments.com/1
    description: Pin Payments API — Customers business capability. Self-contained, no shared references.
    resources:
    - name: customers
      path: /customers
      operations:
      - name: post
        method: POST
        description: Create a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: get
        method: GET
        description: List customers
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: customers-customer_token
      path: /customers/{customer_token}
      operations:
      - name: get
        method: GET
        description: Retrieve a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: put
        method: PUT
        description: Update a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: delete
        method: DELETE
        description: Delete a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: customers-customer_token-cards
      path: /customers/{customer_token}/cards
      operations:
      - name: get
        method: GET
        description: List cards for a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: post
        method: POST
        description: Add a card to a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: customers-customer_token-cards-card_token
      path: /customers/{customer_token}/cards/{card_token}
      operations:
      - name: delete
        method: DELETE
        description: Remove a non-primary card from a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: card_token
          in: path
          type: string
          required: true
    - name: customers-customer_token-charges
      path: /customers/{customer_token}/charges
      operations:
      - name: get
        method: GET
        description: List charges for a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: customers-customer_token-subscriptions
      path: /customers/{customer_token}/subscriptions
      operations:
      - name: get
        method: GET
        description: List subscriptions for a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: customers-customer_token-subscriptions-sub_token
      path: /customers/{customer_token}/subscriptions/{sub_token}
      operations:
      - name: delete
        method: DELETE
        description: Cancel a customer subscription
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: sub_token
          in: path
          type: string
          required: true
    authentication:
      type: basic
      username: '{{env.PIN_PAYMENTS_USER}}'
      password: '{{env.PIN_PAYMENTS_PASS}}'
  exposes:
  - type: rest
    namespace: pin-payments-customers-rest
    port: 8080
    description: REST adapter for Pin Payments API — Customers. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/customers
      name: customers
      description: REST surface for customers.
      operations:
      - method: POST
        name: post
        description: Create a customer
        call: pin-payments-customers.post
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: get
        description: List customers
        call: pin-payments-customers.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/customers/{customer-token}
      name: customers-customer-token
      description: REST surface for customers-customer_token.
      operations:
      - method: GET
        name: get
        description: Retrieve a customer
        call: pin-payments-customers.get
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Update a customer
        call: pin-payments-customers.put
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: delete
        description: Delete a customer
        call: pin-payments-customers.delete
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/customers/{customer-token}/cards
      name: customers-customer-token-cards
      description: REST surface for customers-customer_token-cards.
      operations:
      - method: GET
        name: get
        description: List cards for a customer
        call: pin-payments-customers.get
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Add a card to a customer
        call: pin-payments-customers.post
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/customers/{customer-token}/cards/{card-token}
      name: customers-customer-token-cards-card-token
      description: REST surface for customers-customer_token-cards-card_token.
      operations:
      - method: DELETE
        name: delete
        description: Remove a non-primary card from a customer
        call: pin-payments-customers.delete
        with:
          card_token: rest.card_token
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/customers/{customer-token}/charges
      name: customers-customer-token-charges
      description: REST surface for customers-customer_token-charges.
      operations:
      - method: GET
        name: get
        description: List charges for a customer
        call: pin-payments-customers.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/customers/{customer-token}/subscriptions
      name: customers-customer-token-subscriptions
      description: REST surface for customers-customer_token-subscriptions.
      operations:
      - method: GET
        name: get
        description: List subscriptions for a customer
        call: pin-payments-customers.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/customers/{customer-token}/subscriptions/{sub-token}
      name: customers-customer-token-subscriptions-sub-token
      description: REST surface for customers-customer_token-subscriptions-sub_token.
      operations:
      - method: DELETE
        name: delete
        description: Cancel a customer subscription
        call: pin-payments-customers.delete
        with:
          sub_token: rest.sub_token
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: pin-payments-customers-mcp
    port: 9090
    transport: http
    description: MCP adapter for Pin Payments API — Customers. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: create-customer
      description: Create a customer
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: pin-payments-customers.post
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-customers
      description: List customers
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pin-payments-customers.get
      outputParameters:
      - type: object
        mapping: $.
    - name: retrieve-customer
      description: Retrieve a customer
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pin-payments-customers.get
      outputParameters:
      - type: object
        mapping: $.
    - name: update-customer
      description: Update a customer
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: pin-payments-customers.put
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-customer
      description: Delete a customer
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: pin-payments-customers.delete
      outputParameters:
      - type: object
        mapping: $.
    - name: list-cards-customer
      description: List cards for a customer
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pin-payments-customers.get
      outputParameters:
      - type: object
        mapping: $.
    - name: add-card-customer
      description: Add a card to a customer
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: pin-payments-customers.post
      outputParameters:
      - type: object
        mapping: $.
    - name: remove-non-primary-card-customer
      description: Remove a non-primary card from a customer
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: pin-payments-customers.delete
      with:
        card_token: tools.card_token
      outputParameters:
      - type: object
        mapping: $.
    - name: list-charges-customer
      description: List charges for a customer
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pin-payments-customers.get
      outputParameters:
      - type: object
        mapping: $.
    - name: list-subscriptions-customer
      description: List subscriptions for a customer
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pin-payments-customers.get
      outputParameters:
      - type: object
        mapping: $.
    - name: cancel-customer-subscription
      description: Cancel a customer subscription
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: pin-payments-customers.delete
      with:
        sub_token: tools.sub_token
      outputParameters:
      - type: object
        mapping: $.