# xMoney API Reference

This documentation provides a comprehensive guide to xMoney's REST API, 
enabling you to seamlessly authenticate, make requests, and retrieve data. 
Our API accepts form-encoded request bodies and returns responses 
in JSON format for easy integration with your applications.

Version: 1.0

## Servers

Staging
```
https://api-stage.xmoney.com
```

Office Staging
```
https://office-api-stage.xmoney.com
```

## Security

### Bearer

API Private Key

Type: http
Scheme: bearer
Bearer Format: JWT

## Download OpenAPI description

[xMoney API Reference](https://docs.xmoney.com/_bundle/api/reference.yaml)

## Order

This API resource manages orders, enabling creation, retrieval, and cancellation. This facilitates payment processing within the order management flow. It also supports management of recurring orders, including cancellation and rebilling.

### Create an order

 - [POST /order](https://docs.xmoney.com/api/reference/order/create-an-order.md): This endpoint creates new orders, supporting both one-time purchases and recurring subscriptions.

### List all orders

 - [GET /order](https://docs.xmoney.com/api/reference/order/list-all-orders.md): Retrieve a list of orders, optionally filtered by various criteria.

### Retrieve an order

 - [GET /order/{id}](https://docs.xmoney.com/api/reference/order/retrieve-an-order.md): Retrieve a specific order by its ID.

### Cancel a recurring order

 - [DELETE /order/{id}](https://docs.xmoney.com/api/reference/order/cancel-a-recurring-order.md): An open order may be canceled if it does not have any payments yet.

### Initiate managed order transaction

 - [PATCH /order-rebill/{id}](https://docs.xmoney.com/api/reference/order/initiate-recurring-order-transaction.md): Manually bills a customer for their managed order. This endpoint allows merchants to control when managed order payments are processed.

## Transaction

This API resource allows you to manage transactions processed through xMoney. Key functionalities include retrieving lists and details of transactions, capturing funds for authorized payments, and issuing refunds.

### List all transactions

 - [GET /transaction](https://docs.xmoney.com/api/reference/transaction/list-all-transactions.md): Retrieve a list of transactions, optionally filtered by various criteria.

### Retrieve a transaction

 - [GET /transaction/{id}](https://docs.xmoney.com/api/reference/transaction/retrieve-a-transaction.md): Retrieve a specific transaction by its ID.

### Capture a transaction

 - [PUT /transaction/{id}](https://docs.xmoney.com/api/reference/transaction/capture-a-transaction.md): Capture a transaction that has been authorized but not yet captured.

### Refund a transaction

 - [DELETE /transaction/{id}](https://docs.xmoney.com/api/reference/transaction/refund-a-transaction.md): Initiate a refund for a transaction.

## Customer

Use this API resource to manage your customers. You can create customers for payments, retrieve and update their information, and delete them (which cancels all mandates and subscriptions).

### Create a customer

 - [POST /customer](https://docs.xmoney.com/api/reference/customer/create-a-customer.md): Create a new customer object for processing payments.

### List all customers

 - [GET /customer](https://docs.xmoney.com/api/reference/customer/list-all-customers.md): Use this to fetch a list of your customers.

### Retrieve a customer

 - [GET /customer/{id}](https://docs.xmoney.com/api/reference/customer/retrieve-a-customer.md): Retrieve a customer by its ID.

### Update a customer

 - [PUT /customer/{id}](https://docs.xmoney.com/api/reference/customer/update-a-customer.md): Use this endpoint to update your customer's details.

### Delete a customer

 - [DELETE /customer/{id}](https://docs.xmoney.com/api/reference/customer/delete-a-customer.md): Permanently deletes a customer. All mandates and subscriptions created for this customer will be canceled as well.

## Card

This endpoint allows you to manage customer cards, including retrieving lists and details of cards, and deleting cards.

### List all cards

 - [GET /card](https://docs.xmoney.com/api/reference/card/list-all-cards.md): Retrieve a list of cards for a specific customer.

### Retrieve a card

 - [GET /card/{id}](https://docs.xmoney.com/api/reference/card/retrieve-a-card.md): Retrieve details of a specific card.

### Delete a card

 - [DELETE /card/{id}](https://docs.xmoney.com/api/reference/card/delete-a-card.md): Delete a specific card.

## Payment Links

The Payment Links API lets you create, manage and track one-off or recurring payment links for a given site. You can generate hosted payment links that you can send to customers (email, SMS, chat, etc.). It supports simple one-time purchases or recurring subscriptions.

### Get a list of payment links

 - [GET /payment-link](https://docs.xmoney.com/api/reference/payment-links/getpaymentlinklist.md)

### Create payment link for site

 - [POST /payment-link](https://docs.xmoney.com/api/reference/payment-links/createpaymentlink.md)

### Get a payment link by its hash

 - [GET /payment-link/{hash}](https://docs.xmoney.com/api/reference/payment-links/getpaymentlinkbyhash.md)

### Update a specific payment link by its hash

 - [PUT /payment-link/{hash}](https://docs.xmoney.com/api/reference/payment-links/updatepaymentlinkbyhash.md)

### Deletes a payment link

 - [DELETE /payment-link/{hash}](https://docs.xmoney.com/api/reference/payment-links/deletepaymentlink.md)

