> For the complete documentation index, see [llms.txt](https://aplazo.gitbook.io/aplazo-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aplazo.gitbook.io/aplazo-integrations/api-reference/in-store-api/create-a-payment.md).

# Create a payment

## Environments

{% tabs %}
{% tab title="Development" %}
<https://api.aplazo.net>
{% endtab %}

{% tab title="Production" %}
<https://api.aplazo.mx>
{% endtab %}
{% endtabs %}

## Create Payment

> Initiates a new payment process using Aplazo's in-store payment system.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo In-Store Payments API","version":"1.0.0"},"servers":[{"url":"https://api.aplazo.net"}],"security":[{"api_token":[],"merchant_id":[]}],"components":{"securitySchemes":{"api_token":{"type":"apiKey","in":"header","name":"api_token"}}},"paths":{"/api/pos/loan":{"post":{"summary":"Create Payment","description":"Initiates a new payment process using Aplazo's in-store payment system.","operationId":"createPayment","tags":["Payment"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["custLogin","shopId","cartId","webhookUrl","products","taxes","totalAmount","orderDiscount","discountType","commChannel"],"properties":{"custLogin":{"type":"string","description":"Customer phone number.","minLength":10,"maxLength":10,"pattern":"^[0-9]{10}$"},"shopId":{"type":"string","description":"Aplazo identifier for the store.","pattern":"^\\d+$"},"cartId":{"type":"string","description":"Identifier in the merchant POS for the order/transaction, unique across all stores."},"webhookUrl":{"type":"string","description":"Merchant-provided URL where Aplazo will communicate the payment confirmation.","format":"uri"},"products":{"type":"array","description":"Product details.","minItems":1,"items":{"type":"object","required":["id","externalId","quantity","unitPrice","title"],"properties":{"id":{"type":"string","description":"Id for the item."},"externalId":{"type":"string","description":"Id of the item in the merchant POS system."},"quantity":{"type":"integer","description":"Quantity of the product purchased.","minimum":1},"unitPrice":{"type":"number","format":"float","description":"Price of the item, including taxes and excluding discounts.","minimum":0},"discount":{"type":"number","format":"float","description":"Discount applied to the item.","minimum":0},"discountType":{"type":"string","description":"Type of discount applied (\"a\" for amount, \"p\" for percentage).","enum":["a","p"]},"discountPrice":{"type":"number","format":"float","description":"Price of the item after discounts are applied.","minimum":0},"title":{"type":"string","description":"Name of the item."},"description":{"type":"string","description":"Item description in the merchant system."}}}},"taxes":{"type":"array","description":"Taxes information at the order level.","items":{"type":"object","required":["title","price"],"properties":{"price":{"type":"number","format":"float","description":"Amount charged for the tax concept.","minimum":0},"title":{"type":"string","description":"Name of the tax."}}}},"totalAmount":{"type":"number","format":"float","description":"Total amount of the order, including discounts.","minimum":0},"orderDiscount":{"type":"number","format":"float","description":"Discount at the order level applied in the merchant system (informational only).","minimum":0},"discountType":{"type":"string","description":"Type of discount applied (\"a\" for amount, \"p\" for percentage).","enum":["a","p"]},"commChannel":{"type":"string","description":"Type of communication to be sent to the customer (\"w\" for WhatsApp, \"s\" for SMS, \"q\" for QR code).","enum":["w","s","q"]}}}}}},"responses":{"200":{"description":"Payment created successfully. Example with commChannel 'q' for QR Code.","content":{"application/json":{"schema":{"type":"object","required":["custLogin","shopId","cartId","webhookUrl","products","taxes","totalAmount","orderDiscount","discountType"],"properties":{"custLogin":{"type":"string","description":"Customer phone number."},"zipCode":{"type":"string","nullable":true,"description":"Customer zip code if registered."},"shopId":{"type":"string","description":"Aplazo identifier for the store."},"cartId":{"type":"string","description":"Identifier in the merchant POS for the order/transaction."},"webhookUrl":{"type":"string","description":"Merchant-provided URL where Aplazo will communicate the loan confirmation."},"products":{"type":"array","description":"Product details.","items":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"quantity":{"type":"integer"},"unitPrice":{"type":"number","format":"float"},"discount":{"type":"number","format":"float"},"discountType":{"type":"string","enum":["a","p"]},"discountPrice":{"type":"number","format":"float"},"title":{"type":"string"},"description":{"type":"string"}}}},"taxes":{"type":"array","description":"Taxes information.","items":{"type":"object","properties":{"price":{"type":"number","format":"float"},"title":{"type":"string"}}}},"totalAmount":{"type":"number","format":"float"},"orderDiscount":{"type":"number","format":"float"},"discountType":{"type":"string","enum":["a","p"]},"qr":{"type":"string","description":"QR code to be presented at the point of sale for customers to scan and complete the checkout process on their phones. Will be null when commChannel is 's' or 'w'.","format":"uri","nullable":true}}}}}}}}}}}
```
