Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs

Adds credit to a customer account.


Adds customer credit to a customer account. This function takes one of three input parameters to identify the customer: Customer_ID, Customer_Login, or Edit_Customer.

Before you begin#

  • The API token needs CustomerCreditHistory_Insert, either assigned directly under Functions or through a group. See Create an API token.
  • Requests must be signed if the token requires it. See Make a signed request with HMAC.
  • You need the customer’s Customer_ID, Customer_Login or Edit_Customer.

Example requests#

Add credit for an order#

Adds $10.50 of credit to the customer and links it to order 12345.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "CustomerCreditHistory_Insert",
    "Customer_Login": "{{Customer_Login}}",
    "Amount": "10.50",
    "Description": "Credit For Order 12345",
    "TransactionReference": "12345"
}

Request parameters#

Parameter Type Required Description
customer_id
edit_customer
customer_login
Number
String
String
The customer id
The customer login
The customer login
Amount Number Yes Amount of credit for the customer account. Can’t be zero.
Description String Yes Credit Description
TransactionReference String No Optional Value to link the credit to a specific order number

Example response#

{
    "success": 1
}

Response parameters#

Parameter Type Description
success Boolean Boolean Value if the request was successful
Function Use it to
CustomerCreditHistoryList_Load_Query List a customer’s credit history
CustomerCreditHistory_Delete Delete a credit history record
CustomerList_Load_Query Check a customer’s current credit balance

Try in Postman#

In the Miva: JSON API: Authenticated collection, open Customers > CustomerCreditHistory_Insert. See Set Up Postman.