Orders
Orders represent a financing transaction between a borrower and a merchant. Once a borrower has been approved for financing, an order can be created for the amount being financed. Credit Key manages the financing agreement, repayment schedule, and loan servicing associated with the order.
Orders can be created through a hosted checkout flow or directly through the Orders API, depending on your integration model.
Order Lifecycle
A Credit Key order progresses through a defined set of statuses.
| Status | Description |
|---|---|
| CREATED | The order has been created but has not yet been confirmed by the merchant. |
| AUTHORIZED | The order has been accepted and reserved against the borrower's available credit line. |
| CAPTURED | The order has been fulfilled or shipped. Funds become available for disbursement and repayment begins. |
| CANCELED | The order was canceled before fulfillment. No funds are disbursed. |
| RETURNED | The order was refunded after capture. Funds and payments are reversed. |
Typical order flow:
- Create an Order
- Authorize the Order
- Capture the Order
- Refund or Return the Order (if necessary)
Order Object
The Order object contains information about the financed purchase, borrower, financing terms, and current status.
Example
{
"key": "CK-ABC1234",
"company_id": 12345,
"merchant_order_id": "ORD-10001",
"amount": 2500.00,
"status": "AUTHORIZED",
"installments": 12,
"created_at": "2026-06-01T15:30:00Z",
"capture_date": null,
"externally_managed_payments": false
}Attributes
| Attribute | Type | Description |
|---|---|---|
| key | string | Unique Credit Key identifier for the order. |
| company_id | integer | Credit Key company identifier associated with the borrower. |
| merchant_order_id | string | Merchant's internal order number. |
| amount | decimal | Total financed amount. |
| status | string | Current order status. |
| installments | integer | Number of monthly installments selected by the borrower. |
| capture_date | date | Date the order was captured. |
| externally_managed_payments | boolean | Indicates whether loan payments are managed by the merchant. |
| created_at | datetime | Timestamp when the order was created. |
Creating an Order
Orders can be created after a borrower has been approved for financing.
Depending on your integration:
Hosted Checkout
Create a hosted checkout session and allow the borrower to complete the financing flow. Once the borrower accepts financing terms, a Credit Key order is generated automatically.
Direct Orders API
For ERP, in-store, or custom checkout integrations, orders may be created directly through the Orders API using a previously approved company record.
A successful response will include a Credit Key order key which should be stored by your system for future order management operations.
Retrieving an Order
Retrieve the current details and status of an order using the order key.
GET /v1/order/{key}This endpoint can be used to:
- Verify the current status of an order
- Retrieve financing information
- Reconcile merchant records with Credit Key
Updating an Order
Order information can be updated before capture.
PATCH /v1/order/{key}Supported updates include:
- Merchant order ID
- Order amount
- Cart contents
- Shipping information
- Order status transitions
Once an order has been captured, amount changes are no longer permitted.
Capturing an Order
Orders should be captured when goods have shipped or services have been delivered.
PATCH /v1/order/{key}with:
{
"status": "CAPTURED"
}Capturing an order:
- Initiates the borrower repayment schedule
- Makes funds available for merchant disbursement
- Finalizes the financed amount
Best Practice: Capture orders only after fulfillment has occurred.
Canceling an Order
Orders may be canceled prior to capture.
PATCH /v1/order/{key}with:
{
"status": "CANCELED"
}Common reasons include:
- Customer cancellation
- Inventory shortages
- Fraud review failures
Canceled orders release the reserved credit back to the borrower.
Refunding an Order
Captured orders may be refunded either partially or in full.
Refunds adjust the borrower's repayment obligations and may result in a clawback of merchant funds depending on settlement timing.
PATCH /v1/order/{key}/refundCommon refund scenarios include:
- Returned merchandise
- Price adjustments
- Shipping corrections
- Order reversals
Best Practices
- Store the Credit Key order key immediately after order creation.
- Keep Credit Key synchronized with changes to order totals and fulfillment status.
- Capture orders only after shipment or fulfillment.
- Use webhooks to receive asynchronous status updates.
- Reconcile merchant orders regularly using the order retrieval endpoint.
Related Endpoints
| Endpoint | Purpose |
|---|---|
| POST /order | Create a new order |
| GET /order/{key} | Retrieve an order |
| PATCH /order/{key} | Update an order |
| PATCH /order/{key}/refund | Refund an order |
| Webhooks | Receive order status updates |
