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

# Create Peer To Peer Transfer

> Move crypto between two end users of your account. The transfer is internal to Ripio: nothing goes on-chain, it is settled immediately and it charges no fee.

## How it works

* Both end users must belong to your account, and they must be different end users.
* Both of them need a balance in `currency`. The sender needs at least `amount` available.
* The transfer is final as soon as the response comes back: the sender's balance is debited and
  the receiver's is credited in the same operation. If any check fails, no balance moves.
* Only the sender is checked against KYC. A receiver whose KYC is still pending can be paid.
* A banned end user cannot send or receive.

Each transfer creates two transactions of operation type `PEER_TO_PEER`, one for each end user:
`sender_transaction_id` and `receiver_transaction_id`. Both show up in
[List Transactions](https://docs.ripio.com/crypto-as-a-service/transactions/list-transactions.md) and in the daily
transactions report.

> [!NOTE]
>
> No webhook (IPN) is sent for peer to peer transfers. The response of this request already carries
> the final result.

## Idempotency

`external_ref` is your idempotency key and it is required. It is unique within your account.

If you send an `external_ref` that already exists, the response is the original transfer, with
status `201`, and **no balance moves**. This makes it safe to retry a request that timed out or
whose response you did not get: send it again with the same `external_ref`.

> [!WARNING]
>
> Only `external_ref` identifies the transfer. A repeated `external_ref` returns the original
> transfer even when `sender`, `receiver`, `currency` or `amount` are different, and the new values
> are ignored. Generate a new `external_ref` for every transfer you want to make.

To check whether a transfer went through, list it by its key:
`GET /api/v1/peer-to-peer/?external_ref=<your external_ref>`.


## OpenAPI

````yaml crypto-as-a-service/openapi.json POST /api/v1/peer-to-peer/
openapi: 3.0.2
info:
  title: B2B API
  version: '1.0'
  description: >-
    B2B API allows a third party to access different use cases and services
    inside of Ripio ecosystem. It is organized around RESTful constraints, with
    requests and responses in JSON format, using HTTP in the standard format and
    the answer codes. The API is designed to be compliant with OpenAPI
    Specification v3.0, which is a trusted open source standard for HTTP-Based
    APIs.


    The API offers the ability to test it with a simple, yet powerful sandbox
    that will enhance developer experience and replicate production capabilities
    in a well isolated and safe environment, giving developers full freedom to
    try the integration without compromises.


    # Error Handling


    If a request to B2B REST API fails, the response will contain an five-digit
    error code with a corresponding error message to indicate the details of the
    error.


    The following code snippet is a sample error response that contains an error
    code and message pair:


    ````

    {

    "code": 40001,

    "type": "NotAuthenticated",

    "detail": {

    "message": "Authentication credentials were not provided.",

    "code": "not_authenticated"

    },

    "status": 403

    }

    ````


    ## Error Codes


    | Code | Error Category | Description | Resolution |

    | :------- | :------ | :------ | :----- |

    | 20000   | Validation Error |  Raised when there is a semantic error in the
    payload of the request.  | Check the docs for precise information on how to
    provide correct values for each resource atribute.   |

    | 20001   | Parse Error |  Raised when the API receives a malformed JSON
    document. |  Check for syntax errors in the payload of your request. Also
    look for sample requests in the docs related to the desired operation.  |

    | 20010   | Expired Quote |  Raised when the received quote to execute has
    expired.  |  Generate a new quote and execute it within the 30 seconds time
    window.  |

    | 20011   | Already Executed Quote |  Raised when the received quote to
    execute has been executed before. |  Try Generating a new quote with the
    former pair/amounts to replicate a similar trade.  |

    | 20012  | Not Enough Balance |  Raised when the amount to operate
    (sale/purchase) is larger than the balance amount of the debited currency.
    |  Check end user's balances in order to inform the discrepancy before quote
    execution. Please contact our support team for further assistance.  |

    | 20013  | Buy Limit Frequency Exceeded |  Raised when the "BUY" frequency
    limit for a given end user has been reached.|  Check end user's limits using
    Limits API in order to inform the discrepancy before performing a quote
    execution. |

    | 20014  | Sell Limit Frequency Exceeded |  Raised when the "SELL" frequency
    limit for a given end user has been reached.|  Check end user's limits using
    Limits API in order to inform the discrepancy before performing a quote
    execution. |

    | 20015  | Buy Limit Amount Exceeded |  Raised when the "BUY" amount limit
    for a given end user has been reached.|  Check end user's limits using
    Limits API in order to inform the discrepancy before performing a quote
    execution. |

    | 20016  | Sell Limit Amount Exceeded |  Raised when the "SELL" amount limit
    for a given end user has been reached.|  Check end user's limits using
    Limits API in order to inform the discrepancy before performing a quote
    execution. |

    | 20017  | Buy Transaction Min Limit Exceeded |  Raised when the "BUY"
    amount min limit on a single transaction is exceeded.|  Check Ripio's min
    and max transaction limits. |

    | 20018  | Buy Transaction Max Limit Exceeded |  Raised when the "BUY"
    amount max limit on a single transaction is exceeded.|  Check Ripio's min
    and max transaction limits. |

    | 20019  | Sell Transaction Min Limit Exceeded |  Raised when the "SELL"
    amount min limit on a single transaction is exceeded.|  Check Ripio's min
    and max transaction limits. |

    | 20020  | Sell Transaction Max Limit Exceeded |  Raised when the "SELL"
    amount max limit on a single transaction is exceeded.|  Check Ripio's min
    and max transaction limits. |

    | 20021  | Banned EndUser |  Raised when a quote execution request comes
    from a banned user.| Please reach out our support team in order to get full
    detail on why the end user has been banned. |

    | 20022  | Swap Transaction Min Limit Exceeded |  Raised when the "SWAP"
    amount min limit on a single transaction is exceeded.|  Check Ripio's min
    and max transaction limits. |

    | 20023  | Swap Transaction Max Limit Exceeded |  Raised when the "SWAP"
    amount max limit on a single transaction is exceeded.|  Check Ripio's min
    and max transaction limits. |

    | 20024  | Swap Limit Frequency Exceeded |  Raised when the "SWAP" frequency
    limit for a given end user has been reached.|  Check end user's limits using
    Limits API in order to inform the discrepancy before performing a quote
    execution. |

    | 20025  | Swap Limit Amount Exceeded |  Raised when the "SWAP" amount limit
    for a given end user has been reached.|  Check end user's limits using
    Limits API in order to inform the discrepancy before performing a quote
    execution. |

    | 20026  | Quote With No Price |  Raised when the received reusable quote to
    execute has no price. |  Try Generating a new reusable quote with the former
    pair to replicate a similar trade.  |

    | 20027  | Expired Withdrawal Fee |  Raised when trying to execute a 
    withdrawal fee that has already expired. |  Request another withdrawal Fee. 
    |

    | 20029  | Invalid address |  Raised when the address provided  is not valid
    on given network. |  Try with a valid addres for that network.  |

    | 20030  | Kyc not approved for end user |  Raised  when the end user
    doesn't have a kyc process approved. |  Check the status of end user's
    verification submission |

    | 20031  | Kyc already approved for end user |  Raised  when the end user
    already has an approved kyc process. |  - |

    | 20032  | Invalid or disabled payment method type |  Raised  when the
    payment_method_type does not exist or is disabled  for the acccount. |
    Please reach out our support team.  |

    | 20033  | Frequency limit exceeded for fiat withdrawals |  Raised  when the
    QTY limit for a given currency in a FIAT_WITHDRAWAL  operation is exceeded.
    | -  |

    | 20034  | Amount limit exceeded for fiat withdrawals |  Raised when the
    amount limit for a given currency in a FIAT_WITHDRAWAL operation is
    exceeded. | -  |

    | 20035  | Fiat account is required |  Raised  when a fiat account is
    required. | Create a Fiat account first.  |

    | 20036  | Withdrawal amount less than network dust limit. |  Raised when
    the amount of withdrawal request is less to the network dust limit. |
    Increase Withrawal amount.  |

    | 20037  | There is no address created for end user and given network. | 
    Raised when there is no address for a given concrete network name. | Create
    an AutoSwap address first.  |

    ||

    | 40000   | Authentication Failed | Raised when an incoming request includes
    incorrect authentication. | Check for invalid credentials in your request
    when trying to authenticate. |

    | 40001   | Not Authenticated |  Raised when an unauthenticated request
    fails the permission checks. | Check if your request contains a valid and
    non-expired `access_token`. |

    | 40003   | Permission Denied | Raised when an authenticated request fails
    the permission checks. | Check if you have OAuth scopes to access requested
    resource. Please contact our support team if you think this is an error. |

    | 40004   | Not Found |  Raised when a resource does not exists at the given
    URL. | Check if the resource you're looking for does exist. |

    | 40005   | Method Not Allowed | Raised when an incoming request has been
    performed with certain HTTP verb that is not valid for the requested
    resource. | Check the resource's docs section to learn the accepted HTTP
    methods. |

    | 40006   | Bad Request | Raised when historical market price API endpoint
    has not been used properly. | Check for syntax errors in the payload of your
    request. Also look for sample requests in the docs related to the desired
    operation. |

    | 40007   | Bad Request | Raised when a currency network is not allowed to
    operate the selected currency. | Check if your request contains a valid
    network for the selected currency. |

    | 40008   | Not Found | Raised when a currency doesn't have its limits
    configured. | Please reach out our support team with the error details and
    detailed execution flow. |

    | 40009   | Bad Request | Raised when an existing Quote with  defined
    external_ref has not been executed, thus it can  not be excuted
    idempotently. | Use another external_ref for the Quote. |

    | 40010   | Service Unavailable | Raised when there are  no addresses
    available for networks compatible with a specific network name. | Please
    reach out our support team with the error details and detailed execution
    flow. |

    | 40015   | Unsupported Media Type | Raised when the content type of the
    request data is not JSON compliant. | Check if your request data is
    compliant with JSON format. |

    | 40029   | Throttled | Raised when an incoming request fails the throttling
    checks. | Check if you are exceding the daily/hourly request quota for your
    account. Please contact our support team if you think you'll need an
    extended quota for your use-case. |

    ||

    | 50003   | Service Unavailable | Raised when the service (or requested
    resource) is not available. | Please reach out our support team with the
    error details and detailed execution flow. |
  contact:
    name: Ripio
    email: b2b@ripio.com
    url: https://ripio.com
  termsOfService: https://www.ripio.com/ar/terms/
servers:
  - url: https://sandbox-b2b.ripio.com
    description: Sandbox environment
  - url: https://b2b-api.ripio.com/
    description: Production environment
security:
  - OAuth2: []
tags:
  - name: Access Token
  - name: Addresses
  - name: Auto Swap Addresses
  - name: Balance
  - name: Beneficiary Fiat Accounts
  - name: Deposit IPN
  - name: Deposits
  - name: End User
  - name: Fiat Accounts
  - name: IPN Webhooks
  - name: Pairs
  - name: Periodic Limits
  - name: Quote Execution
  - name: Quotes
  - name: Rates
  - name: Reusable Quote Execution
  - name: Reusable Quotes
  - name: Service Status
  - name: Swap Reusable Quote Execution
  - name: Swap Reusable Quotes
  - name: Transactions
  - name: TXN Limits
  - name: Withdrawals
  - name: Fiat Withdrawals
  - name: Fiat Deposits
  - name: KYC Requirements
  - name: KYC Submissions
  - name: Simulate Fiat Deposit
  - name: Simulate KYC Validation
  - name: Yields
  - name: Peer to Peer
  - name: IPN Messages
paths:
  /api/v1/peer-to-peer/:
    post:
      tags:
        - Peer to Peer
      summary: Create Peer To Peer Transfer
      operationId: post-api-v1-peer-to-peer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                external_ref:
                  type: string
                  maxLength: 320
                  description: >-
                    Your idempotency key for the transfer, unique within your
                    account. Sending an `external_ref` that already exists
                    returns the original transfer and moves no balance, whatever
                    the other fields say: use a new one for every transfer.
                sender:
                  type: string
                  maxLength: 250
                  description: External ref of the end user that sends the funds.
                receiver:
                  type: string
                  maxLength: 250
                  description: >-
                    External ref of the end user that receives the funds. Must
                    be a different end user than `sender`.
                currency:
                  type: string
                  maxLength: 10
                  description: >-
                    Symbol of the currency to transfer. Both end users must have
                    a balance in it.
                amount:
                  type: string
                  format: decimal
                  description: >-
                    Amount to transfer, greater than zero and with up to 8
                    decimals.
              required:
                - external_ref
                - sender
                - receiver
                - currency
                - amount
            example:
              external_ref: transfer-0001
              sender: 75c741a2-c3c8-46b1-a807-4fa1f40bf048
              receiver: 8a1d3c5e-7f20-4b9a-a1c3-5e6f7a8b9c0d
              currency: USDC
              amount: '25.5'
      responses:
        '201':
          description: >-
            Transfer created, or the original transfer when the `external_ref`
            already existed.
          content:
            application/json:
              schema:
                type: object
                title: Peer To Peer Response
                properties:
                  id:
                    type: string
                    format: uuid
                    description: UUID that identifies the peer to peer transfer.
                  external_ref:
                    type: string
                    nullable: true
                    description: >-
                      Your idempotency key for the transfer, unique within your
                      account. `null` only on transfers created before it became
                      required.
                  sender:
                    type: string
                    description: External ref of the end user that sent the funds.
                  receiver:
                    type: string
                    description: External ref of the end user that received the funds.
                  sender_transaction_id:
                    type: string
                    format: uuid
                    description: >-
                      ID of the `PEER_TO_PEER` transaction that debited the
                      sender.
                  receiver_transaction_id:
                    type: string
                    format: uuid
                    description: >-
                      ID of the `PEER_TO_PEER` transaction that credited the
                      receiver.
                  currency:
                    type: string
                    description: Symbol of the transferred currency.
                  amount:
                    type: string
                    format: decimal
                    description: Transferred amount, with up to 8 decimals.
                  created_at:
                    type: string
                    format: date-time
                    description: ISO format creation datetime.
              example:
                id: 3f0c2a8e-6d1b-4b7e-9c55-2a1d4e8f7b10
                external_ref: transfer-0001
                sender: 75c741a2-c3c8-46b1-a807-4fa1f40bf048
                receiver: 8a1d3c5e-7f20-4b9a-a1c3-5e6f7a8b9c0d
                sender_transaction_id: b6e1f0c2-3d4a-4e5f-8a9b-0c1d2e3f4a5b
                receiver_transaction_id: c7f2a1d3-4e5b-4f6a-9b0c-1d2e3f4a5b6c
                currency: USDC
                amount: '25.50000000'
                created_at: '2026-11-27T14:20:31.512094Z'
        '400':
          description: >-
            Invalid request, end user or balance not found, not enough balance,
            or the sender's KYC does not allow operating.
          content:
            application/json:
              schema:
                type: object
              examples:
                Missing external_ref:
                  value:
                    code: 20000
                    type: ValidationError
                    detail:
                      external_ref:
                        - message: This field is required.
                          code: required
                    status: 400
                Same sender and receiver:
                  value:
                    code: 20000
                    type: ValidationError
                    detail:
                      non_field_errors:
                        - message: Sender and receiver must be different end users
                          code: invalid
                    status: 400
                End user not found:
                  value:
                    code: 20000
                    type: ValidationError
                    detail:
                      non_field_errors:
                        - message: >-
                            Specified
                            receiver:8a1d3c5e-7f20-4b9a-a1c3-5e6f7a8b9c0d does
                            not exists
                          code: invalid
                    status: 400
                No balance in the currency:
                  value:
                    code: 20000
                    type: ValidationError
                    detail:
                      non_field_errors:
                        - message: >-
                            Specified currency's Balance (USDC) does not exist
                            for given receiver
                          code: invalid
                    status: 400
                Amount not positive:
                  value:
                    code: 20000
                    type: ValidationError
                    detail:
                      non_field_errors:
                        - message: Amount must be greater than zero
                          code: invalid
                    status: 400
                Not enough balance:
                  value:
                    code: 20012
                    type: NotEnoughBalance
                    detail:
                      message: Not enough balance on 'USDC' to PEER_TO_PEER
                    status: 400
                Sender KYC not approved:
                  value:
                    code: 20030
                    type: KycNotApprovedForEndUserException
                    detail:
                      message: >-
                        The end user '75c741a2-c3c8-46b1-a807-4fa1f40bf048' does
                        not have an approved KYC process.
                    status: 400
        '403':
          description: The sender or the receiver is banned.
          content:
            application/json:
              schema:
                type: object
              example:
                code: 20021
                type: BannedEndUser
                detail:
                  message: End user 75c741a2-c3c8-46b1-a807-4fa1f40bf048 is banned
                status: 403
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            read: Default scope to read all resources.
            write: Default scope to performe write operations on certain resources.
          tokenUrl: https://sandbox-b2b.ripio.com/oauth2/token/
      description: >
        B2B’s White Label API uses OAuth2. Currently there is only one supported
        authentication flow:


        * **clientCredentials** allows you to access your own B2B account
        (First-Party Integration) and performs transactions against the public
        API. This oauth2 flow is well suited for this API, as it allows
        machine-to-machine communication.


        Every call to the API has to be authenticated with an OAuth2 Token. In
        order to request this token, you will need to have sandbox or production
        API Keys (client id and client secret) that will be needed to generate a
        credential in order to negotiate an ephemeral access token.


        Every request must be accompianed by an `Authorization` header with a
        value that follows the following schema: `Bearer ACCESS_TOKEN`

````

## Related topics

- [List Peer To Peer Transfers](https://docs.ripio.com/crypto-as-a-service/peer-to-peer/list-peer-to-peer.md)
- [Retrieve Peer To Peer Transfer](https://docs.ripio.com/crypto-as-a-service/peer-to-peer/retrieve-peer-to-peer.md)
- [wFiat stablecoins](https://docs.ripio.com/wfiat/overview.md)
- [Create Withdrawal Fee](https://docs.ripio.com/crypto-as-a-service/withdrawals/create-withdrawal-fee.md)
- [Create Deposit Account](https://docs.ripio.com/ramps-api/customers/create-deposit-account.md)


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