One Time Charge

One-time application charges are exactly what they say they are - a one-time charge created and issued to the store owner for purchasing your app. Once the store owner accepts the charge and the app activates it, the store owner is billed for their app purchase on their next invoice.

Let us have a deeper look into it:

To charge a shop a one-time fee, we need a name which should appear under (on the shop owner’s invoice), the price your application is charging, and a return_url to where Shoplo will redirect the shop owner to after they have accepted or declined the charge.

Setting the test flag to true will set the ApplicationCharge to not actually charge the credit card it otherwise would. This allows you to test the billing api before getting rich.

The application charge will be created with a pending status. This means that the charge now awaits for the shop owner acceptation. Proceed by redirecting the shop owner to the confirmation_url set in the response where they may accept or decline the charge.

After the charge has been accepted or declined, Shoplo redirects the shop owner to the return_url set in the request. At this point the charge is either in an accepted or declined state. In order to actually receive payment for this charge it must be activated by your application.

Application Charge Reference

Receive a list of all your application charges

GET /services/application_charges

Returns all application_charges

HTTP/1.1 200 OK
{
	"application_charges": [
		{
			"id":"1",
			"name":"My first Application Charge",
			"price":"123456",
			"return_url":"https:\/\/app-domain.com\/after-confirmation",
			"status":"pending",
			"test":"0",
			"confirmation_url":"https:\/\/classicshop.shoplo.com\/admin\/application-charge-confirmation\/1",
			"activated_on": null
			"created_at":"2014-11-22 00:00:00",
			"updated_at":"2014-11-22 00:00:00"
		},
		{
			"id":"2",
			"name":"My second Application Charge",
			"price":"123456",
			"return_url":"https:\/\/app-domain2.com\/after-confirmation",
			"status":"accepted",
			"test":"1",
			"confirmation_url":"https:\/\/classicshop.shoplo.com\/admin\/application-charge-confirmation\/2",
			"activated_on": null
			"created_at":"2014-11-22 00:00:00",
			"updated_at":"2014-11-22 00:00:00"
		}
	]
}

				

Receive one application charges

GET /services/application_charges/{id}

Returns all application_charges

HTTP/1.1 200 OK
{
	"application_charges": [
		{
			"id":"1",
			"name":"My first Application Charge",
			"price":"123456",
			"return_url":"https:\/\/app-domain.com\/after-confirmation",
			"status":"pending",
			"test":"0",
			"confirmation_url":"https:\/\/classicshop.shoplo.com\/admin\/application-charge-confirmation\/1",
			"activated_on":null
			"created_at":"2014-11-22 00:00:00",
			"updated_at":"2014-11-22 00:00:00"
		}
	]
}

				

Count all application charges

GET /services/application_charges/count

Returns all application_charges

HTTP/1.1 200 OK
{
	"count":13
}

				

Create application charges

POST /services/application_charges

Create application_charges with specified params

Request

{
	"application_charge":{
		"name":"My first Application Charge",
		"price":123456
		"return_url":"https:\/\/app-domain.com\/after-confirmation",
		"test":"0",
	}
}

				
Response

{
	"application_charges": [
		{
			"id":"1",
			"name":"My first Application Charge",
			"price":"123456",
			"return_url":"https:\/\/app-domain.com\/after-confirmation",
			"status":"pending",
			"test":"0",
			"confirmation_url":"https:\/\/classicshop.shoplo.com\/admin\/application-charge-confirmation\/1",
			"activated_on":null
			"created_at":"2014-11-22 00:00:00",
			"updated_at":"2014-11-22 00:00:00"
		}
	]
}

				

Activate a application charges

POST /services/application_charges/{id}/activate

Activate application_charges

HTTP/1.1 200 OK
{
	"application_charges":
		{
			"id":"1",
			"name":"My first Application Charge",
			"price":"123456",
			"return_url":"https:\/\/app-domain.com\/after-confirmation",
			"status":"accepted",
			"test":"0",
			"confirmation_url":"https:\/\/classicshop.shoplo.com\/admin\/application-charge-confirmation\/1",
			"activated_on":"2014-11-23 12:13:14"
			"created_at":"2014-11-22 00:00:00",
			"updated_at":"2014-11-22 00:00:00"
		}
}

				

Delete a application charges

DELETE /services/application_charges/{id}

Delete application_charges

HTTP/1.1 200 OK
{
}